Libya, a mostly desert and oil-rich country on the southern shores of the Mediterranean Sea with an ancient history, has more recently been renowned for the 42-year rule of the mercurial Col Muammar Gaddafi.
In 2011, the colonel's autocratic government was brought to an end by a six-month uprising and ensuing civil war. In October of that year, the main opposition group, the National Transitional Council (NTC), declared the country to be officially "liberated" and pledged to turn Libya into a pluralist, democratic state.
In August 2012, the NTC handed over power to Libya's newly elected parliament, the General National Congress.
A former Roman colony originally inhabited by Berbers and settled by Phoenicians, Libya saw invasions by Vandals, Byzantines, Arabs, Turks and more recently Italians before gaining independence in 1951.
Oil was discovered in 1959 and made the state - then a kingdom ruled by the head of the Senussi sufi order - wealthy.
Col Gaddafi came to power by overthrowing King Idris in a coup in 1969, ten years after independence, and Libya embarked on a radically new chapter in its history.
After initially seeking to emulate the Arab nationalism and socialism of Egyptian President Gamal Abdel Nasser, Col Gaddafi's rule became increasingly eccentric.
Ideas put forward in his Green Book aimed to set forth an alternative to both communism and capitalism. Col Gaddafi called the new system a jamahiriya, loosely translated as a "state of the masses".
At a glance
- Politics: Country has struggled to stabilize since ousting of long-term leader Colonel Muammar Gaddafi in 2011. Elections in 2014 produced two rival governments as Islamist and secular militias fight for control of the country
- Economy: Libya has large reserves of oil and gas
- International: The UN is struggling to bring Islamist and nationalist factions together amid fears that extreme Islamist groups are using Libya as a base
Country profiles compiled by BBC Monitoring
In theory, power was held by people's committees in system of direct democracy, without political parties, but in practice, Col Gaddafi's power was absolute, exercised through "revolutionary committees" formed of regime loyalists.
After the 1988 bombing of a PanAm plane above the Scottish town of Lockerbie, which the US blamed on Libya, the Gaddafi regime was shunned by much of the international community.
But in 2003 it underwent a dramatic rehabilitation by taking formal responsibility for the bombing, paying compensation and handing over two Libyan suspects, one of whom, Abdelbaset Ali al-Megrahi, was convicted for the attack. The UN responded by lifting sanctions.
In 2011, the world once again turned against the Libyan government over its use of violence against the popular uprising against the colonel, inspired by the anti-authoritarian protests sweeping through the Arab world.
The UN Security Council passed a resolution authorising Nato air strikes to protect civilians. After months of near-stalemate, the rebels stormed into Tripoli August 2011, and several weeks later Col Gaddafi was killed when his last holdout was overrun.
A transitional government took charge and had the challenge of imposing order, disbanding the former rebel forces, rebuilding the economy, creating functioning institutions and managing the pledged transition to democracy and the rule of law.
Elections for a General National Congress were held in July 2012, the country's first free national election in six decades. The congress appointed a prime minister, Ali Zeidan, in October, who formed an interim government tasked with preparing the ground for a new constitution and fresh parliamentary elections.
However, tensions between nationalists and Islamists have stymied attempts to produce a stable government, and in 2014 the country was riven by fighting between rival militias. Central government collapsed, and the United Nations has struggled to bring political factions together.