Libya, where a new ceasefire was announced on Wednesday to end a month of deadly fighting near the capital, fell into chaos with the ouster and killing of strongman Muammar Gaddafi in October 2011.
Two rival authorities and a multitude of militias are vying for control of the oil-rich country.
The capital Tripoli is the seat of the internationally backed Government of National Accord (GNA), led by Fayez al-Sarraj.
A parallel government operates out of the country's east, backed by the self-styled Libyan National Army of military strongman Khalifa Haftar.
Here is a timeline of the Mediterranean country's descent into chaos:
Triggered by uprisings in Tunisia and Egypt, demonstrations erupt in Libya in February 2011.
A coalition led by Washington, Paris and London lends its backing.
Gaddafi, who has ruled for 42 years, flees the capital. He is killed on October 20, 2011 during a battle for his hometown Sirte, east of Tripoli.
Three days later, the rebel National Transitional Council (NTC) declares Libya's "total liberation".
In August 2012 it hands power to the transitional General National Congress.
US ambassador Chris Stevens and three American staff are killed in a September 11, 2012 attack on their consulate in Libya's second city Benghazi.
An Al-Qaeda-linked jihadist group is blamed.
A car bomb in April 2013 targets France's embassy in Tripoli, wounding two French guards.
Most foreign delegations withdraw from the country.
Dissident general Haftar, backed by Egypt and the United Arab Emirates, launches an offensive in May 2014 against jihadist groups in Benghazi.
Several military officers from the east join his self-styled Libyan National Army.
* Sign up to News24's top Africa news in your inbox: SUBSCRIBE TO THE HELLO AFRICA NEWSLETTER
In June, following legislative elections, the General National Congress is replaced by a parliament dominated by anti-Islamists.
In August, after weeks of deadly clashes, Islamist-led militias grouped under the "Fajr Libya" (Libya Dawn) banner storm Tripoli and set up a "national salvation" government.
The parliament and government of Abdullah al-Thani, elected in June, take refuge in eastern Libya.
The country finds itself with two governments and two parliaments.
On December 17, 2015, after months of negotiations, accords signed under UN supervision in Morocco designate a UN-backed Government of National Accord (GNA).
In March 2016 GNA prime minister Sarraj arrives in Tripoli to set up the new government.
In January 2018 militias attack at Tripoli's only working international airport and at least 20 people are killed.
The same month, two car bombings kill nearly 40 people in Benghazi. In May, Islamic State suicide attackers kill 14 people at Libya's electoral commission.
In a bid to restore stability, senior Libyan leaders including Sarraj and Haftar commit at a Paris peace conference in May to hold elections on December 10.
But the unrest continues. In June, a militia attacks two northeastern oil sites under Haftar's control, through which oil is piped abroad.
After days of fighting, Haftar's forces announce they are back in "full control" and have also seized the city of Derna from radical Islamists.
On August 27, heavy clashes break out between rival militias on the outskirts of Tripoli, killing dozens over the following days.
The UN brokers a ceasefire on September 4 but fighting resumes within days. The capital's airport is attacked with rocket fire on September 12 and rival militias clash nearby on September 18.
By Wednesday's announcement of a renewed commitment to the September 4 ceasefire deal, the fighting around Tripoli has left at least 117 dead and more than 400 injured, according to the GNA.