The U.S. Navy has more than half the major warships in the world, and there is a pirate threat off the Somali coast. Now that the Navy has killed three of those pirates in order to free Richard Phillips, the kidnapped captain of an American ship, these two facts are coming together in a promising way.

Just to utter that phrase -- "a pirate threat off the Somali coast" -- is to plumb the depths of absurdity. What combination of incompetence and cowardice could have allowed piracy to become a threat to a major shipping route in the early 21st century? What are all those warships with their guns and missiles and radars and helicopters actually for?

To be fair, a couple of other countries have authorized their navies to use force against the Somali pirates: India did it once, and France has just done it for the third time. The French also go in shooting even when hostages are at risk, and this time one of them died. As President Sarkozy's spokesperson said: "France has a consistent policy to oppose all acts of piracy and make sure its citizens are never brought ashore as hostages."

But neither France nor India have enough ships to control what we are regularly told is "a million square miles of ocean." However, that is a deliberate exaggeration, designed to suggest that the job is not being done because it is undoable. The relevant area is really about 400,000 square miles, which is quite a large tract of ocean but certainly not too big for the U.S. Navy.

So the abortive Somali attack on the U.S.-registered ship Maersk Alabama last week may have a silver lining. It may get the U.S. Navy to take over the job of fighting the pirates.

The biggest problem other navies have faced in dealing with the pirates is the pitiful state of international law. The old rules on piracy were simple: Pirates were the "enemies of all mankind," and there was a right of "universal jurisdiction" against them. Any country could arrest pirates from anywhere, regardless of nationality, and try them for their crimes. If they were captured in battle, they were even liable to summary execution.

The new rules, as defined by the United Nations Convention on the Law of the Sea, require a warship to send a boarding party led by an officer onto any suspected pirate vessel to confirm its criminal intent. Until that has been done, the warship may not open fire. It is unlikely that the lawyers consulted with practical seamen before they wrote this clause.

But the United States has not ratified the Law of the Sea convention. This was not foresight, just the Senate's customary reluctance to ratify any treaty that limits U.S. freedom of action in any way, but it is useful in this case. Normally, the U.S. government acts as if it were bound by international treaties that it has signed even when the Senate is being obstinate, but it doesn't actually have to.

So the U.S. Navy, perhaps acting in cooperation with the French and Indian navies and anybody else who has a bit of backbone, could be deployed to deal with the pirates. For a start, it could declare an exclusion zone beginning 12 nautical miles off the Somali coast that can only be traversed by vessels that have been cleared by U.S. naval authorities. All legitimate commercial ships and pleasure-craft would be waved through automatically; all other vessels in the zone would be sunk without warning.

There would still be a need for warships scattered throughout the zone to deal with pirates that slipped across the 12-mile line, but this sort of exclusion zone would allow most of the naval forces to concentrate on containing them within Somalia's territorial waters.

Would enforcing the exclusion zone mean that some of the pirates get killed? Yes, of course, but there was a reason why pirates were defined as "enemies of all mankind." The sea is an alien environment, a place where people die very quickly if things go wrong. Those who prey on other people in this environment have very little call on our sympathy.

Would the dead also include a few Somali fishermen who enter the exclusion zone by accident or in desperation? Probably. You try to avoid it, but some innocent people almost always die when you use military force. So let the fishermen put pressure on the local warlords to end their collusion with the pirates. It is not everybody else's duty to put up with piracy so that Somalis can go on fishing.

The world has consistently failed Somalia for almost two decades while it has languished in violent anarchy. But letting the piracy continue doesn't help Somalia in any way, so the Navy might as well get on with the job of suppressing it.

Gwynne Dyer is a London-based independent journalist whose articles are published in 45 countries.