KHARTOUM, Sudan — Around 2 a.m. Wednesday, elders in the Somali village of Galkayo said they began hearing an unusual sound: the whir of helicopters.

It was the culmination of a daring and risky mission by about two dozen members of the Navy Seals to rescue two hostages — an American aid worker and her Danish colleague — held by Somali pirates since October. The commandos had dropped down in parachutes under a cloak of darkness while 8,000 miles away President Obama was preparing to deliver his State of the Union address on Tuesday night. The commandos hiked two miles from where they landed, grabbed the hostages and flew them to safety.

For the American military, the mission was characterized by the same ruthless efficiency — and possibly good luck — as the raid on Osama bin Laden in May, which was carried out by commandos from the same elite unit. Nine Somali gunmen were killed; not a single member of the Seals was hurt.

One pirate from the area who seemed to have especially detailed information about the Seal raid said it involved “an electrical net-trap, flattened into the land,” which presumably was the parachute. “Then they started launching missiles,” said the pirate, who spoke by telephone and asked not to be identified.