There's at least one job these days that's recession-proof, if you can handle shark-infested seas, outrun some of the world's most powerful navies, and keep your cool when your hostages get antsy.

A pirate's life in Somalia isn't for everyone. However, nothing comes easily in one of the poorest and most unstable countries on Earth, and when you consider the dearth of career options for Somalis on land, a pirate's life starts to look more than cushy by comparison.

"Is there any Somali who can earn a million dollars for any business? We get millions of dollars easily for one attack," brags Salah Ali Samatar, a pirate who spoke by phone from Eyl, a pirate den on Somalia's desolate northern coast.

Hundreds of pirates such as Mr. Samatar – zipping around in simple fiberglass speedboats and usually armed with nothing more sophisticated than automatic rifles – have turned the waters off East Africa into a terrifying gantlet for cargo vessels, oil tankers, and even cruise ships sailing between Europe and Asia. The International Maritime Bureau says at last count 42 ships have been hijacked off Somalia this year, and experts in neighboring Kenya estimate that Somali pirates have pocketed $30 million in ransoms.

While their countrymen suffer through another political crisis and the looming threat of famine, pirates are splashing hundred-dollar bills like play money around the nowhere towns of northern Somalia.

Residents say the pirates are building houses, buying flashy cellphones and air-conditioned SUVs, gifting friends and relatives with hundreds and sometimes thousands of dollars, and winning the attention of beautiful women, who seem to be flocking to pirate towns from miles around.

Shopkeepers charge the pirates a premium for food and khat – a narcotic leaf that Somali men chew – but the buccaneers don't seem to mind.

"It is true," saysa pirate who identifies himself as Jama. "We are getting very rich."

Jama, who describes himself as a high-ranking member of a group based in Eyl, has earned $375,000 as a pirate, enough to buy a Toyota Land Cruiser and to begin building a six-bedroom house in Garowe, the regional capital, for his family. His biggest payday came last month, when he earned a $92,000 share of a $1.3 million ransom for a Greek ship, the MV Centauri, which was released after 10 weeks with its crew unharmed.

Almost overnight, Jama says, his standing with the fairer sex has improved dramatically.

"Once there was a girl who lived in Garowe," 100 miles from Eyl, Jama says. "I loved her. I tried to approach her many times, but she rejected me. But since I became a pirate, she has tried nine times to get with me.

"But I refused, because I'm already married."

For years, piracy was a middling trade in Somalia, just one way that desperate young men with guns could make a living in a desperately poor land. In recent months, however, with food prices soaring, the interim government careening toward collapse, and local authorities powerless to intervene, hardly a day has gone by without an attempt to commandeer a ship.

"Socioeconomic status in Somalia is very bad right now, as we know, and this is one of the reasons pirates have turned to hijacking," says Cyrus Mody of the International Maritime Bureau, based in London. "There are a few people who are gaining a lot."

In September, pirates captured the world's attention by seizing the MV Faina, a Ukrainian ship ferrying tanks, grenade launchers and other weapons, reportedly to southern Sudan. In November came an even more brazen haul: the Saudi-owned Sirius Star supertanker, the biggest ship ever hijacked, loaded with $100 million worth of oil. Both vessels are still being held for ransom.

The US military and NATO have deployed warships to patrol the region, and China said this week that it would send a fleet to join the effort. Also this week, the UN Security Council authorized nations to chase pirates onto land, although US military officials are skeptical of that tactic, arguing that pirates can easily blend into the local population.

Many of the pirates are former fishermen who claim they're retaliating against rich countries for years of illegal fishing and dumping in Somali waters, and a small portion of the ransoms is thought to go to local fishermen.

One pirate group in Eyl goes by the name "Saving the Somali Sea," although residents complain that the lion's share of the cash stays in the pirates' pockets.

"This town benefits nothing from the pirates," says Bishara Said Ahmed, a housewife in Eyl. "There's no business increase. It's like how it was before. The pirates use this town just to take ships, and when they have their money, they go to other towns to spend it."

Ransom payments used to be made via hawala, a money-transfer system that functions as a low-fee Western Union in the Muslim world. As the sums have grown, however, ship owners increasingly rely on helicopter drops from Kenya. Wooden crates packed with cash sometimes fall from the sky in Eyl, like manna to the impoverished civilians barely eking out an existence on dry land.

Money-counting machines like the ones at your local bank – "We have to make sure it's real money," Jama explains – tally up amounts so huge that families who have survived on fishing for generations say that young children now want to grow up to be pirates.

"Whenever we hear that a ransom was paid, children's dreams of becoming pirates just increase," Ms. Ahmed says.

It isn't just children who are starry-eyed. Mustaf Mohamed Abdi, a taxi driver in Garowe, marvels at the excitement in town when a band of pirates comes through on a spending spree. If he's lucky, Mr. Abdi says, a friendly pirate might tip him with a hundred-dollar bill.

"The pirates are the hottest men in town," Abdi says. "Girls from all over Somalia moved here to marry pirates. But if the girl isn't cute she's out of luck, because the pirates only go with beautiful girls."

• McClatchy special correspondent Ahmed Ali Sheik contributed to this article.

MORE FROM MCCLATCHY

Should ground troops hunt pirates in Somalia?

Pirates along African coast send shipping costs soaring

With U.S. ships nearby, Somali pirates unveil a spokesman