Libyan Prime Minister Ali Zeidan said a "compromise" had been reached with ex-rebel militias who had given Libya's interim assembly a deadline to hand over power.
Powerful militias made up of former rebels from the western town of Zintan had given the General National Congress, the country's highest political authority, a late Tuesday deadline to quit, threatening to seize any lawmaker who ignored it.
Zeidan said the deadline had been extended by 72 hours but did not give further details of the compromise, telling journalists only that "wisdom has prevailed" after discussions with representatives from the militias, the assembly and the UN.
The potential crisis arose exactly three years after the start of the Arab Spring uprising that toppled dictator Moamer Kadhafi but left the sprawling North African country with a weak central government that has struggled to impose order on former rebel brigades.
The commanders of the Zintan militias had said in a televised statement that they were giving the assembly five hours, until 1930 GMT, to "hand over power", pointing to a February 7 end of its mandate that it had extended.
"Any member of Congress who stays will be... a legitimate target and will be arrested, then judged," they said.
However the deadline passed with no action taken by the militias, and Zeidan -- who himself was kidnapped and briefly held by armed men last year -- announced the enigmatic "compromise".
The ultimatum had triggered a meeting between the head of the UN mission to Libya, Tarek Metri, and the militias' commanders.
"I asked them to give a chance to political dialogue on the basis of general elections being held," Metri told AFP.
The speaker of the General National Congress, Nuri Abu Sahmein, had earlier rejected the militias' ultimatum, calling it "a coup d'etat".
He said the army had been ordered to act against the militias, though no unusual troop movements were observed in the capital Tripoli following the video threat.
The Zintan militias issuing the ultimatum included the Al-Qaaqaa and Al-Sawaiq brigades, two of the most powerful and well-disciplined militias in the country, both nominally loyal to the regular army.
Zintan, in the mainly Berber highlands southwest of Tripoli, was one of the bastions of the NATO-backed uprising that ended the four-decade rule of Kadhafi, who was captured and killed by rebels.
Signup to our newsletter and follow us on Facebook and Twitter!
- New constitution promised -
Libyans are set to vote Thursday for a panel to draft a new constitution, but the polls have aroused none of the enthusiasm that attended its first free election in July 2012.
Yielding to popular pressure in the wake of street protests, the General National Congress agreed Sunday to hold early polls to elect new transitional authorities rather than wait for the constitution to be finalised.
Discussions are still under way on institutions that might replace the body -- a new congress, or a parliament and a president.
The charter is to cover key issues such as Libya's system of government, the status of ethnic minorities and the role of Islamic sharia law.
But only 1.1 million people have registered to vote, compared with more than 2.7 million in the 2012 polls for the interim parliament, from an electoral roll of 3.4 million.
US Ambassador Deborah Jones said the United States, which took part in the NATO air campaign that helped topple Kadhafi, "supports fully the legitimacy of the transitional democratic process".
"Use of force is not a legitimate means of changing democratically elected institutions," she wrote on Twitter.
In a joint statement with European allies, Washington said it would "support fully the legitimacy of the transitional democratic process as outlined in the constitutional declaration of August 2011".