Libya's two warring factions signed a "permanent" ceasefire agreement on Friday after five days of talks at the United Nations, which hailed the deal as a historic moment following years of turmoil and bloodshed.
"Today is a good day for the Libyan people," said Stephanie Williams, the UN's acting envoy to the troubled North African country, where a UN-recognised government in Tripoli has been battling a rival administration based in the east and dominated by military commander Khalifa Haftar.
"The two Libyan delegations... signed a complete, country-wide and permanent ceasefire agreement with immediate effect," she said.
Williams said the parties agreed that "all military units and armed groups on the front lines shall return to their camps", while "all mercenaries and foreign fighters" must leave within three months.
The United States also welcomed the agreement and urged all foreign fighters to leave.
"This agreement is a major step forward toward realising the shared interests of all Libyans in de-escalation, stability and the departure of foreign fighters," the US embassy in Libya said in a statement.
"We urge internal and external actors now to support good-faith implementation of the agreement."
Analysts have warned that further measures are needed to prevent spoilers undermining the deal in a country wracked by conflict for nearly a decade, since the overthrow and killing of dictator Moamer Kadhafi in a NATO-backed uprising in 2011.
Since then, it has been dominated by armed groups, riven by local conflicts and divided between the two bitterly-opposed adminstrations.
- 'Ray of hope' -
Tripoli is held by the UN-recognised Government of National Accord, while a parliament based in the eastern city of Tobruk is backed by Haftar's forces.
But hopes for a solution rose after the two sides separately announced in August that they would cease hostilities.
Ahmed Abu Shahma, who headed the GNA delegation in Geneva, urged Libyans to come together and rebuild a united, stable country.
"We have had enough suffering, enough divisions, enough bloodshed," he said at the signing ceremony.
His opposite number Emrajaa Amhimmid Mohamad al-Amami said: "We have succeeded in achieving that which all Libyans are looking forward to: the feeling of belonging to a nation and to spread peace and security."
This week's talks in Geneva, led by the UN's Libya mission UNSMIL, took place in the format of a 5+5 Joint Military Commission (JMC), attended by five delegates from each side.
The UN hopes the agreement will give fresh impetus to political and economic talks taking place in a parallel process.
The JMC will reconvene within weeks to work on unifying their armed forces and the departure of foreign fighters.
The political track delegates are convening virtually on Monday in preparation for in-person talks in Tunis in early November, said Williams.
- Erdogan questions viability -
UN Secretary-General Antonio Guterres said the agreement was "a fundamental step toward peace and stability in Libya".
GNA chief Fayez al-Sarraj also welcomed the deal, saying it could help pave the way for political and economic accords.
But in a post on his administration's Facebook page, he urged accountability for "those who committed crimes against Libyans or left landmines and mass graves as they withdrew."
Haftar, supported by Russia, the UAE and Egypt, launched an offensive on Tripoli in April 2019 but was pushed back early this year as pro-GNA forces received crucial support from Turkey.
Fighting has since stalled around the central coastal city of Sirte, Kadhafi's home town.
"A permanent ceasefire is key for the resumption of a political dialogue," said EU foreign policy spokesman Peter Sano.
France welcomed the ceasefire as "an important step towards a sovereign, stable and united Libya", Foreign Ministry spokeswoman Agnes von der Muhll said.
Germany, which hosted a key Libya summit in January, called the deal a "ray of hope", while British Foreign Secretary Dominic Raab dubbed it "an important step".
Qatar and Saudi Arabia also welcomed the deal, with both hoping it will pave the way to consolidate a comprehensive political settlement and revamp Libya's battered economy.
But President Recep Tayyip Erdogan of Turkey, which backs the Tripoli government with military support, questioned the viability of the ceasefire.
"Today's ceasefire agreement was actually not made at the highest level, it was at a lower level. Time will tell whether it will last," Erdogan said. "So it seems to me that it lacks credibility."
Mohamed Eljarh, co-founder of Libya Outlook for Research and Consulting, also cautiously welcomed the deal.
"There are internal/external players who will see a ceasefire agreement and subsequent political deal as a threat to their influence," he tweeted.
Analyst Mohamed Dorda also warned the deal had shortcomings.
"It lacks mechanisms for implementation, which need to be filled in as soon as possible to prevent spoilers from sabotaging it," said Dorda, from Libya Desk, a risk consultancy.
Williams urged outside powers who are "interfering directly" and "blatantly violating" a 2011 UN arms embargo to respect the will of Libyans and step back.
Libya's state-run National Oil Corporation meanwhile announced the resumption of crude exports from Friday from the two key terminals of Ras Lanuf and Al-Sidra, which had been controlled by Haftar.