The American soldiers stealthily approached their target, a compound which their intelligence sources on the ground - and possibly from surveillance drones - had described in detail and had been watching closely for days.
As the special forces moved in on the compound, however, there was a problem, American officials told the Wall Street Journal. The compound's defenders heard a sound, "maybe a dog bark". The Americans were just 100m away.
An AQAP fighter was seen entering the compound as the firefight between the American soldiers and the terrorists started. He was probably determined to ensure that, whatever the outcome of the raid, the hostages would not escape alive.
By the time US forces had overcome all resistance, Somers and Korkie were critically wounded.
The world has become used to helicopter-borne special forces missions. After Seal Team Six dispatched Osama bin Laden in Pakistan in May 2011, there was a sense that anything was possible.
It is one thing killing a target, however, and another to locate and safely extract well-guarded hostages, as the five British and American hostages beheaded by Isis (Islamic State) found to their cost.
A rescue attempt on their prison in the Syrian town of Raqqa proved fruitless because the hostages had been moved shortly before.
When US and Yemeni soldiers made an earlier attempt to free Somers, they rescued six Yemenis, a Saudi and an Ethiopian from a hideout in Yemen's eastern province of Hadramout. Seven al-Qaeda fighters were killed - but once again, the Western captives had been moved.
On Friday, the kidnappers issued a video statement by Somers saying he would be killed. "It's now been well over a year since I've been kidnapped in Sana'a [Yemen's capital]," he said. "I'm certain my life is in danger. So as I sit here now, I ask, if anything can be done, please let it be done."
In the video, Nasser bin Ali al-Ansi, the kidnappers' apparent leader, described the previous rescue mission as "President Barack Obama's latest foolish action".
He gave the US three days to meet his unspecified demands or "the American hostage held by us will meet his inevitable fate". Hence the urgency of the rescue mission.
Tragically, Korkie's family had been told he was about to be set free. His wife, Yolande, was released in January, according to the charity The Gift of the Givers, which was helping the couple kidnapped in May last year.
6 details on the rescue attempt
•US President Barack Obama and Defence Secretary Chuck Hagel approved the raid on Friday morning Washington time. Hagel, who was en route to Afghanistan, got frequent updates to his air force plane and officials in Washington were monitoring in real time.
•Commandos were thrown into action hours after approval. US officials said the mission was carried out by US forces, though Yemeni authorities were informed.
•The special forces flew in about 1am Yemen time, the dead of night - by tilt-rotor Osprey aircraft and were dropped off at a location 10km from where the hostages were being held in the southeastern province of Shabwa.
•The commandos made their way on foot across dry, hilly terrain to the al-Qaeda militants' hideout, but any hopes they had of using the cover of darkness to move stealthily in for the rescue were dashed when they were discovered about 100m from the compound.
•A short but intense firefight - lasting five to 10 minutes - erupted, during which the commandos killed at least five militants. There were no US casualties. The militants had the area well protected.
•When the special forces got to the two hostages in the latest rescue, both had been shot and were seriously hurt. The commandos spirited Luke Somers and Pierre Korkie away about 30 minutes after the firefight and back to the aircraft, where surgeons and medics tried to save them. However, one of the men died en route to a naval ship, the USS Makin Island, and the other died while on the operating table on board the vessel.