Libya's Prime Minister Ahmed Maiteeq speaks during a news conference in Tripoli on June 9, 2014. Picture: Hani Amara

Tripoli, Libya -

Libya's top court on Monday rejected the Islamist-led Parliament's appointment of a new prime minister in a contested vote, ending one power struggle as a renegade general's offensive against Islamist militias in the east rages on.

The Supreme Constitutional Court declared Prime Minister Ahmed Maiteeq's appointment unconstitutional, but gave no further details or instructions. Islamists in Parliament and Maiteeq said they would abide by the decision, thus leaving interim Prime Minister Abdullah al-Thinni in office.

The top UN envoy to Libya called the decision and promises to abide by it “a sign of hope”.

“This will not solve the political crisis but at least it would open the way forward towards a resumption of a normal political process,” he told reporters after briefing the UN Security Council in New York.

Al-Thinni refused to give up his office after last month's vote in Parliament, which saw a walkout by secular lawmakers and Islamists secure votes from legislators that opponents said weren't there. Maiteeq, a businessman who owns a luxury hotel in the capital, Tripoli, entered the government's headquarters last week backed by an Islamist militia.

Twelve lawmakers later brought the matter to Libya's Supreme Constitutional Court to challenge the vote that named Maiteeq as interim prime minister.

Saleh al-Makhzoum, the second deputy of parliament, told journalists after the court decision that the body would comply with the decision for the sake of the “state of law.” Maiteeq also said he would “be the first to submit to the court decision and respect the judiciary”.

“What happened today is that we have made important gains toward building a state of law and institutions that we all are seeking,” he told journalists.

Libya has sunk into chaos following the downfall and the killing of longtime dictator Muammar Gaddafi in the country's 2011 civil war. Heavily armed militias, born out of the rebel groups that toppled Gaddafi, now are the main power in the country.

Mitri said the UN mission, which he heads, is planning to convene “a political dialogue” including about 50 major participants from the government, revolutionary groups, civil society, tribal communities, women and other sectors on June 18-19.

The aim is to help facilitate a smooth political process leading to parliamentary elections slated for June 25.

“The stakes are high, and we will spare no effort in helping prevent Libya's descent into greater instability and violence,” Mitri said.

The ruling comes as renegade General Khalifa Haftar wages an offensive against Islamist militias. Over the past weeks, forces allied with Haftar have bombed the camps of Islamist militias, which have attacked his forces, including an assassination attempt on Haftar that killed four people.

The general has warned he will detain Islamist lawmakers, accusing them of financing militias which he blames for much of Libya's chaos. In turn, Islamist politicians and others have accused him of launching a “coup”, though many tired of the turmoil in Libya have backed him with mass rallies. -