Libya, a mostly desert oil-rich country, has become a key springboard for migrants heading for Europe, and a source of international tension as rival governments in the west and east seek to establish nationwide control.
Libya was under foreign control for centuries until it gained independence in 1951. Soon after, oil was discovered and earned the country immense wealth.
Colonel Gaddafi seized power in 1969 and ruled autocratically for four decades until he was toppled and killed in 2011 in a rebellion assisted by Western military intervention.
In 2014, renewed fighting broke out, with Libya split between two administrations - one based in the east, and one in the west in the capital Tripoli. The two sides signed a ceasefire in 2020 but political rivalries continue.
In 2021, a Government of National Unity was formed in Tripoli with Abdul Hamid Dbeibeh as the internationally-recognised prime minister, but the following year the eastern-based parliament formed a rival - and rather similarly named - Government of National Stability.
The continued polarisation of Libya between these two governments claiming to be the country's legitimate rulers has complicated international peace efforts and divided their external backers.
The rival governments' claims to legitimacy are rooted in their interpretations of UN-sponsored agreements on Libya's political transition, and the split was compounded by the country's failure to hold elections in 2021.
STATE OF LIBYA: FACTS
Area: 1,759,541 sq km
Population: 7 million
Life expectancy: 70 years (men) 75 years (women)
Prime Minister: Abdul Hamid Dbeibeh (Government of National Unity)
A Government of National Unity (GNU) was formed in March 2021, based in Tripoli, with Abdul Hamid Dbeibeh as the internationally-recognised prime minister.
This was Libya's sole government for the first time in nearly seven years, successfully replacing the parallel administrations that had existed since 2014.
But that this was short lived, and in March 2022 the country was divided again when the eastern-based parliament formed the rival Government of National Stability (GNS) under the leadership of prime minister Fathi Bashagha.
The GNS has struggled to assert its legitimacy internationally.
Libya's media environment is highly-polarised and virtually unregulated, reflecting the country's political instability.
Satellite TV is a key news source and many outlets are based outside Libya.
Journalism is fraught with danger; reporters face threats and attacks.
Some key dates in Libya's history:
643AD - Arabs under Amr Ibn al-As conquer Libya and spread Islam.
16th Century - Libya becomes part of the Ottoman Empire, which joins the three provinces of Tripolitania, Cyrenaica and Fezzan into one regency in Tripoli.
1911-12 - Italy seizes Libya from the Ottomans.
1920s - Libyan resistance to Italian rule grows.
1931 - Italy breaks resistance through combination of major armed operations and concentration camps for rebel population.
1934 - Italy steps up Italian migration as part of an eventual plan for the incorporation of Libya into a Greater Italy.
1942 - Allies oust Italians and their German allies from Libya after a two-year campaign.
1951 - Libya becomes independent under King Idris.
1956 - Development of Libya's oil reserves starts.
1969 - Muammar Gaddafi, deposes King Idris.
1971 - National referendum approves proposed Federation of Arab Republics (FAR) comprising Libya, Egypt and Syria. However, the FAR never takes off.
1977 - Col Gaddafi declares a "people's revolution", changing the country's official name from the Libyan Arab Republic to the Great Socialist People's Libyan Arab Jamahiriya and setting up "revolutionary committees".
1992 - UN imposes sanctions on Libya over the bombing of a PanAm airliner over the Scottish town of Lockerbie in December 1988.
2011 - Violent protests break out in Benghazi and spread to other cities. This leads to civil war, foreign intervention and the overthrow and death of Colonel Gaddafi.
2016 - Following years of conflict, a new UN-backed government is installed at Tripoli. It faces opposition from rival governments and a host of militias.
2021 - Abdul Hamid Dbeibeh takes over as prime minister of the UN-backed Government of National Accord in Tripoli.
2023 - Rival sides agree to set up a committee to oversee the sharing of oil revenues.
A devastating storms hits eastern Libya. Torrential rains cause widespread flooding with more than 5,000 people killed and thousands more missing.