Face-to-face talks between rival sides to resume next month in Tunisia as oil production in key oilfield starts again.
Libya’s rival administrations signed a ceasefire more than 18 months after renegade commander Khalifa Haftar launched an offensive to seize the capital, Tripoli, from the United Nations-recognised government.
Here is a timeline of events:
Haftar orders advance
On April 4, 2019, Haftar orders his troops to advance on Tripoli, the seat since 2016 of the UN-recognised Government of National Accord (GNA), which he claims is backed by “terrorist” groups.
Haftar supports a rival administration based in the eastern city of Tobruk, and his forces already control the country’s main oil fields in the south.
The increase in tensions comes several days before a national conference, long under preparation at the UN, to establish a political way forward for the chaotic country.
The next day, the UN Security Council calls on Haftar’s forces to halt their advance.
On April 7, the GNA announces it has launched a counteroffensive.
On April 19, the White House says United States President Donald Trump recognised Haftar’s “significant role in fighting terrorism and securing Libya’s oil resources”.
In a blow to the ambitious commander’s campaign, GNA forces move on June 26 to retake the town of Gharyan, the main supply base for Haftar’s forces southwest of Tripoli.
On November 27, Turkey and the GNA sign a deal covering military cooperation and maritime boundaries, allowing Ankara to claim rights over areas coveted by other countries, including Greece.
A UN report on December 10 accuses several countries of breaching a 2011 arms embargo by supplying both camps.
On January 5, 2020, Turkey announces the deployment of Turkish troops to Libya.
Turkey and Russia broker a ceasefire that comes into effect on January 12.
The next day in Moscow, GNA chief Fayez al-Sarraj signs the deal – but Haftar leaves a day later without doing so.
UN experts confirm in early May that mercenaries from the Wagner Group, a Russian paramilitary organisation said to be close to Russian President Vladimir Putin, are fighting in Libya in support of Haftar, alongside Syrian fighters from Damascus.
Pro-Turkish Syrian fighters have also been sent to help the GNA, Ankara confirms in February.
Since then, hundreds of Russian mercenaries have been evacuated from the Tripoli front.
Government takes back control
On May 18, the unity government says its forces seized the strategic al-Watiya airbase, 140km (87 miles) southwest of Tripoli, the latest setback for Haftar.
On June 3 government forces retake the disused Tripoli International Airport after heavy fighting. The next day the GNA says it is back in full control of the capital and its suburbs.
On June 5, it says it has overrun Haftar’s last western stronghold.
A day later government forces launch an offensive for the central town of Sirte, a strategic crossroads between east and west and a gateway to the oil fields.
Egypt threatens intervention
On June 11, the UN voices “horror” after reports that mass graves had been discovered in an area recently seized by the GNA.
Later that month, Egyptian President Abdel Fattah el-Sisi threatens “direct” intervention if GNA forces advance on Sirte, which he describes as a “red line”.
On August 21, the rival administrations announce in separate statements that they will cease all hostilities and organise nationwide elections soon.
On October 21, they agree to open internal land and air routes and to increase oil production. Two days later they sign a “permanent” ceasefire agreement following five days of UN-hosted talks in Geneva.
Turkey’s President Recep Tayyip Erdogan questions the viability of the ceasefire, saying it was not made “at the highest level”.