Libya fell into chaos after the ouster of strongman Moamer Gaddafi in October 2011, with competing authorities in Tripoli and the east vying for power.
As rival leaders committed to elections at a peace conference in Paris Tuesday, here is a recap.
– Gaddafi killed –
Amid the Arab Spring uprisings, a popular revolt erupts in Libya in February 2011, developing into a NATO-backed conflict.
Long-time dictator Kadhafi, on the run since the capital is captured in August, is killed in October while trying to flee his hometown Sirte as rebels close in.
Days later the rebel National Transitional Council declares Libya’s “total liberation”.
In August 2012 the Council hands over power to a transitional General National Congress (GNC).
– Rise of radical groups –
US ambassador Chris Stevens and three other American staff are killed in an attack on their consulate in Libya’s second city Benghazi on September 11, 2012. An Al-Qaeda-linked group is accused.
A car bomb attack in April 2013 targets France’s embassy in Tripoli, wounding two French guards.
Foreign delegations pull out as the country falls into chaos.
– Two governments –
Military strongman Khalifa Haftar, backed by Egypt and the United Arab Emirates, launches an offensive in May 2014 against Islamist groups in Benghazi.
Several military officers join his paramilitary Libyan National Army.
In June, following legislative elections, the GNC is replaced by a parliament dominated by anti-Islamists. But in August Islamist-led militias storm Tripoli and reinstall the GNC.
The country finds itself with two governments and two parliaments.
The June-elected government and parliament, the only ones recognised internationally, take refuge in eastern Libya.
The Islamic State group profits from the chaos, claiming its first attack in Libya in December 2014. The following June it seizes Sirte to the east of Tripoli, but is driven out in December 2016.
– Rival authorities –
In December 2015 months of negotiations result in accords signed under UN supervision in Skhirat, Morocco, that designate a UN-backed Government of National Accord (GNA) for the fractured country.
The unity government takes up office in Tripoli in March 2016 headed by prime minister Fayez al-Sarraj.
But the rival administration in the east remains in place, backed by Haftar and the parliament elected in 2014.
In July 2017 Sarraj and Haftar, meeting in Paris, commit to a ceasefire and elections but there is no development on the ground.
In December 2017 the UN says the two-year-old Skhirat accord is the only viable framework for a solution. Haftar claims it has expired and the GNA’s mandate has run out.
He backs the holding of elections in 2018 while implicitly threatening to take power if the political process fails.
– Fresh violence –
In January 2018 fighting at Tripoli’s only working international airport kills at least 20 people after militiamen attack in a bid to free jihadist comrades held at a jail there.
The same month nearly 40 people are killed in two car bombings outside a mosque frequented by jihadist opponents in Benghazi.
On May 2 two IS suicide attackers kill 14 people at Libya’s electoral commission in Tripoli.
Haftar announces on May 5 an offensive to take the Mediterranean city of Derna from jihadists. It is the only part of the country’s east outside the control of his Libyan National Army.
– Polls pledge in Paris –
Haftar, al-Sarraj and other Libyan leaders meet in Paris on May 29, committing after about four hours of talks to hold parliamentary and presidential elections in December, and to accept the results.
The four men represent most but not all of Libya’s factions.