As the most hopeful offshoot of the "Arab spring" so far flowered this week in successful elections in Tunisia, its ugliest underside has been laid bare in Libya. That's not only, or even mainly, about the YouTube lynching of Gaddafi, courtesy of a Nato attack on his convoy.

The grisly killing of the Libyan despot after his captors had sodomised him with a knife, was certainly a war crime. But many inside and outside Libya doubtless also felt it was an understandable act of revenge after years of regime violence. Perhaps that was Hillary Clinton's reaction, when she joked about it on camera, until global revulsion pushed the US to call for an investigation.

As the reality of what western media have hailed as Libya's "liberation" becomes clearer, however, the butchering of Gaddafi has been revealed as only a reflection of a much bigger picture. On Tuesday, Human Rights Watch reported the discovery of 53 bodies, military and civilian, in Gaddafi's last stronghold of Sirte, apparently executed – with their hands tied – by former rebel militia.

Its investigator in Libya, Peter Bouckaert, told me yesterday that more bodies are continuing to be discovered in Sirte, where evidence suggests about 500 people, civilians and fighters, have been killed in the last 10 days alone by shooting, shelling and Nato bombing.

That has followed a two month-long siege and indiscriminate bombardment of a city of 100,000 which has been reduced to a Grozny-like state of destruction by newly triumphant rebel troops with Nato air and special-forces support.

And these massacre sites are only the latest of many such discoveries. Amnesty International has now produced compendious evidence of mass abduction and detention, beating and routine torture, killings and atrocities by the rebel militias Britain, France and the US have backed for the last eight months – supposedly to stop exactly those kind of crimes being committed by the Gaddafi regime.

Throughout that time African migrants and black Libyans have been subject to a relentless racist campaign of mass detention, lynchings and atrocities on the usually unfounded basis that they have been loyalist mercenaries. Such attacks continue, says Bouckaert, who witnessed militias from Misrata this week burning homes in Tawerga so that the town's predominantly black population – accused of backing Gaddafi – will be unable to return.

All the while, Nato leaders and cheerleading media have turned a blind eye to such horrors as they boast of a triumph of freedom and murmur about the need for restraint. But it is now absolutely clear that, if the purpose of western intervention in Libya's civil war was to "protect civilians" and save lives, it has been a catastrophic failure.

David Cameron and Nicolas Sarkozy won the authorisation to use "all necessary means" from the UN security council in March on the basis that Gaddafi's forces were about to commit a Srebrenica-style massacre in Benghazi. Naturally we can never know what would have happened without Nato's intervention. But there is in fact no evidence – including from other rebel-held towns Gaddafi re-captured – to suggest he had either the capability or even the intention to carry out such an atrocity against an armed city of 700,000.

What is now known, however, is that while the death toll in Libya when Nato intervened was perhaps around 1,000-2,000 (judging by UN estimates), eight months later it is probably more than ten times that figure. Estimates of the numbers of dead over the last eight months – as Nato leaders vetoed ceasefires and negotiations – range from 10,000 up to 50,000. The National Transitional Council puts the losses at 30,000 dead and 50,000 wounded.

Of those, uncounted thousands will be civilians, including those killed by Nato bombing and Nato-backed forces on the ground. These figures dwarf the death tolls in this year's other most bloody Arab uprisings, in Syria and Yemen. Nato has not protected civilians in Libya – it has multiplied the number of their deaths, while losing not a single soldier of its own.

For the western powers, of course, the Libyan war has allowed them to regain ground lost in Tunisia and Egypt, put themselves at the heart of the upheaval sweeping the most strategically sensitive region in the world, and secure valuable new commercial advantages in an oil-rich state whose previous leadership was at best unreliable. No wonder the new British defence secretary is telling businessmen to "pack their bags" for Libya, and the US ambassador in Tripoli insists American companies are needed on a "big scale".

But for Libyans, it has meant a loss of ownership of their own future and the effective imposition of a western-picked administration of Gaddafi defectors and US and British intelligence assets. Probably the greatest challenge to that takeover will now come from Islamist military leaders on the ground, such as the Tripoli commander Abdel Hakim Belhaj – kidnapped by MI6 to be tortured in Libya in 2004 – who have already made clear they will not be taking orders from the NTC.

No wonder the council's leaders are now asking Nato to stay on, and Nato officials have let it be known they will "take action" if Libyan factions end up fighting among themselves.

The Libyan precedent is a threat to hopes of genuine change and independence across the Arab world – and beyond. In Syria, where months of bloody repression risk tipping into fullscale civil war, elements of the opposition have started to call for a "no-fly zone" to protect civilians. And in Africa, where Barack Obama has just sent troops to Uganda and France is giving military support to Kenyan intervention in Somalia, the opportunities for dressing up a new scramble for resources as humanitarian intervention are limitless.

The once savagely repressed progressive Islamist party An-Nahda won the Tunisian elections this week on a platform of pluralist democracy, social justice and national independence. Tunisia has faced nothing like the backlash the uprisings in other Arab countries have received, but that spirit is the driving force of the movement for change across a region long manipulated and dominated by foreign powers.

What the Libyan tragedy has brutally hammered home is that foreign intervention doesn't only strangle national freedom and self-determination – it doesn't protect lives either.