The war on Libya has not gone well. Kim Sengupta's report on Wednesday detailed this starkly:

"Fresh diplomatic efforts are under way to try to end Libya's bloody civil war, with the UN special envoy flying to Tripoli to hold talks after Britain followed France in accepting that Muammar Gaddafi cannot be bombed into exile. The change of stance by the two most active countries in the international coalition is an acceptance of realities on the ground. Despite more than four months of sustained air strikes by Nato, the rebels have failed to secure any military advantage. Colonel Gaddafi has survived what observers perceive as attempts to eliminate him and, despite the defection of a number of senior commanders, there is no sign that he will be dethroned in a palace coup. The regime controls around 20% more territory than it did in the immediate aftermath of the uprising on 17 February."

If the Gaddafi regime is now more in control of Libya than before, then this completely undermines the simplistic view put about by the supporters of war – and unfortunately by some elements of the resistance – that the situation was simply one of a hated tyrant hanging on through mercenary violence. Of course, he uses whatever resources he has at his disposal, but a) it would seem that the involvement of imperialism has driven some Libyans back into the Gaddafi camp, as it's unlikely he would maintain control without some degree of support, and b) we know that rebellious sectors started to go back to Gaddafi within mere weeks of the revolt taking off, meaning in part that his resources of legitimising his regime were not exhausted even before the US-led intervention. Despite the defections, he has consolidated his regime in a way that would have seemed improbable in the early weeks of revolt.

It's important to bear in mind what this means. Both Ben Ali and Mubarak had the support of the US and its major allies – especially Mubarak. They had considerable resources for repression, and there was financial aid being channelled to them, talks aimed at offering reforms to the opposition … and in the end they proved too brittle, too narrowly based, to stay in power.

The state apparatus began to fragment and decompose. The protests kept spreading, and withstood the bloodshed. Nothing they could offer or threaten was sufficient. Gaddafi, on the other hand, has hung on in the face of not only a lack of support from his former imperialist allies, but active political, diplomatic and military opposition. That he did so to a considerable extent through sheer military superiority doesn't mean that the regime hasn't a real social basis.

Perhaps as important has been the weaknesses of the rebellion. I argued that the chief problem facing the revolt was that it had taken off before any civil society infrastructure had been built up to sustain the opposition. This meant that unrepresentative former regime elements were well placed to step into the fray and take effective control. As a result of the defeats they faced, those arguing for an alliance with Nato grew stronger and gained more control. There's no question that if Nato really wanted to, they could defeat Gaddafi. It would, however, require a level of commitment (serious ground forces) that they aren't ready to use. I think this is because, far from this being a pre-planned wave of expansionism by the US, the decision to launch an aerial assault constituted a desperate act of crisis management, which the "realists" in the administration were never particularly happy with. Only the zealots of "humanitarian intervention" could seriously have contemplated the kind of protracted, bloody land war in Libya that would have been necessary to win. So, the bet on an alliance with Nato now appears to have been doomed from the start, even on its own terms – even if the best outcome sought was nothing more than a slightly more liberal regime incorporated into the imperialist camp.

Now, what can Libya expect? The leading war powers are once more bruiting negotiations, but to what end? Gaddafi may be persuaded to abandon direct control, in which case the result will most likely be a moderately reformed continuity regime, with ties to European and US capital fully restored.

There appears to be little prospect of his going into exile. But that's not all. The Transitional Council led by former regime elements continues to state that it is the only legitimate authority in Libya. It has been internationally recognised as such by a number of crucial powers. But this is pure cynicism. The imperialist powers know that the Transitional Council can't control all of Libya. They're certainly not taking any steps now to give them the military means to do so. So this means that the tendencies toward partition are sharpened.

There are signs of such a resolution being offered as a "temporary" measure to secure the peace and allow some process of national reconciliation to take place (note that this conflict has increasingly been described as a civil war). This would be economically disabling for all of Libya, including those territories controlled by the rebels. It would also be dangerous in ways that I hope I don't need to spell out.

The final justification for this debacle will be that speedy intervention, however half-hearted, prevented a massacre. Now, there may once have been reason to believe this. But there no longer is.

Gaddafi has enough blood on his hands, and deserved to fall to the insurgents, but there's no reason to submit to war propaganda. In reality, as Amnesty put it, "there is no proof of mass killing of civilians on the scale of Syria or Yemen". [See footnote] Which is an interesting way of putting it. It's no secret that the coalition that was supposedly preventing a genocidal bloodbath in Libya was actually behind much of the bloodshed in Yemen. This completely demolishes the last leg of the moral case for war. The "humanitarian interventions" of the 1990s left the US in a stronger position, both geopolitically and ideologically. I'm not convinced that this will be the result of the bombing of Libya. In fact, if there was any idea that the US could offer an alternative model of development for the populations of the Middle East, it now lies in ruins. It is more than unfortunate that Libya had to be reduced to ruins for this to become apparent.

• This footnote was added on 12 August to correct the attribution of this sentence in the article above: "In reality, as Amnesty put it, 'there is no proof of mass killing of civilians on the scale of Syria or Yemen'." The Syria-Yemen assertion appeared in a piece in the Independent that cited Amnesty findings on a range of matters including estimated death tolls in Libyan cities, and went on to draw a contrast with Syria and Yemen. But while the figures were from Amnesty, the conclusion was that of the article's author. It was mistakenly credited to Amnesty.