Their exploits have turned the inky-blue waters of the Indian Ocean into a perilous gantlet for ships and an unlikely security challenge for world leaders. But behind the bare brick walls of a desolate former British colonial prison here, five jailed Somali pirates didn't seem very fearsome at all.

One looked to be in his late 40s, his brambly hair stained a deep henna orange, his milky eyes staring into the middle distance. A slightly younger man clutched a faded sarong to his matchstick waist and spoke in barely a whisper.

The leader of the pirate crew, 38-year-old Farah Ismail Eid, wore such a hungry look that a visiting government official, unsolicited, folded a pale $10 bill into his sandpaper palm.

That a few hundred men like these have wreaked so much havoc in the seas off of East Africa is a testament to the sheer power of guts and greed. It's also a stark illustration of the all-consuming anarchy ashore in Somalia, where, after 18 years of conflict, jobs are scarce, guns are plentiful, men will risk everything for a payday — and their government is too weak and corrupt to stop them.

The men behind bars, however, offered another explanation for piracy.

Their story is also rooted in greed — not of their brazen colleagues with the million-dollar ransoms, they say, but of foreign companies that they say have profited from Somalia's lawlessness by fishing illegally in their waters since the 1990s.

In a long interview with McClatchy at the jailhouse in Mandhera, an austere desert fortress in the autonomous northern region of Somaliland, where British forces held Italian POWs during World War II, Eid related what amounts to the pirates' creation myth, in which overfishing by European and Asian trawlers drove Somalia's coastal communities to ruin and forced local fishermen to fight for their livelihoods.

"Now the international community is shouting about piracy. But long before this, we were shouting to the world about our problems," said Eid, a bony-cheeked former lobsterman with a bushy goatee. "No one listened."

Of course, the pirates' journey from vigilante coast guard to firing automatic weapons at cruise ships — as one band did over the weekend — is a reminder that good intentions don't last long in desperate Somalia.

In 1991, Eid was scavenging for lobsters along the craggy shores of central Somalia, saving to start a fishing company, when the government and its security forces were swallowed up in a coup. The country's endless coastline — at nearly 2,000 miles, it's longer than the U.S. West Coast — suddenly became an unguarded supermarket of tuna, mackerel and other fish.

When huge foreign trawlers suddenly began appearing, the local fishermen who plied their trade with simple nets and small fiberglass boats were wiped out, Eid said.

"They fished everything — sharks, lobsters, eggs," he recalled. "They collided with our boats. They came with giant nets and swept everything out of the sea."

At the outset, fishermen in the ramshackle ports of Puntland, Somaliland's rowdy neighbor, re-branded themselves as "coast guards." The first hijackings that Eid remembered came in 1997, when pirates from the port of Hobyo seized a Chinese fishing vessel and then held a Kenyan ship for a $500,000 ransom.

"When I heard about this," Eid said, "I was happy."

Eid had sunk his savings into three boats. In 2005, with catches all too rare and a wife and two children to support, he traded his fishing equipment for a couple of Kalashnikov rifles and rocket launchers in a market in the wild-west port of Bossasso.

He and five other fishermen, swathed in camouflage, piled into a motorized skiff and set off from the village of Garacad. But their motor was too feeble to catch up to any of the ships they spotted, so after five sweltering days they returned to shore.

The next year Eid tried with a stronger engine, a German one imported from Dubai. This time, the novice pirates caught up to a cargo ship and came face to face with its European crew. But Eid's men couldn't prop their heavy metal ladder up against the freighter's hull quickly enough to board the ship. The vessel escaped unmolested.

Global Witness, a London-based group that investigates natural resource exploitation, agrees that vessels from countries such as France, Spain, Indonesia, and South Korea gobbled up hundreds of millions of dollars' worth of fish from Somali waters without licenses.

However, experts say that the foreign fishing wasn't necessarily illegal because the Somali government, even before the coup, didn't delineate its territorial waters, as international maritime laws require.

"In the early to mid-1990s there was some fishing in those waters that, if Somalia had a government that was performing its job, would have demanded licensing fees for," said J. Peter Pham, a piracy expert at James Madison University in Harrisonburg, Va. "But the Somalis never got around to declaring what was legal and illegal."

Somali officials don't argue with the pirates' version of events — only with their tactics.

"We know they have their grievances," said Abdillahi Mohamed Duale, the foreign minister of Somaliland, which declared independence from Somalia in 1991. "But the problem of overfishing has always been there, in the Caribbean, Latin America and the Indian Ocean. It doesn't mean that you take the law into your own hands."

Entering this week, there'd been 93 hijack attempts off the coast in 2009, according to the International Maritime Bureau in London — 17 fewer than in all of last year. After a tense, five-day standoff this month ended with U.S. Navy sharpshooters killing three pirates and rescuing an American ship captain they'd taken hostage, countries pledged $213 million to bolster the Somali security forces.

In Puntland, the pirates have a comfortably chaotic haven. Markets carry everything from automatic weapons to spare batteries for satellite phones, standard equipment for any seagoing bandit. A regional government claims to rule the area, but many suspect that the president, Abdirahman Mohamed Farole, is on the take from pirates, which Farole denies.

According to Eid and others, some officers from Somalia's erstwhile marine corps and coast guard, which patrolled the shores skillfully until the civil war, are training pirate groups in navigation and other seafaring techniques.

"If 20 pirate groups go to sea, one will succeed" in capturing a ship, Eid said. "Nineteen will fail, but they'll keep trying. They have all the equipment and support they need."

Somaliland says it's cracking down on pirates. Four groups of pirates — 26 men in all — have been arrested, and three of the groups are serving 15- to 20-year prison sentences.

Last August, Somaliland authorities raided a seaside guesthouse and captured Eid, who'd moved there and was posing as a mechanic. He and four others were charged with weapons possession and plotting a hijacking, and swiftly sentenced to 15-year prison terms despite having never carried out an attack.

"We are afraid this piracy could spread to Somaliland," said Youssef Essa, Somaliland's vice minister of justice. "That's why we have to give harsh sentences."

Nevertheless, Essa, a former high school teacher, seemed impressed with Eid's story. After listening for over an hour, he rose to shake the younger man's hand and handed him $10. Afterward, he and the silver-haired warden agreed that Eid probably would spend the money on khat, a narcotic leaf that Somali men chew to get high.

MORE FROM MCCLATCHY

Decision to fire on pirates came quickly after five-day standoff

'No cowards': How ship's crew fought off Somali pirates

Give us more money and we'll fight the pirates, Somalia says