IT WASN'T REALLY a pretty night," Rachel Chandler recalled. Small waves were coming from the southeast, and a trickle of wind blew from the southwest. There was no moon, and the stars were shrouded by clouds.

The boat was heading from the Seychelles archipelago to Tanzania, a two-week passage across the Indian Ocean. The wind was pushing them farther north than they'd planned. With no ships or land in sight, the Chandlers' 38-foot sailboat, the Lynn Rival, bobbed along all alone.

Rachel, who is 57, was on watch, and her husband, Paul, 61, was asleep below deck. It was about 2:30 a.m. Because the wind was so faint, Rachel turned on the sailboat's small engine, which was just loud enough to drown out other noise.

By the time she heard the high-pitched whine of outboard motors, she had only seconds to react. Two skiffs suddenly materialized, and when she swung the flashlight's beam onto the water, two gunshots rang out.

"No guns! No guns!" she screamed.

The crack of assault rifles jarred Paul awake.

Within seconds, eight scruffy Somali men hoisted themselves aboard, their rifles and rocket-propelled grenade launchers clanging against the hull. The men stank of the sea and nervous musk, and they jabbed their guns at the Chandlers.

"Stop engine!" they shouted. "Crew, crew! How many crew number?"

Then they demanded a shower.

This was Oct. 23, 2009. The Chandlers would be held for the next 388 days.

IN THE PAST few years, gangs of Somali pirates, kitted out with fiberglass skiffs, rusty Kalashnikovs, and flip-flops, have waylaid hundreds of ships and extracted ransom for their return. More than 20 ships have been seized this year, and the average ransom is now upward of $5 million.

Of all the thousands of people who have been held for ransom, though, few, if any, have endured as long an experience behind pirate lines as Paul and Rachel Chandler. The couple met in London in 1979. A few years after they married, they bought a share in the Lynn Rival. When they retired a few years ago, they began sailing full time, exploring the Adriatic, the Red Sea, Egypt, India, Sudan, Oman, and Eritrea.

They were fully aware that the Indian Ocean was a hunting ground for Somali pirates, but Paul, a Cambridge-trained engineer with a hyper-rational way of looking at the world, considered the risks of being hijacked to be very remote.

"It was a fluke of the wind that put us where we were," he said.

WE DIDN'T KNOW who these guys were," Mohamed Aden said of the pirates who took the Chandlers. "They were nobodies, people we call cockroaches, gangsters, new to the system. It was the first time they had brought anybody to land, the first time they had ever captured anybody. It took us six months to establish who they were."

Aden is the president of the Himan and Heeb administration, a small, clan-based government in central Somalia. Two decades of chaos have resulted in these tiny statelets popping up across the country. There are more than 20, formed by members of the same clan — the one fundamental element of Somali society that has not been totally eviscerated by civil war.

Aden works in Adado, a trading town about 200 miles from the coast. He is a naturalized American and lived in the U.S. for years before being drafted by elders in his clan to build a government from scratch, complete with a functioning police force, environmental laws, and schools. Technically, Himan and Heeb's jurisdiction extends to the coast, but Aden has no authority there; the area is controlled by pirate gangs.

"I don't have the firepower to take these guys on," Aden said. "I'd like to, but I can't."

All anyone in Adado knew was that an upstart named Buggas had taken the Chandlers to a town called Amara, near the coast, and that locals were backing him up. Local support is crucial, because holding hostages can become expensive. You need to keep them fed and, most important, heavily guarded — so a rival pirate gang or Islamist militia doesn't rekidnap them. Paul figures it cost Buggas nearly $20,000 a month to hold him and Rachel hostage.

FOR RACHEL, THE days blur together. They would read the few books they were allowed to grab from the yacht. Sometimes they did yoga; once Paul turned around to see half a dozen gunmen earnestly following along. It seemed everyone was horribly bored.

"I was struggling," Rachel told me. "I'd get through the early part of the morning, and then the heat and humidity would build up, and I'd be lying there thinking, ‘I don't want to read, I don't want to do anything, how am I going to get through the next 10 minutes, let alone 10 hours, let alone 10 days?'"

Buggas, for his part, was supremely confident that he was on the verge of making millions. "British government pay big money, no problem," he kept saying.

He was constantly threatening them: "No money, you dead, kill you." The Chandlers' total life savings was $500,000. The pirates scoffed at such petty cash and demanded $7 million.

Paul suggested the pirates call Rachel's brother, Stephen, a retired farmer in England. Stephen still seems shaken up. "How would you feel if you got a phone call from a guy who says, ‘I got your sister and her husband at gunpoint, so you better send us everything you got and more and you'll be lucky if you get them back'?"

