When U.S. military commandos landed in Somalia on their dramatic rescue mission, it was early Tuesday evening in Washington. By the time President Obama entered the Capitol for his State of the Union speech at 9 p.m., nine kidnappers already had been killed, two hostages had been recovered and the American forces were largely safe.

As he walked into the chamber to deliver the address, Obama pointed at Panetta, who had been monitoring the raid from the White House, and congratulated him. “Good job tonight,” the president said.

The U.S. rescue force, including about two dozen troops, was drawn primarily from the Navy special operations unit that is commonly known as SEAL Team Six, the service’s elite counter-terrorism force. The same team carried out the raid that killed Osama bin Laden, but Pentagon officials said that the commandos involved in Wednesday’s mission were not the same as those involved in the bin Laden operation in May.

Hostage rescue has for decades been one of the primary missions of America’s counter-terrorism forces. But the rescue in Somalia was unusual in the demands it placed on U.S. forces and the distances it forced them to travel.

The SEALs were flown by Air Force special operations planes into Somalia and parachuted into an area about two miles from the compound where Jessica Buchanan, an American aid worker, was being held with a Danish man, Poul Hagen Thisted. The SEALs then walked through the dark to the rescue site.

The SEALs, who were prepared to take prisoners, killed nine of the kidnappers at the site, said Pentagon officials. None of the U.S. troops or hostages was wounded in the operation, and no prisoners were taken. Pentagon officials said that the kidnappers were all heavily armed and had explosives nearby. The American troops and the two hostages, held since October, left the rescue site on helicopters.

U.S. officials said the daring night-time raid reflected the lessons the military has learned and the experience it has gleaned over the last decade of combat 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,” said a senior defense official, speaking on the condition of anonymity to discuss the raid. “It is a reflection of the kinds of counter-terrorism skills that we have nearly perfected over the last decade of war.”