Jessica Buchanan and Poul Hagen Thisted, two aid workers, were freed from Somalia after a raid by U.S. special operations forces. (AP)

U.S. Special Operations forces rescued an American hostage and her Danish colleague in Somalia early Wednesday in the kind of daring raid that the Obama administration has said will be the hallmark of future U.S. military missions.

Officials said the raid, by members of the Navy SEAL Team 6 unit that killed Osama bin Laden in May, demonstrated President Obama’s focus on the narrow, targeted use of force after a decade of large-scale military deployments.

The mission is “yet another message to the world that the United States of America will stand strongly against any threats to our people,” Obama said in a statement Wednesday morning.

Jessica Buchanan, 32, and Poul Hagen Thisted, 60, employees of a Danish aid agency, had been held for three months by armed men near the town of Adado in north-central Somalia.

About a dozen SEALs parachuted from an Air Force Special Operations plane to a spot two miles from the compound where the hostages were being held, Pentagon officials said. The commandos walked through the darkness and surprised the captors, killing at least eight of them before Buchanan and Thisted were taken away in helicopters, officials said.

News of the rescue reached Obama on Tuesday evening Washington time, just before he headed to the Capitol to deliver his State of the Union address. Unknowing listeners heard him say “Good job tonight” to Defense Secretary Leon E. Panetta as he passed through the chamber on his way to the podium.

A senior administration official, speaking on the condition of anonymity to provide details beyond Obama’s public statement, said that although the mission had been under consideration for weeks, the president decided Monday to proceed based on three factors.

The first, the official said, was “a window of opportunity,” along with intelligence indications that the captives might be moved. “You don’t know if you’re going to have another chance,” the official said.

Much of Somalia, where the al-Shabab militant group is said to be allied with al-Qaeda, is kept under close U.S. surveillance, with intelligence gathered overhead and on the ground. U.S. officials said there was no evidence that the hostage-takers had any connection to the militants.

The second factor was a lack of progress in “other means” being undertaken to secure their release, the official said. Hostage-taking, whether by pirates at sea or by land-based criminal gangs, is an increasingly lucrative enterprise in lawless Somalia.

Many captives have been set free after their families or companies paid ransom. Buchanan’s captors had initially demanded about $10 million for the hostages and recently refused an offer of more than $1 million.

The third and perhaps deciding factor in the rescue operation was Buchanan’s “deteriorating health,” the official said. The Somalia Report news agency reported in November that the captors had brought in a physician to examine Buchanan for a kidney ailment. U.S. officials, who cited privacy concerns in declining to discuss her condition, did not dispute that report.

The quick, targeted raid by elite commandos represented the sort of military action that the Obama administration touted in its recent defense strategy review and the president extolled in his State of the Union address.

But a mission against lightly armed and poorly trained criminals in a largely lawless region of Somalia may not provide a useful model in parts of the world where modern militaries make such actions far more complex and potentially deadly.

Although officials denied any political concerns in approving the raid, the operation did serve as a counterweight to charges by Republican presidential contenders that Obama is weak and indecisive.

Hostage rescue has been one of the primary missions of Special Operations forces for decades, but officials said that this mission drew on the lessons learned and skills perfected over the past decade of combat and counterterrorism operations in Iraq and Afghanistan.

“I don’t know that there is a nation that could pull this thing off with the speed, precision and stealth that these forces did,” a senior defense official said, speaking on the condition of anonymity.

In Afghanistan’s Kunar province, Linda Norgrove, a kidnapped British aid worker, was killed by friendly fire during a rescue attempt by Special Forces in October 2010.

On Wednesday, a Somali working for an international aid agency in Galkayo, a major city in the region, said that he saw two American airplanes and 11 helicopters Tuesday night at the airport there, and that he heard helicopters in the early morning.

The SEALs were prepared to take prisoners but did not, Pentagon officials said. Although the kidnappers were said to be heavily armed, with explosives nearby, the team had no casualties and left nine kidnappers dead at the site before leaving by helicopter, U.S. officials said. The rescued hostages were flown to a U.S. air base in nearby Djibouti.

Somali clan elders and community leaders in Galkayo gave a slightly different account. They said eight kidnappers were killed, including two brothers, and a ninth was seriously injured and taken to Adado for medical treatment.

Somali pirates are part of large criminal and clan networks and strike whenever there’s an opportunity. With the U.S. and other governments beefing up patrols and seeking sea-going pirates, some have turned their focus to kidnapping foreigners for ransom on land. The pirates can hold hostages in safe areas, under the protection of their clans, for months until a ransom is paid.

Buchanan, who is originally from Ohio, and Thisted worked for the Danish Refugee Council, which provides aid for displaced Somalis in Mogadishu. They were part of the council’s Danish Demining Group when they were captured in late October near Galkayo. The group for decades has cleared unexploded ordnance and land mines that are spread across Somalia from countless wars.

A council spokesperson declined to discuss Buchanan’s medical condition but said that neither of the freed hostages was hospitalized.

Buchanan went to high school in Springboro, Ohio, and attended Valley Forge Christian College in Phoenixville, Pa. She first traveled to Africa as an undergraduate, Valley Forge President Don Meyer told CNN, and later became a full-time teacher at the Rosslyn Academy, a private Christian school in Nairobi.

Rob Beyer, dean of students at Valley Forge, said Buchanan met her husband in Nairobi.

The Danish council said that Buchanan has worked for its mine-clearance unit since May 2010. Thisted, a community safety manager with the unit, has been with the organization since 2009.

Obama telephoned Buchanan’s father shortly after the speech to tell him that his daughter had been rescued, administration officials said.

Staff writers Sudarsan Raghavan in Nairobi and Debbi Wilgoren and Julie Tate in Washington contributed to this report.