The Chandlers soon deduced that escape or rescue was unlikely. The pirates operated with total impunity in their patch of Somalia. People were always coming by the camp, sitting for hours with the gang, making it abundantly clear that the whole community was complicit. For Paul, who is unfailingly polite and gentle, this is what brings out the bitterness.

"Everybody was in on it," he said. "I'm angry at Somali society. I'm angry at a community."

Buggas decided to separate the Chandlers to make them as miserable as possible, so they would urge their relatives to cough up the cash. The Chandlers refused and roped their arms around each other. "We didn't want to die alone," Rachel said. Buggas yanked out a tree root, stripped it smooth, and ferociously whipped the Chandlers. They crumpled to the ground, and the pirates pulled them apart.

As gunmen dragged Paul away, he caught a glimpse of Rachel on her knees, screaming, "Bastards! Murderers!" Buggas smashed the back of his rifle into her jaw, shearing off a tooth.

Thus began three long months of solitude. The Chandlers were held in huts a few miles apart and weren't allowed to communicate. Paul tried to keep himself occupied, sketching and making a phrase book of Somali words. There was one man, the cook, who occasionally spoke to him.

At this point Paul began his "begging calls" to relatives. While Rachel had qualms about leaning on family members, Paul said he saw the whole ordeal "as a commercial transaction. I would pay every penny I could scrimp, borrow, or steal to get me and Rachel out of there." But even accessing their savings was complicated. The Chandlers were officially under duress, the family's solicitor informed Stephen, and therefore not considered mentally fit to hand over control of their accounts.

Rachel, meanwhile, was completely isolated. Buggas instructed the guards not to talk to her. Rachel's cook would throw down a bowl of food and then just pad away. She started talking to herself and chanting. It tormented her to think that Buggas and his gang were going to profit from her misery. She had hidden a couple of razor blades in her hut and fantasized about slitting her wrists at night so the pirates would wake to find her sprawled in a pool of blood.

"But the problem was I wouldn't be able to see their faces," she ultimately realized. "So what's the point of that?"

In late January, a doctor was allowed to see the Chandlers. Mohamed Dahir, a Somali journalist, tagged along and filmed the visit. Dahir was shocked at how bad Rachel looked.

"She was sitting under a tarp in a bush camp, completely out of it," he said. "She kept saying, ‘I need my husband. I want to see my husband before I die.'"

By the spring, after the Chandlers had spent six months in captivity, local opinion was turning against Buggas and his crew. "People were making fun of the pirates," said Dahir. "Everybody was saying they have this big debt and they're holding an old couple who don't have any money."

Finally it seemed to dawn on Buggas that he wasn't going to make much of a profit on this one. Stephen was negotiating a payment under half a million dollars, all the Chandler family could afford, but a fraction of what corporate ship owners typically pay. (One pirate gang made $9.5 million last year by hijacking a Korean oil tanker.)

Buggas agreed to reunite the Chandlers while the arrangements were being finalized. "Our hopes were sky high," Paul said. But then nothing happened. Dejected, they wondered whether Stephen got cold feet and backed out.

When Mohamed Dahir returned in July, he whispered to the Chandlers that the money drop had been made; the pirates received nearly $450,000.

What exactly happened next remains murky. Aden and several others told me that a group of Somalis secretly collected several hundred thousand dollars to pay off the pirates. The Chandlers said they had the impression that a second payment was made. One day, Buggas came up to them and said something like, "My Somali family give two hundred," referring to his clan. (The pirates always spoke in thousands.)

On Nov. 13, 2010, more than a year after they were taken, the Chandlers were told to pack their bags. They were finally free.

WHEN THEY ARRIVED in London a few days later, they were energized by a surprising piece of news: The British Navy had recovered the Lynn Rival. She's now in a boatyard near Dartmouth, a quaint English town full of fudge shops, the opposite end of the universe from Somalia.

The Chandlers insist they have had no lasting damage from the experience, physical or psychological, except, in Paul's words, "We've spent 2 percent of our lives in Somalia."

Shortly after they returned, the Chandlers agreed to a series of paid interviews with a London tabloid and a TV station and then started working on a book, which was published in September in England. They did this with one goal in mind, they told me: make enough money to pay back their families and fix their boat, which still has a bullet hole in the boom. Profiting from their ordeal, Rachel says, is "just a means to an end, and the end will be getting back on the Lynn Rival" — though they are going to stay out of the Indian Ocean for the time being.

©2011, The New York Times