Hollywood’s glamorization of the Barbary Pirates over the years blurred the horror of a seaborne plague. Between 1530 and 1789, some 1.5 million European Christians and Jews, and American sailors and travelers, were kidnapped and enslaved in Islamic North Africa.

Thomas Jefferson, the second U.S. ambassador to France, was shocked by what he heard when he went with John Adams, first U.S. envoy to Great Britain, to see Tripoli’s ambassador to London in 1785. By what right did the Barbary States seize American shipping and make slaves of both crews and passengers, they asked. It was written in the Koran, the “Barbarian” replied, that all nations who didn’t acknowledge the holy book and its laws were sinners who must be slain in battle; those who surrendered were to become slaves.

“Algerian Corsairs and the Pirates of Tunis and Tripoli” and their rapacious demands compelled the states to unite and build a federal navy and form a Marine Corps. Later, the Barbary Wars made America the global nation it is today. A daring U.S. raid on Tripoli’s harbor elicited a rare compliment from Adm. Lord Nelson, who called it “the most bold and daring act of the age.” “From the halls of Montezuma to the shores of Tripoli” became the Marine anthem.

Off Somalia’s 1,800-mile coastline, the pirates of Mogadishu, in rickety wooden boats with outboard engines, armed with AK-47s and RPGs, have boarded and ransomed some 150 merchant vessels and oil tankers in the past 18 months. Some seajackings occur several hundred miles from the Somali coast.

In the only successful anti-pirate operation, the U.S. Navy ended a standoff last April with a green light from President Obama – and three well-placed shots from three concealed sharpshooters that killed three pirates and freed the American merchant marine captain – and escorted the Maersk Alabama to safe harbor in Kenya.

Some 20,000 ships per year pass through the Gulf of Aden. Currently deployed on ship protection in an area one-third the size of the United States are warships from the U.S., Canada, EU, Russia, China, South Korea, India and Australia.

Almost all seajackings end with the shipowners coughing up from $3 million to $5 million on demands that range from $100 million to $150 million. Security companies, lawyers and negotiators collect inordinate fees for their part in getting the pirates to release their catch. An estimated $80 million has been paid by shipping companies since the beginning of 2009. The 2008 take is estimated at $180 million.

A report released by the International Maritime Bureau’s Piracy Reporting Center last month showed a total of 240 incidents (not all successful boardings) since the beginning of the year – up from 114 over the same period in 2008. Some 300 seafarers are currently being held pending ransom payments.

The chief pirate in each small boat speaks enough English to demand an immediate link to the company or individual that owns the ship. After studying the ship’s cargo manifest, the amount of the ransom demand is immediately communicated. Middlemen then enter the negotiations.

Profitable piracy in Somalia, the prototype of a failed state with no central authority, has attracted all manner of transnational criminals, including al-Qaida-affiliated groups from Yemen. Small-boat pirates are the last stage of a long food chain. They are the maritime militia, mostly teenagers, who are well paid but turn over the bulk of ransom payments to clan leaders.

Bags of cash are delivered from a larger cabin cruiser based in Djibouti, an independent city state in the Horn of Africa. More recently, a small plane dropped ransom money by parachute onto the deck of a hijacked freighter.

The gang chiefs use satellite phones that are used for intelligence on ship movements south down the Red Sea and out of the Persian Gulf headed southwest to the Gulf of Aden along the Omani and Yemeni coasts for the shipping lanes parallel with the Somali coastline. Pirates have ventured as far as 600 miles, halfway to the Seychelles in the Indian Ocean.

Last April the 20,000-ton German vessel Hansa Stavanger and its 24-strong crew was seized some 400 miles from the Somali coast, between Kenya and the Seychelles, and held for four months. After the ship was brought closer to Somalia, a ransom of $3 million was agreed, then increased to $4 million and paid. An EU warship then escorted the ship back to its original course.

Shipowners hire professionals from private security firms, mostly ex-special forces from the United Kingdom and Australia, including negotiators experienced in seajackings. They are reported to get a flat fee of $1 million per successful negotiation. Most transactions are conducted in London, where the maritime insurance giants are located.

Maritime security experts believe that pirates who operate hundreds of miles offshore are launched from “mother ships” flying Panamanian flags and disguised to look like innocent coastal freighters.

Pirates’ land bases are dotted along hundreds of miles of coastline, and thousands of small boats that line the beaches all look the same.

The only real solution to end piracy is a military one, a lesson that was learned in the 18th and 19th centuries, but evidently forgotten in the 21st. America’s NATO allies have sent their best troops to Afghanistan, where most of them are only allowed to fire in self-defense. The very idea of attacking pirates on the high seas sends European parliaments into conniption fits.

At the very least, ships plying those waters should have barbed wire fences above the waterline and several crew members trained on night-vision scopes to kill pirates as they come aboard. International law recognizes the right of self-defense. The “universal jurisdiction” gives all nations the right to punish pirates, irrespective of any connection between the pirates and their nation.

Platitudes about shoring up the moderate Somali government with 40 tons of munitions backfired. By the time the shipment arrived, the alleged moderates were out – and the ammo gratefully received by the Shabab organization in cahoots with terrorists – on land and at sea.

Arnaud de Borchgrave, a member of the Atlantic Council, is an editor-at-large at UPI.  This essay was previously published as “Al Qaida’s Navy?” in the Emerging Threats analysis section of UPI.