THE spectacle of American, British and French missiles pulverising an Arab and Muslim country at the dead of night arouses a sense of foreboding. Such ventures have too often begun with good intentions and naive overconfidence, as oil-rich despots see their armour crumple and burn beneath superior Western technology. Within weeks, though, vainglory turns into a costly and bloody quagmire.

Yet nobody could accuse Barack Obama and his allies, chiefly Britain's David Cameron and France's Nicolas Sarkozy, of overconfidence in attacking Libya on March 19th. It is hard to think of a military enterprise that has been conceived in so much doubt and anxiety. What if Muammar Qaddafi sits out the raids in his bunker? What if Libya is partitioned? What if, chastened by news footage of dead women and children in a Tripoli market, the coalition starts to fall apart? What if many of the eastern Libyans whom the outside world is protecting turn out to sympathise with al-Qaeda? What if they go on to behave as murderously as the colonel and his paid killers?

The answers to those questions start with the case for intervening in Libya. Western sceptics complain that they have “no dog in this fight”. Libyans, they say, should be left to submit to the colonel or kill him off, as best they can.

That view is too parochial. Colonel Qaddafi is the Arab world's most violent despot. In one day in 1996 his men killed 1,270 prisoners in a Tripoli jail. He has backed terrorism and assassinated dissidents. Western leaders were right to have given him a chance to turn a new leaf after 2003, when he renounced his nuclear programme. But when peaceful protesters marched for change a few weeks ago he shot them—seemingly with relish. Whatever the course of the coming weeks and months, do not forget that the colonel and his sons had vowed to slaughter the people of Tobruk and Benghazi, house by house. In the narrowest of senses, a mission that many said was pointless and too late has already chalked up one success.

Moreover, what happens in Libya, for good or ill, will affect its more hopeful neighbours, Egypt and Tunisia. Farther afield, even Syria is beginning to stir and its government may be tempted to be as ruthless as Libya's (see article). If violence prevails in Libya, the momentum for peaceful change across the Middle East may drain away, as both autocrats and protesters elsewhere in the Arab world conclude that violence is after all an essential tool for getting their way.

Be practical, as well as principled

The sceptics' second retort is that the West is guilty of hypocrisy. As it inveighs against Colonel Qaddafi, its Saudi allies have helped snuff out the flame of democracy in the Gulf state of Bahrain. And surely the West should stop propping up the Yemeni dictator, Ali Abdullah Saleh, whose forces have just shot dead dozens of protesters?

Here practicality—some would say realpolitik—comes into play, sometimes frustratingly. The violence in Bahrain is on a vastly smaller scale than that in Libya; and the West is locked into a military alliance with both Bahrain—home to America's Fifth Fleet—and its royal family's protector, Saudi Arabia. To take on Bahrain's rulers would be to endanger that alliance—and they have run a more open society than Libya anyway. As for Yemen, it is an ungovernable snakepit, home to rival tribes, secessionists and a local branch of al-Qaeda. Nobody in his right mind would intervene there. Neither Bahrain or Yemen is susceptible to an air campaign as Libya is, with its long stretches of desert that expose Colonel Qaddafi's advancing tanks. You intervene when you can, not to be consistent.

The sceptics' third complaint is that the West has entered this campaign without defining the mission. That is both unfair and true. It is unfair because dictators do not work to a diplomatic timetable. Colonel Qaddafi's rapid advance to Benghazi meant that the outside world had to intervene within days or not at all. But it is true that there has been some indecisiveness—principally from Mr Obama. That helped forge a broader coalition, but the West now has its work cut out. It must urgently decide who is in charge, clarify the powers granted by the Security Council resolution enabling Libya's civilians to be protected by “all necessary means” and, most important of all, determine what the campaign's aims should be.

A fight that needs a general

America wants to cede overall control as soon as it has carried out the bulk of the initial bombing. Although to some extent Mr Obama is again shrinking from leadership, it probably makes sense. The mission will look less American: it will force the Europeans to be responsible for a cause they championed; and in NATO there is a body that can take operational control.

The difficult decision is whether Colonel Qaddafi's removal, dead or alive, should be an explicit aim of the enforcers. The UN resolution makes no mention of such a thing, though many Western and Arab leaders have said they want the colonel to go. As commander-in-chief of security forces that have already killed hundreds of civilians since peaceful protests started a month ago, he is arguably a legitimate target. But it would be far better if his own people dealt with him, handed him over to the International Criminal Court in The Hague, or chased him into exile, rather than let him be singled out by his Western enemies for elimination.

An interactive mapof influential nations explains the diplomacy behind military action in Libya

Leaving the Libyans to do that unaided is admittedly a risk, but the odds are on the rebels' side. Once Colonel Qaddafi cannot pound cities such as Benghazi with impunity, opposition across the country will grow again. Isolated and economically strangled, the colonel and his regime would be lucky to survive indefinitely. Even if Libya were temporarily partitioned, the West could keep up the no-fly zone with minimal effort. Gradually, the noose would tighten around the colonel, especially as the anti-Qaddafi east holds most of Libya's oil.

Libya is not Iraq. The West has learned through bitter experience to avoid the grievous mistakes it made from the outset of that venture. For one thing, the current mission is indisputably legal. For another, it has, at least for now, the backing of Libya's own people and—even allowing for some wobbles from Turkey and the Arab League—of most Arab and Muslim countries. Libya's population is a quarter the size of Iraq's, and the country should be easier to control: almost all its people, a more homogeneous lot albeit with sharp tribal loyalties, live along the Mediterranean coastal strip. If Colonel Qaddafi's state crumbles, the West should not seek to disband his army or the upper echelons of his administration, as it foolishly did in Iraq. The opposition's interim national council contains secular liberals, Islamists, Muslim Brothers, tribal figures and recent defectors from the camp of Colonel Qaddafi. The West should recognise the council as a transitional government, provided that it promises to hold multiparty elections. Above all, there must be no military occupation by outsiders. It is tempting to put time-limits on such a venture, but that would be futile.

Success in Libya is not guaranteed—how could it be? It is a violent country that may well succumb to more violence, and will not become a democracy any time soon. But its people deserve to be spared the dictator's gun and be given a chance of a better future.