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: The election of a General National Congress in July 2012 was Libya's first free national election in six decades.
- Economy: Libya has large reserves of oil and gas
- International: The West provided military backing to the uprising that toppled Col Gaddafi; Russia and China condemned the intervention
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 within the GNC between nationalists and Islamists have stymied attempts to produce a clear timetable for fresh elections.
One of the biggest challenges facing the new authorities is the plethora of armed groups - some originating in the anti-Gaddafi rebellion, others newly arisen - who have defied attempts to disarm them, and have caused concerns about the prospects for stabilisation.
In May 2013, some of these gunmen successfully pressured parliament into passing a law banning Gaddafi-era officials from public office by besieging government buildings in Tripoli.
And in March 2014, an oil tanker's defiance of a Libyan navy blockade of a rebel-held port led to the fall of Prime Minister Ali Zeidan.