As Libya marks 10 years since dictator Moamer Kadhafi was ousted and killed, here is a timeline of the ensuing decade of chaos in the oil-rich North African country.
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.
Kadhafi, in power for 42 years, flees the capital 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 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 Tripoli embassy, wounding two French guards.
Most foreign diplomats leave the country.
2014: Rival governments
Eastern strongman Khalifa Haftar launches an offensive in May 2014 against jihadist groups in Benghazi. He names his forces the Libyan National Army, and several senior officers from the east join him.
Legislative polls are held in June, producing a lower house of parliament --the House of Representatives-- dominated by anti-Islamists.
But Islamist-led 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, where it remains to this day.
Libya thus finds itself with two governments and two parliaments.
2015-16: Failed accord
In December 2015, after months of talks and international pressure, 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 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.
He is backed by neighboring Egypt and the United Arab Emirates, later also forming links with Russia.
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.
Foreign involvement
Russia reportedly sends mercenaries in November 2019 to help Haftar's forces.
The UN in December accuses several countries of breaching a 2011 arms embargo by supplying both camps.
The following month Turkey sends troops to help the Tripoli government.
In June, Tripoli's forces say they have overrun Haftar's last western stronghold.
2020: Talks and ceasefire
The rival governments sign a "permanent" ceasefire agreement in October after UN-hosted talks in Geneva. The following month in Tunis they agree to hold elections in December 2021.
2021: Tensions mount again
Libyan delegates to the UN process approve a unity government headed by interim prime minister Abdulhamid Dbeibah in March, charging it with leading the country to elections.
But the UN warns in July of a "stalemate" over political and security plans and Dbeibah's proposed budget.
In September, lower house speaker Aguila Saleh ratifies a law governing the presidential ballot that critics say bypassed due process to favor his ally Haftar.
Weeks later the eastern-based parliament passes a no-confidence vote in the unity government.
Election wrangling
Haftar announces on September 22 that he is stepping back from the military, paving the way to his candidacy in the December ballot.
The parliament in Tobruk rubber stamps the presidential poll for December 24 but postpones the legislative elections to January.
But the postponement is rejected by the upper chamber in Tripoli.
Agence France-Presse