It is tempting to be jaunty about piracy. So what if a few Robin Hoods in skiffs nick the odd tanker off the Horn of Africa? Often enough, the owners pay ransom and nobody gets hurt. Everyone needs to make a living in these hard times. And if worst comes to worst, gunboats can always be dispatched to clean up the problem, just as the British and Americans did off north Africa's Barbary coast two centuries ago.

It is tempting, but it is wrong.

The Barbary pirates caused immense human and economic damage, and the current spate of piracy in the waters of east Africa is now getting out of hand, too. On Nov. 15, pirates operating hundreds of miles from the coast seized the Sirius Star, a supertanker carrying 2 million barrels of Saudi oil. A dozen or so other vessels are already held by pirates. One of them -- surrounded by U.S. and Russian warships -- contains a cargo of 33 T-72 tanks, enough to tip the balance in a small local war.

The last thing the world needs right now is disruption of one of its busiest shipping lanes and a spike in insurance premiums. But the cause of the present surge of piracy is no less worrying than its consequences. What has made the pirates' audacity possible is the collapse of Somalia. The existence of a vast ungoverned space in Africa's Horn does not just provide a useful haven from which pirates can hunt their prey at sea. It also threatens to transmit shockwaves through a seam of fragile and strife-torn African states from Sudan to the Congo.

How did this happen, and how can it be resolved?

The first question is the easier to answer. About 50,000 peacekeepers are currently deployed under United Nations or African Union auspices in east and central Africa in an effort to dampen down various conflicts. In Somalia in 2006, however, the Bush administration tried something different: war by proxy. It gave a green light for Ethiopia to invade Somalia. The plan was for Ethiopia to squash an Islamist movement and reinstate a Somali government that had lost control of most of its territory.

Two years later, the plan has backfired. Abdullahi Ahmed, Somalia's seemingly powerless president, admitted on Nov. 15 that a variety of Islamist insurgents again dominate most of the country, leaving only two cities, Mogadishu and Baidoa, in the hands of his government.

More needed than gunboats

Neither Ethiopia nor the African Union ever sent enough soldiers to impose order. Worse, the strongest of the insurgent groups, the Shabab, is even more radical than the Islamic Courts movement that the Americans and Ethiopians originally took on. It is suspected of being linked by money to the pirates (who hand over a slice of the ransom in return for protection) and by ideology to Al-Qaida.

So how to resolve the issue? It is not enough just to send more gunboats. Although an Indian warship sunk an alleged pirate vessel last week, and a bigger naval effort could help to make the sea lanes a little safer, a long-term solution demands much more.

This includes establishing stability inside Somalia itself, depriving the pirates of a sanctuary, and preventing the jihad-tinted anarchy there from spilling over Somalia's borders. But since there are no serious military forces available to defeat the insurgents, a proper answer will entail reshaping the country's politics and stepping up attempts to woo the more moderate Islamists -- if there are enough left and if a deal with them is still possible.

Maybe not so jaunty, after all.