After the fall of Libya's President Muammar Gaddafi in 2011, several actors - political and military - have been competing with one another for power and hegemony in Libya.
In March 2011, The United Nations Security Council (UNSC) passed a resolution authorising a no-fly zone over the country. It also asked for "all necessary measures" - code for military action - to protect civilians. Primarily NATO enforced the resolution, with logistical support from several Arab countries.
READ MORE: In Libya, Britain's ignorance triumphed over caution
A few months later, Gaddafi went into hiding after his fortress in Tripoli was captured. On October 20, 2011, Gaddafi was presumed dead, allegedly killed after fighters took over Sirte, his hometown.
In August 2012, the transitional government handed over power to the General National Congress (GNC). Two years later, Libya held parliamentary elections. Violence resulted in low voter turnout. Gunmen stormed the parliament in Tripoli, and Libya was left without a central government.
Meanwhile, in 2014, General Khalifa Haftar began his offensive, titled "Operation Dignity" against what he called "Islamist militias". Haftar's armed group the Libyan National Army (LNA), managed to capture several key cities, including Benghazi.
READ MORE: The Battle for Libya’s Oil
Soon after, fighting broke out at Tripoli's international airport between the newly formed Libya Dawn coalition, led by fighters from Misrata and their allies on one side, and Haftar and his coalition - including the Zintan forces, which had controlled the valuable site since 2011.
The fighting wrecked the airport and the Libya Dawn coalition took over the capital. Since the conflict in 2014, two rival governments emerged - one in Tripoli and the other in Tobruk.
The Tobruk-based government led by Prime Minister Abdullah al-Thinni's was backed by Haftar. Although in November 2014, the Libyan Supreme Court ruled this parliament to be illegal and unconstitutional, it is still recognised by the US, the European Union, Egypt and the UAE.
In December 2015, Libya's two rival factions have signed a UN-backed deal to form a unity government in Morocco. Many members of Libya's competing parliaments did not back the resolution.
READ MORE: Donald Trump's Gaddafi problem
A month later, a new UN-backed national government was announced, even though Libya's two parliaments have not signed on. Headed by Fayez al-Sarraj, the government arrived in Tripoli mid-2016.
Taking advantage of the chaos in Libya, ISIL fighters advanced into Sirte in 2015. A year later, forces aligned to Libya's UN-backed national unity government retook the city from ISIL.
Last September, Haftar took over the country's "oil crescent". He controls ports, such as Ras Lanuf, Es Sidr and Brega. Earlier this month, Haftar forces briefly lost control over the ports to the Benghazi Defense Brigade, an armed group that was formed in an attempt to free the city from Haftar and his allies. A week later, Haftar regained control of the oil fields. Haftar forces have been accused of Benghazi atrocities during the offensive.