Libya country profile
Libya, a mostly desert and oil-rich country with an ancient history, has more recently been known for the 42-year rule of the mercurial Col Muammar Gaddafi - and the chaos that followed his departure.
Libya was under foreign rule for centuries until it gained independence in 1951. Soon after oil was discovered and earned the country immense wealth.
Col Gaddafi seized power in 1969 and ruled for four decades until he was toppled in 2011 following an armed rebellion assisted by Western military intervention.
In recent years the country has been a key springboard for migrants heading for Europe. Concerns have also been raised over the rise of Islamist militancy there.
State of Libya
Population 6.4 million
Area 1.77 million sq km (685,524 sq miles)
Major language Arabic
Major religion Islam
Life expectancy 69 years (men), 75 years (women) (UN)
Currency Libyan dinar
The toppling of long-term leader Muammar Gaddafi in 2011 led to a power vacuum and instability, with no authority in full control.
The country has splintered and since 2014 has been divided into competing political and military factions based in Tripoli and the east.
Among the key leaders are Prime Minister Fayez Sarraj, head of the internationally recognised government in Tripoli, Khalifa Haftar; leader of the Libyan National Army, which controls much of eastern Libya; Aghela Saleh, speaker of the House of Representatives based in the eastern city of Tobruk; and Khaled Mishri, the elected head of the High State Council, a Tripoli-based chamber.
The Islamic State extremist militia took advantage of the conflict and gained control of several coastal cities, including Sirte, which it held until mid-2017.
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:
7th century BC - Phoenicians settle in Tripolitania in western Libya, which was hitherto populated by Berbers.
4th century BC - Greeks colonise Cyrenaica in the east of the country, which they call Libya.
74 BC - Romans conquer Libya.
AD 643 - Arabs 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. Omar al-Mukhtar begins 20-year insurgency against Italian rule.
1942 - Allies oust Italians from Libya, which is then divided between the French and the British.
1951 - Libya becomes independent under King Idris al-Sanusi.
1969 - Col Muammar Gaddafi, aged 27, deposes the king in a bloodless military coup.
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 eventually the ouster and killing of Gaddafi.
2016 - Following years of conflict, a new UN-backed "unity" government is installed in a naval base in Tripoli. It faces opposition from two rival governments and a host of militias.