Iraq may have been a blood-drenched disaster and Afghanistan a grinding military and political failure. But Libya was supposed to have been different. Nato's war to overthrow Colonel Gaddafi in 2011 was hailed as the liberal intervention that worked.

The western powers might have had to twist the meaning of the UN resolution about protecting civilians, the city of Sirte might have been reduced to rubble, large-scale ethnic cleansing taken place and thousands of civilians killed. But it was all in a noble cause and achieved without Nato casualties.

This wasn't Bush and Blair, after all, but Obama, Cameron and Sarkozy. The people were free, the dictator was dead, a mooted massacre had been averted – and all this without any obvious boots on the ground. Even last year the prime minister was still claiming it had all been worthwhile, promising to stand with Libyans "every step of the way".

But three years after Nato declared victory, Libya is lurching once again towards civil war. Over the past few days, the CIA-linked General Hiftar launched his second coup attempt in three months, supposedly to save the country from "terrorists" and Islamists. On Sunday, his forces stormed the national parliament in Tripoli, after 80 people were killed in fighting in Benghazi two days earlier.

Now Libya's chief of staff has called on Islamist militias to defend the government in advance of new elections. Since the country is overrun with militias far more powerful than its official forces, riven with multiple divisions and prey to constant external interference, the chances of avoiding full-blown conflict are shrinking fast.

But these are only the latest of the clashes and atrocities that have engulfed Libya since Nato's "liberation": including bombings, assassinations, the kidnapping of the prime minister, the seizure of oil terminals by warlords, the explusion of 40,000 mainly black Libyans from their homes, and the killing of 46 protesters on the streets of Tripoli in one incident — ignored by the states that supposedly went to war to protect civilians.

In reality, the west seized the chance to intervene in Libya to get a grip on the Arab uprisings. Nato air power in support of the Libyan rebellion increased the death toll by a factor of about 10, but played the decisive role in the war— which meant no coherent political or military force was ready to fill the vacuum. Three years on, thousands are held without trial, there are heavy curbs on dissent, and institutions are close to collapse.

But the US and Britain are still training Libyan troops to keep control. Before Gaddafi's overthrow, Hiftar headed the military wing of the CIA-backed National Salvation Front. In advance of his latest coup attempt, a sympathetic US sent a force of marines to Sicily ready to intervene, and John Kerry has promised to help Libya with "security and extremism".

Both the UAE and Saudi Arabia are openly backing Hiftar, as is the military coup leader in Egypt, General Sisi. Having suppressed, jailed and shot in large numbers Egypt's own Islamists, Sisi and his Gulf backers are determined to prevent them consolidating power in oil-rich Libya. There are signs that Sisi – who complains that the west failed to garrison Libya after Gaddafi's overthrow – wants to use Libya's crisis to send in his own forces.

But it's not just Libya that's living with the fallout from Nato's intervention. Blowback from the Libyan war has spread across Africa, destabilising the Sahel region and beyond. After Gaddafi's fall, Tuareg people who had fought for him went home to Mali, bringing Libyan arms caches with them. Within months, that had tipped northern Mali into full-scale armed rebellion and takeover by Islamist fighters.

The result was last year's French military intervention, backed by the US and Britain. But Libya's impact goes much wider. Among the groups whose armed campaigns have been fuelled by large-scale heavy weapons supplies from Gaddafi's looted arsenals is Boko Haram.

Support for the fundamentalist Nigerian terror sect – which kidnapped 200 schoolgirls last month and has been responsible for more than 1,500 deaths since the start of the year – has been fed by deprivation, drought and brutal state repression in the Muslim north.

But, as elsewhere in Africa and the Middle East, each outside intervention only spreads the cycle of the terror war. So the call for action over the outrage of the Boko Haram kidnapping has brought US, British and French forces to oil-wealthy Nigeria, just as the Mali crisis last year led to the establishment of a US military drone base in neighbouring Niger.

US armed forces are now involved in 49 out of 54 African states, along with the former colonial powers of France and Britain, in what's becoming a new carve-up of the continent: a scramble for resources and influence in the face of China's growing economic role, underpinned with an escalating military presence that spreads terror as it grows. That will bring its own backlash, as did the war in Libya.

Supporters of Nato's Libyan war counter that, even if the country is now plagued by chaos and violence, there was no western military intervention in Syria and more than 150,000 have died in its horrific civil war. But of course there is large-scale covert intervention in support of the Syrian rebels by both the Nato powers and the Gulf states.

One of the ugliest aspects of western policy towards Syria is the turning on and off of that backing to keep their favoured armed groups in the game – without giving them any decisive advantage. In fact, US, British and Gulf support is being stepped up right now because of regime advances on the field.

But it defies logic to imagine that the death toll would have somehow been lower in Syria, or the sectarian conflict less brutal, if the US and its allies had launched a full-scale military attack at any stage of the conflict. The experience of Iraq, where the war is now estimated to have killed 500,000, makes that obvious enough.

But such is the expectation of routine war-making among parts of the western elite that they're already impatient for another outright intervention. "What would America fight for?" asked the Economist plaintively earlier this month, echoing the US Republican charge of weakness in the White House. For the rest of the world, the reality of Libya and its disastrous consequences should be answer enough.

Twitter: @SeumasMilne