Libya's warring sides signed an agreement for a permanent ceasefire on Friday in Geneva, representing a step forward in diplomatic efforts to resolve the conflict though there is scepticism the truce will last.
This is what they agreed:
Who Has Agreed To The Ceasfire?
Libya is split between the UN-recognised Government of National Accord (GNA) in Tripoli in the west and Khalifa Haftar's Libyan National Army (LNA) in the east.
The latest United Nations meetings in Geneva have been between five military officers from each side representing the GNA and LNA after they held preliminary talks in Egypt this month.
UN acting Libya envoy Stephanie Williams said they had agreed to a complete, countrywide, permanent ceasefire with immediate effect.
The truce does not include UN-designated terrorist groups such as Islamic State group, which is present in parts of the south.
What Must Both Sides Do?
All military units and armed groups must pull back from frontlines and return to their camps. All foreign fighters and mercenaries must leave Libya within three months - by Jan. 23.
Williams said there were mercenaries from up to nine countries fighting in Libya. Both the GNA, backed by Turkey, and the LNA, backed by Russia, the United Arab Emirates and Egypt, have fielded foreign fighters.
Any military agreements either side has struck with their foreign backers must also be suspended until a new unified government is in place, the deal said, with all foreign military trainers to depart.
How Will It Be Implemented?
The two sides will set up a joint military committee to form an operations room commanding a limited force of regular personnel.
It will identify and categorise all Libya's many armed groups with U.N. help and work out whether, and how, to integrate their fighters into state institutions.
A new joint police operations room would secure areas from which the two sides' military forces have withdrawn.
Both sides will work with the UN Libya mission to set up a way to monitor the truce and they have asked the UN Security Council for a resolution to ensure compliance.
What happens Next?
The two sides must continue with agreed measures to build confidence including the opening of land and air routes between areas they control, curbing hate speech, exchanging detainees and restructuring a guards force for oil facilities.
The two military delegations that struck the deal will reconvene soon with subcommittees to work out details on tough questions including the withdrawal from frontlines, the departure of mercenaries and the unification of armed forces.
A round of political talks is meanwhile expected early next month in Tunis.