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 told journalists afterwards.
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.
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.
Tripoli is held by the internationally 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 which 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, 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 for 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, adding, "It's very important, as well, to see this accord put into effect."
Germany, which hosted a key Libya summit in January, called the deal a "ray of hope".
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, a Libya expert and co-founder of Libya Outlook for Research and Consulting, also cautiously welcomed the deal.
"Particularly important are the trust-building measures including reopening of roads, airports, oil terminals and exchange of prisoners" among other details, he tweeted.
However, "there are internal/external players who will see a ceasefire agreement and subsequent political deal as a threat to their influence".
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, Co-Founder and Consulting Director at 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.
Williams said she hoped displaced Libyans would feel able to return to their homes.
Williams said Libyans now wanted elections, which were the "single most important means through which they can reassert their sovereignty".