When Somali pirates started making international news, journalists and politicians said, in so many words, “Forget the romance of eye patches and parrots. These guys are mean.” They are mean, and getting meaner—Jeffrey Gettleman’s terrifying piece for this magazine (“The Wages of Anarchy”) made this very point—but they’re actually not all that foreign: The seventeenth-century Christian pirates of the Caribbean resorted to murder and torture, too. They did something, moreover, that Somalia would be lucky to learn from: They helped build America.

Colonists on the Eastern seaboard in the late 1600s were a struggling, gritty people living far from civilization but near some lucrative shipping lanes, and, after the Navigation Acts especially, they turned a blind eye to violent raids taking place just past their shores. “Very great abuses have been and continue still to be practiced,” wrote the Board of Trade in London to one colonial governor in 1697, warning him that he would lose his position if he continued to tolerate pirates.

But pirates were common in those days in spite of strict letters from London. The Navigation Acts strangled so much legal trade in the colonies that many sailors had nothing much to do. “Captains without cargo and seamen without employment turned in increasing numbers to the easy lure of piracy,” writes Douglas R. Burgess, a law historian at Yeshiva University and author of a book on colonial piracy called The Pirates’ Pact. “Piracy became—and would remain—a staple of colonial commerce long after the acts themselves were revoked.”

In fact, it flourished. By the 1690s, a bold generation of pirates sailed from the American colonies all the way to the Red Sea. Slave captains roving in that part of the world had noticed treasure ships from the Mughal and Ottoman empires trundling between Arabia and the Indian coast—that is, through the Gulf of Aden, where Somali pirates now hunt. Epic ransacking voyages were organized in the American northeast, with active sponsorship from colonial governors. The most famous of these Red Sea pirates, like Thomas Tew and Henry Avery, sailed with financing and “letters of marque”—official letters that authorized attacks upon enemy ships—from the governors of Rhode Island and New York. When they returned, with heavy ships, they would share the wealth with governors. This Red Sea trade became one of the most important sources of income in the colonies, according to Burgess. William Penn, the founder of Pennsylvania, was so impressed with the role pirate treasure played in colonial finance that without it, he argued in 1700, “we had never had a spot upon our Garment”—meaning that some northeastern colonies, with their hardscrabble subsistence farms, would have been flat broke.

The precedent of pirate wealth in the West is easy to miss. Americans are rich and historically distant enough now to forget that some of New York’s most venerable fortunes—Philipse, Van Cortlandt—grew large on pirate treasure. European countries also had phases of piracy, and some Western countries still tolerate certain kinds of high-seas crime. European and Asian trawlers steal a wealth of shark and tuna from Somalia’s undefended waters, which the navies off Somalia have failed to prevent.

Revisiting this history is not just awkward; it raises questions about the future of Somalia. Could pirates lay a foundation of wealth in a dry and destitute land? The comparison may seem like a stretch, but in some areas the ransoms have already helped. “In northern coastal towns like Harardhere, Eyl and Bossaso, the pirate economy is thriving,” the Associated Press reported in 2008. The same article quotes a shopkeeper named Sugule Dahir in Eyl. “There are more shops, and business is booming because of the piracy,” he said. “Internet cafes and telephone shops have opened, and people are just happier than before.”

Local attitudes have hardened toward pirates since 2008. But along parts of the coast, Somalis still know where the money comes from. “We marry pirates! Otherwise we’d go hungry,” a young woman told a reporter for the German broadcaster ZDF in May this year. She lives in a central Somali village called Afbarwaargo, where pirates aren’t scorned. “We need someone who can feed the family,” she said. “Right now it’s only pirates who can do that.”

The sums of cash, of course, fund more than family meals. Somali pirates won an estimated $238 million in ransoms during 2010, according to a nonprofit called Oceans Beyond Piracy, much of which went toward luxuries like khat or SUVs. Other amounts flow into an uncertain network of financiers inside and outside Somalia. Local warlords need to be paid off—including Islamists like Al Shabab, in some areas—and certain pirate bosses also meddle in arms smuggling, according to the U.N. So a great deal of the money fuels Somalia’s civil wars.

Of course, there are crucial differences between early America and modern Somalia beyond where the money ends up. Pirates helped build the American colonies because the colonists belonged to a well-organized system of trade; the stolen money oiled a working—if rudimentary—infrastructure, which Somalia lacks. Twenty years of civil war have left the nation without proper schools, institutions, and in some cases functioning roads. Khat also leaves people listless, and constant warfare leaves them traumatized. Piracy—so far—tends to fuel the chaos, not alleviate it. American colonists also had ambitions to build a stable new country, and it’s not clear that Somalis have the same unified will. Still, with peace, and infrastructure, some Somali pirate treasure might not go to waste.

Straightforward ocean mugging is a sign of powerlessness, and it’s significant that early American attitudes toward piracy flip-flopped after the Revolution. By 1800, more responsible leaders like Thomas Jefferson fretted that foreign pirates were bad for European trade. The fledgling nation built a deep-water navy with the specific goal of breaking the “Barbary corsairs” off North Africa, who controlled the Strait of Gibraltar. By 1815—after a decade of raids on the Barbary shore—American ships could sail freely to Europe. All that piracy business was behind them.

Michael Scott Moore is the author of Sweetness and Blood, a book about surfing, and he’s working on a book about pirates.