Libya's parliament on Wednesday approved a unity government to lead the war-ravaged North African nation to December elections, hailed as a "historic" step towards ending a decade of chaos.
Oil-rich Libya descended into conflict after dictator Moamer Kadhafi was toppled and killed in a NATO-backed uprising in 2011, resulting in multiple forces vying for power.
"This will be the government of all Libyans," interim prime minister Abdul Hamid Dbeibah said, in a brief but emotional speech after the vote. "Libya is one and united," he added.
After two days of intense debate under heavy security in the central city of Sirte, parliament approved Dbeibah's cabinet, with 121 of the 132 lawmakers present voting in support, the parliament spokesman said.
"The time has come to turn the page on wars and divisions," Dbeibah said, who thanked lawmakers "for putting the nation's interest above all else."
The United Nations mission praised leaders for the "patriotic efforts that led to this landmark moment in the history of Libya".
But the challenges ahead are daunting.
The interim government must now tackle the many grievances of Libyans, from a dire economic crisis and soaring unemployment to crippling inflation and wretched public services.
"Libya has now a genuine opportunity to move forward towards unity, stability, prosperity, reconciliation and to restore fully its sovereignty," the UN said.
- 'Important and encouraging' -
Libya has been split between the UN-recognised Government of National Accord, based in the capital Tripoli and backed by Turkey, and an administration in the east supported by military strongman Khalifa Haftar, with the backing of the United Arab Emirates, Egypt and Russia.
But a UN-supervised process aims to unite the country after a ceasefire last October, and the new government has to bring the rival administrations together.
Fayez al-Sarraj, outgoing head of the GNA, said he was "fully ready to hand over" power, while influential parliament speaker Aguila Saleh called it "a historic day".
The government's endorsement was welcomed by the United States and the European Union, which also both called the vote "historic", as well as neighbouring Egypt and Tunisia, plus Britain, France and Italy.
The US ambassador to Libya Richard Norland said it "set the stage for elections" and offered his congratulations.
"The new unity government can count on the full support of the international community," EU ambassador to Libya Jose Sabadell said.
"Reconciliation, improving basic services and preparing elections will be central challenges."
Former colonial ruler Italy said it was an "important and encouraging result" for Libya's "normalisation process".
Lawmakers met in Sirte, a Mediterranean port city which lies halfway between Tripoli, where the western government is based, and the east, where parliament has sat in recent years.
Libyan media said the government would be sworn in on Monday in Benghazi in the east, Libya's second city and cradle of the 2011 revolution.
- Foreign forces remain -
Dbeibah, 61, a billionaire businessman from the western city of Misrata, was selected in February alongside an interim three-member presidency council to head the new unity administration.
The process has been marred by allegations of vote-buying, but Dbeibah defended the composition of his government.
"My first objective was to choose people with whom I would be able to work, no matter where they come from," Dbeibah said, during the debate in parliament.
Dbeibah's government includes two deputy prime ministers, 26 ministers and six ministers of state, with the key foreign affairs and justice portfolios handed to women, a first in Libya.
Another key task facing the new administration is ensuring the departure of an estimated 20,000 mercenaries and foreign fighters. Dbeibah told lawmakers they were "a stab in our back".
The premier said Tuesday he would contact the UN and the countries where the mercenaries come from to demand they withdraw.
A January 23 deadline for their withdrawal passed without any sign of them pulling them out.
Some have literally dug in. In January, satellite images broadcast by CNN showed a trench running tens of kilometres (miles) dug by "Russian mercenaries" near the front-line city of Sirte.
An advance team of a UN observer mission arrived in Libya last week tasked with monitoring the ceasefire and verifying the departure of the thousands of foreign fighters.
Go to video
Ten years after Benghazi anti-American attack, Libya still in chaos
Egypt PM exits Arab League session chaired by one of Libya's faction
New UN special envoy to Libya faces considerable task
Libyans count on massive losses after deadly clashes in Tripoli
Go to video
Syrian refugee alleges killings, rapes in Libya
Situation in Libya remains "volatile" according to the UN