With Libya's first direct presidential election due to be held on December 24, here is a timeline of the chaos that has gripped the country since the late Libyan leader
Moamer Kadhafi was ousted in 2011.
- 2011: Kadhafi killed -Encouraged by Arab Spring uprisings in Tunisia and Egypt, protests erupt in Libya in February 2011.
The United States, France and Britain give military backing to what becomes an armed revolt in the oil-rich North African country.
Kadhafi, in power for 42 years, flees the capital Tripoli but rebels capture and kill him on October 20.
In August 2012, the rebels hand power to a transitional authority, the General National Congress (GNC).
- 2012: Foreign missions targeted -US ambassador Chris Stevens and three American staff are killed in a September 11, 2012 attack on the consulate in Libya's second city, Benghazi. An Al-Qaeda-linked jihadist group is blamed.
A car bomb in April 2013 targets France's Tripoli embassy, wounding two French guards.
Most foreign diplomats leave the country.
- 2014-2016: Rival administrations -Legislative polls are held in June, producing a lower house of parliament -- the House of Representatives -- dominated by anti-Islamists.
But militias contest the results and storm Tripoli in August, restoring the GNC to power.
The internationally recognized House of Representatives takes refuge in the eastern city of Tobruk.
A rival body equivalent to Libya's senate and formally known as the High Council of State is established in Tripoli in the west.
Libya thus finds itself with two administrations and two legislatures.
In December 2015, after months of talks, the rival parliaments sign an accord in Morocco establishing a Government of National Accord.
In March 2016, its chief Fayez al-Sarraj arrives in Tripoli to install the new administration, but eastern-based strongman Khalifa Haftar refuses to recognize it.
- 2019: Haftar's offensives -Haftar announces the "total liberation" of Benghazi from jihadists in July 2017, after more than three years of fighting.
In January 2019, Haftar launches an offensive into oil-rich southern Libya, seizing the region's capital, Sebha, and one of the country's main oil fields.
In April, he orders his troops to advance on Tripoli.
In June 2020, Tripoli's forces, backed by Turkey, say they have overrun Haftar's last western stronghold, driving out Haftar's fighters who are backed by Russia, Egypt and the United Arab Emirates.
- 2020-2021: Talks and tensions -The rival administrations sign a "permanent" ceasefire agreement in October after UN-hosted talks in Geneva. The following month in Tunis they agree to hold parliamentary and presidential elections in December 2021.
Libyan delegates to the UN process approve a unity government headed by interim prime minister Abdulhamid Dbeibah in March, 2021, charging it with leading the country to the elections.
- Election wrangling -In September, the eastern-based parliament adopts a law governing the legislative elections, also ratifying a text governing the presidential poll that critics say favors Haftar.
In early October, the parliament in Tobruk rubber stamps the presidential poll for December 24 but postpones the legislative elections to January.
World powers meeting in Paris in mid-November urge Libyan leaders to stick to the election timetable, and say foreign mercenaries should leave.
Kadhafi's son Seif al-Islam throws his hat into the ring as does Dbeibah, and Haftar confirms he too is standing. Divisions mar the run-up to the poll over who should be allowed to run.
At the end of November, Interior Minister Khaled Mazen says Libya may have to delay the presidential polls if worsening "violations" threatening the electoral process continue, as UN Secretary-General Antonio Guterres says he does not want the vote to become "part of the problem".
Despite Libya's election commission delaying a final list of candidates on Saturday, interim head of government Ramadan Abu Jnah insisted Sunday the elections will go ahead and "nobody should deprive Libyans of this historic" choice.