Libya is on the brink of an all-out civil war that threatens to upend years of diplomatic efforts to reconcile two rival armed political factions. An advance led by Khalifa Haftar, the warlord from the east of the country, has diplomats scrambling and the UN appealing in vain for a truce. The French government, the European power closest to Haftar, insists it had no prior warning of his assault, which is now less than 20km from the capital, Tripoli. The outcome could shape not just the politics of Libya, but also the security of the Mediterranean, and the relevance of democracy across the Middle East and north Africa.

Facebook Twitter Pinterest General Khalifa Haftar. Photograph: Maxim Shipenkov/EPA

Why is Libya back in the news?

Three months ago, the renegade general Khalifa Haftar, the 75-year-old leader of the self-styled Libyan National Army, started a series of military offensives from his stronghold in the east of Libya, including seizing a key oilfield in the south. His drive was seen as a precursor to an attack on Libya’s rival power base: the fragile UN-recognised government of national accord based in Tripoli, in the west of the country. An assault on Tripoli is now under way.

The outcome could decide whether the country remains on a lengthy, UN-led path to a form of democracy that reunites the country’s long-divided institutions, or instead falls under a form of military rule similar to that in Egypt. The UN had been due to hold a conference on 14-15 April to set the country on the path to reconciliation and elections, and Haftar may be trying to pre-empt that conference’s conclusions.

Who controls the country?

Following elections in June 2014, the country became divided as the house of representatives withdrew to Tobruk, and a combination of leaders set up a rival administration based in Tripoli. The split reflected the historical division between the Libyan regions of Cyrenaica, east of Benghazi, and Tripolitania, in the west. But power is divided among mainly coastal towns, tribes and armed groups, some with Islamist leanings and others not. In Tripoli alone, there are as many as four militias in existence. The only effective nationwide institution is the National Oil Corporation, which has slowly built oil production back up, and is the predominant source of wealth.

Who is Khalifa Haftar and who are his supporters?

Haftar first came to attention as a general loyal to Muammar Gaddafi, participating in the coup that brought him to power in 1969. He fell out with the dictator in 1987 and spent about 20 years in exile in the US, returning to help in the Nato-backed toppling of Gaddafi in 2011. He is said to be animated by a desire to deliver security, rather than democracy. The coherence of his army is disputed, with critics claiming he has used brutal methods to suppress dissent in cities such as Derna and Benghazi, as well as protecting officers wanted for war crimes by the International Criminal Court. His allies in bordering Egypt hope he will bring stability and end the influence of the Muslim Brotherhood.

Haftar's advance leaves UN's hopes for Libya settlement in tatters Read more

How did things get so bad ?

The country has no democratic tradition, having shifted from Italian colonial rule, to a weak monarchy under King Idris, and then 42 years of Gaddafi dictatorship. An international military intervention led by France and the UK during the Arab Spring turned the tide against Gaddafi, who was killed in October 2011, but Nato’s efforts to form a unified democracy afterwards largely failed.

Arms proliferated, despite an embargo, with Barack Obama calling the situation a “shitshow” and accusing his European allies, including David Cameron, of failing to do enough to stabilise the country. Successive UN efforts to reconcile the country’s factions have failed, largely due to disputes over power sharing and the independence of the military.

What is life like for ordinary Libyans?

For years, civilians have experienced the consequences of high inflation, a plunging currency, power cuts, long bank queues and intermittent violence. Surveys show ordinary Libyans, especially the young, are desperate for an end to the fighting. A human trafficking economy has grown amid the instability, and though the flow of migrants to Italy has fallen dramatically, thousands of migrants are trapped in degrading detention camps where they are victims of torture and sexual violence.

What is being done diplomatically?

Like Syria and Yemen, Libya is not helped by regional power rivalries. Turkey and Qatar have broadly supported western forces while UAE, Saudi and Egypt have backed the east, with growing tacit support from the French. Italy, France and the UN have run often competing peace processes, sometimes reflecting commercial interests. Russia is playing a spoiler role, and for the moment the west’s aim is to support the planned UN conference and to warn Haftar he has badly miscalculated. But this will require his closest political allies to deliver this unpalatable message. The days ahead and the fighting will probably determine if Haftar feels the need to listen.