Libya, where rival authorities in Tripoli and the east are vying for power, fell into chaos after the ouster of strongman Moammar Gaddafi in October 2011.
Here is an overview.
A NATO-backed uprising that begins in February 2011 snowballs into bloody armed conflict. Gaddafi, on the run since the rebels captured the capital 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 of the country as it falls into chaos.
Two governments set up
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.
In August, after weeks of deadly clashes, Islamist-led militias storm Tripoli and reinstall the GNC. They set up another government.
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.
ISIS profits from chaos
The Islamic State group claims its first attack in Libya in December 2014.
The following June it seizes Sirte to the east of Tripoli, but is driven out of the coastal town in December 2016.
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).
The two rival parliaments have reservations but the UN Security Council endorses the accord.
The unity government in March 2016 takes up office in Tripoli, headed by prime minister Fayez al-Sarraj.
But the rival administration in the east remains in place and opposed, 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 change on the ground.
In December 2017, the UN says the two-year-old Skhirat accord is the only viable framework for a solution. But Haftar says 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.
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 after two car bombings outside a mosque frequented by jihadist opponents in Benghazi.
On May 2, two ISIS suicide attackers kill 14 people at Libya‘s electoral commission in Tripoli.
Haftar reasserts strongman status
On May 7, Haftar, after spending at least two weeks in hospital in Paris for undisclosed treatment, announces a military offensive to take from jihadists the city of Derna, the only part of the country‘s east outside the control of his forces.
* Sign up to News24‘s top Africa news in your inbox:
<strong and .