NAIROBI, Kenya – Roy Hallums was enduring his 311th day of captivity, blindfolded, his hands and feet bound, stuffed into a hole under the floor of a farm building outside Baghdad. He heard a commotion upstairs and managed to get the blindfold off. Delta Force troops broke open the hatch. An American soldier jumped down.

“He looks at me and points and says, ‘Are you Roy?’ I say ‘yes,’ and he yells back up the stairs: ‘Jackpot!’ ” Hallums recalled in a phone interview six years after his rescue.

Another mission by elite U.S. troops took place just last week, this time in Somalia, resulting in an American and a Danish hostage being rescued and nine kidnappers killed.

U.S. special forces are compiling a string of successful hostage rescues, thanks to improved technology and a decade of wartime experience. But despite technological advances like thermal imaging and surveillance drones, the raids remain high-risk. Success or failure can depend on a snap decision made by a rescuer with bullets flying all around, or determination by kidnappers to kill any captives before they can be freed.

In 2010, the Navy’s SEAL Team 6 tried to rescue Linda Norgrove, a Scottish aid worker, from her Taliban captors in Afghanistan. She was killed by a grenade thrown in haste by one of the American commandoes.

Kidnappings of foreigners living or traveling overseas continue unabated. While the probability of a person being kidnapped is low, abductions do occur regularly, especially in high-risk nations such as Somalia, Pakistan, Mexico and Colombia.

Even those who are supremely aware of the risks can disappear. In December 2006, Felix Batista, an American anti-kidnapping expert and negotiator for hostage releases, was kidnapped in Saltillo, Mexico, and hasn’t been heard from since.

Just last Tuesday, armed tribesmen in Yemen kidnapped six United Nations workers: an Iraqi, a Palestinian, a Colombian, a German and two Yemenis. On Jan. 20, kidnappers grabbed an American and held him for a week before releasing him, perhaps after a ransom was paid.

U.S. troops have been tasked with rescues mostly in areas where American forces were already stationed, such as Afghanistan, Iraq and around Somalia, said Taryn Evans, an expert on kidnappings at AKE, a risk mitigation company outside London.

In 2009, Navy SEAL sharpshooters killed three Somali pirates holding the American captain of the Maersk Alabama hostage in a lifeboat. And late last month, SEALs parachuted into Somalia under cover of night, then moved on foot to where captors were holding an American woman and a Danish man who had been kidnapped together in October. The SEALs killed nine captors and rescued the two hostages while suffering no casualties themselves in the Jan. 25 operation.

Their skill in carrying out such missions has been honed by America’s two wars in Iraq and Afghanistan, said Seth Jones, a civilian adviser to the commanding general of U.S. special operations forces in Afghanistan from 2009-2011.

“They have conducted so many operations in these areas, from hostage rescues to strike operations to capture-kill missions. What it does is significantly improves the competence of special operations,” Jones said.

Though SEAL Team 6 rescued the American and the Dane, one American kidnapped in January in Somalia remains behind. His captors said they moved him several times in the hours immediately after the SEAL raid, out of fear the U.S. military could try another rescue attempt.

Deputy Secretary of State William Burns said this week the United States is “very concerned” about the remaining hostage and that Washington is following the case closely.

“It’s an essential obligation for any government to do everything we can to protect our citizens and that’s exactly what President Obama did when he ordered the successful hostage rescue” in Somalia, Burns said.

Rescues entail risk, but Hallums, who was kidnapped by a gang in November 2004, is thankful that the U.S. military carries them out.

Without a rescue attempt, the former contractor from Memphis, Tenn., said: “I was going to be dead for sure.”

Hallums’ captors were demanding $12 million for his release. His Saudi Arabia-based employer — which provided support services for U.S. troops — offered $1 million.

Hallums noted that a successful rescue requires the work of many more people than the commandoes who carry out the raid.

The FBI, CIA and National Security Agency all work to gather information, data that is then turned over to military intelligence, where an operations officer devises a rescue plan.

“You hear about SEAL Team 6 but behind them there’s hundreds of people working to get information that they can take out and execute the rescue,” Hallums said.

Conducting a rescue involves life-and-death calculations. The teams must assess the risk of the raid, both to the military personnel and the hostages themselves.

In 2009, an Afghan translator kidnapped alongside a New York Times reporter was killed in a hail of bullets during a rescue attempt by British commandoes. Such deaths underscore the dangers of hostage rescues.

“You don’t want dead SEALs. That has a whole range of military and political ramifications,” said Jones, who has a book called “Hunting in the Shadows: The Pursuit of al Qa’ida since 9/11″ coming out in May. “You also don’t want dead hostages. Sometimes you get this stuff wrong, since you’re always dealing in probability.”

Jones said he lacks data to know if the number of hostage rescues is rising, but that special operations activities are increasing overall. The military at large is undergoing financial cutbacks, he noted, but the budget for special operations forces is intact.

Technology has improved the chances of success. Aerial drones can monitor guard activity and provide a layout of the location. Watching a pattern of life allows the military to make educated guesses about the chances for success.

But even with that advantage, Evans said no mission is guaranteed success. The Somali captors could have shot and killed the American and Danish hostages during last week’s raid if they had seen the SEALs coming, she said. That’s why most people try to reach a negotiated rescue — a ransom payment — instead.

But Hallums said even though hostage rescues are risky, sometimes they have to be done.

“There’s risk, but look at the risk I was in. I was going to be dead for sure — 100 percent,” he said. “So it’s better odds with them coming in to try and help you out. Because otherwise you have no chance.”