More than eight years after the start of Libya's uprising that ended Moammar Qaddafi's 42-year rule, the country is in turmoil. An armed force led by Field Marshal Khalifa Haftar, with its base in the east, is attacking the Government of National Accord in the capital Tripoli. The GNA is resisting with not only the Libyan army but also militias from the west of the country.

Local protests, spurred by long-standing internal issues and the uprisings of the Arab Spring, began in Benghazi, Libya's second city, in February 2011. Anti-Qaddafi groups soon formed the National Transitional Council. With support from NATO, they withstood Qaddafi's assault on eastern Libya and then advanced on Tripoli, forcing Qaddafi into hiding. In October, the former leader was found hiding in a drain pipe outside the city of Sirte and was soon executed.

The revolutionary brigades of the uprising were not united and differed in size, local influence, and weaponry. As they fought for power, Libya’s infrastructure, including its oil industry, fell into disarray.

The NTC attempted to restore order but, with most of the brigades refusing to lay down their weapons, it called for armed groups to register under the Ministry of Defence. The step gave a degree of legitimacy to the smaller factions, allowing them greater control in the areas in which they operated.

Following the assault on the US Consulate in Benghazi by Al-Qa'eda-linked fighters in September 2012, the government cracked down on non-sanctioned militia groups and declared them illegal. The national army raided several militia bases, but did not vanquish rival groups. Instead, the lack of a legitimate government and the battle for control of oilfields and distribution led to the second Libyan Civil War in 2014.

Initially, the political conflict was between the House of Representatives Government, based in the eastern city of Tobruk, and the Islamist General National Congress in Tripoli. The GNC had governed Libya following post-Qaddafi elections in 2012. However, the HoR won the next ballot in May 2014, albeit with extremely low voter turnout.

Claiming the elections as invalid, the GNC refused to relinquish its power. Islamist militias loyal to the GNC held Tripoli. The House of Representatives relocated to Tobruk and aligned with General Khalifa Haftar, leader of the "Libyan National Army", who controlled much of the east of the country.

By March 2015, Haftar was commander of the Tobruk government. He led a campaign, "Operation Dignity", which claimed to oust Islamist militias from Libya, and the Libyan National Army clashed with other factions. Unconfirmed reports said Haftar’s troops attacked a GNC-friendly militia which had ousted Islamic State (ISIS) from the Derna region. This fed speculation that Haftar’s operations were for political gain, rather than a fight against hard-line Islamists.

In December 2015, efforts were made to establish peace between the rival HoR and GNC. The two sides signed the Libyan Peace Agreement for a new interim Government of National Accord. Elections would be held within two years, while the HoR continued as a legislature body but incorporated members from the GNC.

Khalifa Haftar was an ally of Qaddafi and helped him attain power in 1969. However, the Libyan leader broke ties with Haftar after the field general was captured in Chad in 1987. The commander lived in the US for the next two decades and holds dual citizenship.

Haftar returned to Libya in 2011 and is thought to have helped in the downfall of the Qaddafi regime. Initially, he could not establish himself in the new political landscape, but the second Civil War was his opportunity to gain influence through Operation Dignity and control of oil-rich territories in eastern Libya.

Russia, Saudi Arabia, UAE, and now Egypt back Haftar’s forces. France also supports the field marshal, viewing him as the best candidate to rid the country of Islamists and to provide stability offering renewed oil and trade links. But Paris’s position conflicts with that of the UN causing tension with other European countries.

On April 4, Haftar ordered his forces to advance on Tripoli. He said they should not open fire on civilians: “Whoever raises the white flag is safe." However, with the Libyan National Army likely to have a larger force and greater capabilities than local rivals, civilians will be at risk if militias refuse to give up control to the LNA and clashes occur. Haftar’s forces are on the outskirts of the capital. The militias of western Libya, aligned with the GNC, have come to the aid of the national army to resist a multi-pronged attack.

The response from the international community has been divided. Haftar and his foreign backers portray the offensive as a counter-terror operation. But the UN Special Envoy for Libya, Ghassan Salamé, rejects this explanation and says this is an attempted coup.

Haftar has bolstered this UN view with an arrest warrant for Prime Minister Fayez al-Sarraj, who is considering arrest warrants for Haftar and his local allies in response. The Prime Minister warns that the conflict could spur another 800,000 refugees fleeing for Europe.

Professor Scott Lucas, Professor of American Studies and Cameron Lindsay, EA Worldview.