The toppling of long-term leader Muammar Gaddafi in 2011 led to a power vacuum and instability, with no authority in full control.
The National Transitional Council (NTC), a rebel leadership council which had fought to oust the Gaddafi government, declared Libya ''liberated'' in October 2011 and took over the running of the country.
However, it struggled to impose order on the many armed militia that had become active in the months leading up to the ouster of Gaddafi.
In August 2012 the NTC handed power to the General National Congress (GNC), an elected parliament which went on to select an interim head of state.
Voters chose a new parliament to replace the GNC in June 2014 - the Council of Representatives (CoR), which relocated to Tobruk. The former GNC, dominated by Islamists, reconvened shortly afterwards and selected its own prime minister, challenging the authority of the CoR at a time of fighting in which even the capital Tripoli changed hands.