It's as if the bloodbaths of Iraq and Afghanistan had been a bad dream. The liberal interventionists are back. As insurrection and repression has split Libya in two and the death toll has mounted, the old Bush-and-Blair battle-cries have returned to haunt us.

The same western leaders who happily armed and did business with the Gaddafi regime until a fortnight ago have now slapped sanctions on the discarded autocrat and blithely referred him to the international criminal court the United States won't recognise.

While American and British politicians have ramped up talk of a no-fly zone, US warships have been sent to the Mediterranean, a stockpile of chemical weapons has been duly discovered, special forces have been in action, Italy has ditched a non-aggression treaty with Tripoli and a full-scale western military intervention in yet another Arab country is suddenly a serious prospect.

Egged on by his neoconservative lieutenants, David Cameron went furthest. Fresh from his tour selling arms to Gulf despots, the British prime minister talked excitedly about arming Libyan rebels, and only staged a hasty retreat when he found himself running ahead of the US administration.

But neither American caution nor UN security council opposition should obscure the fact that there is now a serious danger of western armed action in Libya. Unlike in the rest of the region, we are no longer talking mainly about the security forces confronting demonstrators but a split in the heart of the regime and the military, with large areas of the country in the hands of an armed opposition.

With Colonel Gaddafi and his loyalists showing every sign of digging in, the likelihood must be of intensified conflict – with all the heightened pretexts that would offer for outside interference, from humanitarian crises to threats to oil supplies.

But any such intervention would risk disaster and be a knife at the heart of the revolutionary process now sweeping the Arab world. Military action is needed, US and British politicians claim, because Gaddafi is "killing his own people". Hundreds have certainly died, but that's hard to take seriously as the principal motivation.

When more than 300 people were killed by Hosni Mubarak's security forces in a couple of weeks, Washington initially called for "restraint on both sides". In Iraq, 50,000 US occupation troops protect a government which last Friday killed 29 peaceful demonstrators demanding reform. In Bahrain, home of the US fifth fleet, the regime has been shooting and gassing protesters with British-supplied equipment for weeks.

The "responsibility to protect" invoked by those demanding intervention in Libya is applied so selectively that the word hypocrisy doesn't do it justice. And the idea that states which are themselves responsible for the deaths of hundreds of thousands in illegal wars, occupations and interventions in the last decade, along with mass imprisonment without trial, torture and kidnapping, should be authorised by international institutions to prevent killings in other countries is simply preposterous. The barefaced cheek of William Hague's insistence that there would be a "day of reckoning" for the Libyan regime if it committed crimes or atrocities took some beating.

The reality is that the western powers which have backed authoritarian kleptocrats across the Middle East for decades now face a loss of power in the most strategically sensitive region of the world as a result of the Arab uprisings and the prospect of representative governments. They are evidently determined to appropriate the revolutionary process wherever possible, limiting it to cosmetic change that allows continued control of the region.

In Libya, the disintegration of the regime offers a crucial opening. Even more important, unlike Tunisia and Egypt, it has the strategic prize of the largest oil reserves in Africa. Of course the Gaddafi regime has moved a long way from the days when it took over the country's oil, kicked out foreign bases and funded the African National Congress at a time when the US and Britain branded Nelson Mandela a terrorist.

Along with repression, corruption and a failure to deliver to ordinary Libyans, the regime has long since bent the knee to western power, as Tony Blair and his friends were so keen to celebrate, ditching old allies and nuclear ambitions while offering privatised pickings and contracts to western banks, arms and oil corporations such as BP.

Now the prospect of the regime's fall offers the chance for much closer involvement – western intelligence has had its fingers in parts of the Libyan opposition for years – when other states seem in danger of spinning out of the imperial orbit.

But Libya has a compelling history of foreign occupation and resistance. Up to a third of the population are estimated to have died under Italian colonial rule. Those calling for western military action in Libya seem brazenly untroubled by the fact that throughout the Arab world, foreign intervention, occupation and support for dictatorship is regarded as central to the problems of the region. Inextricably tied up with the demand for democratic freedoms is a profound desire for independence and self-determination.

That is clear in reaction on the ground in Libya to the threat of outside intervention. As one of the rebel military leaders in Benghazi, General Ahmad Gatroni, said this week, the US should "take care of its own people, we can look after ourselves".

No-fly zones, backed by some other opposition figures, would involve a military attack on Libya's air defences and, judging from the Iraqi experience, be highly unlikely to halt regime helicopter or ground operations. They would risk expanding military conflict and strengthening Gaddafi's hand by allowing the regime to burnish its anti-imperialist credentials. Military intervention wouldn't just be a threat to Libya and its people, but to the ownership of what has been until now an entirely organic, homegrown democratic movement across the region.

The embattled US-backed Yemeni president Ali Abdallah Saleh claimed on Tuesday that the region-wide protest movement was "managed by Tel Aviv and under the supervision of Washington". That is easily dismissed as a hallucinogenic fantasy now. It would seem less so if the US and Britain were arming the Libyan opposition. The Arab revolution will be made by Arabs, or it won't be a revolution at all.