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 Colonel Muammar Gaddafi - and the chaos that has 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.
Colonel 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, and a source of international tension as rival governments in the west and east seek to establish nationwide control.
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.
The key leaders are Prime Minister Abdul Hamid Dbeibeh, head of the internationally-recognised government in Tripoli, and Khalifa Haftar, leader of the Libyan National Army, which controls much of eastern and southern Libya.
Islamic State group briefly took advantage of the conflict to seize control of several coastal cities including Sirte. It retains a presence in the desert interior.
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 - 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 government is installed at Tripoli. It faces opposition from rival governments and a host of militias.