Rival militia factions that have been fighting in Libya’s capital Tripoli for the past week have agreed a ceasefire, the United Nations says.
At least 47 people have been killed and 1,800 families internally displaced by the violence, officials say.
Last week, a ceasefire deal announced by officials from western cities only held for a few hours.
A UN-backed government is nominally in power in the capital, but militias occupy much of the rest of the country.
“Under the auspices of [UN envoy Ghassan Salame], a ceasefire agreement was reached and signed today to end all hostilities, protect civilians, safeguard public and private property,” the Unsmil mission said.
The ceasefire also provides for the reopening of the capital’s only functioning airport, Mitiga, which has been closed since 31 August due to the clashes.
The agreement “does not aim to fix all the Libyan capital’s security problems; it seeks to agree on a broader framework on the way to start addressing these issues,” the mission said.
The talks included military officers, leaders of various armed groups in and around the capital and the UN-backed Government of National Accord (GNA).
This is the third attempt to end the outbreak of violence in Tripoli as the first two ceasefires were broken almost immediately.
This time there’s a signed agreement mediated by the United Nations.
If the ceasefire holds, it will be a short-term fix because the underlying issues that drive these bouts of deadly militia violence in Tripoli are rooted in governance, and institutional issues that could take years to overcome.
For the international community, containing this deadly conflict was a priority because it threatened the standing of the only government they can deal with and what has been a painstakingly slow return of foreign missions and diplomats to Tripoli since 2014.
The violence has forced thousands of people to flee to nearby towns or seek shelter in other parts of the capital, while many more have remained trapped inside their homes.
The violence broke out last week when militias from a city to the south of Tripoli attacked its southern areas, leading to fighting with local militias that support the GNA.
Hundreds of migrants trapped by the fighting have been moved to other detention centres.
Libya has faced continuing chaos since Nato-backed forces overthrew long-serving ruler Col Muammar Gaddafi in October 2011