ADEN - Al-Qaeda militants in Yemen killed two hostages - an American and a South African - during a pre-dawn gunfight as US special forces came agonisingly near to springing them free during a rescue attempt.
American photojournalist Luke Somers and South African teacher Pierre Korkie were both shot but still alive as commandoes tried to rush them to safety, and later died of their wounds, US officials said.
US President Barack Obama accused the jihadists of "barbaric murder", after authorising the operation following the release of an Al-Qaeda video in which Somers pleaded for his life.
Vice President Joe Biden said US intelligence had worked "relentlessly" to free Somers and bemoaned: "We came so close." One of the hostages - it was not clear who - died en route to a naval ship off Yemen, the USS Makin Island, and the other on the operating table aboard the vessel, officials said.
The US commandoes dropped by helicopter in the dead of night 10 kilometres (six miles) from where Somers and Korkie were being held in the southeastern Yemeni province of Shabwa.
They made their way to the Al-Qaeda hideout by foot, but were discovered about 100 metres (yards) away.
A short but intense firefight - lasting five to 10 minutes - erupted, a senior US defence official said. At least five militants were believed killed during the firefight, and there were no casualties among the US personnel.
"When the element of surprise was lost, and a firefight ensued, we believe that is when (the hostages) were shot," the official, who was with US Defence Secretary Chuck Hagel in the Afghan capital Kabul, said.
'Despicable terrorist organisation'
Korkie's death came just a day before the 57-year-old was to be freed after more than a year in captivity, according to the charity that had negotiated his release.
British-born Somers, 33, had worked as a freelance photographer for the BBC and spent time at local newspapers, including the Yemen Times, before he was snatched off Sanaa's streets in September 2013.
Al-Qaeda in the Arabian Peninsula (AQAP) had threatened in a video Thursday to execute Somers and gave Washington three days to meet unspecified demands.
AQAP's threat followed the murder since August of five Western hostages by the Islamic State jihadist group, which controls parts of Syria and Iraq.
The senior US defence official said there were "good indications" AQAP had moved the deadline up and "were preparing to kill him... which is why we moved as fast as we could".
"It was either act now and take the risk, or let that deadline pass. And no one was willing to do that." Obama said that since Somers was abducted, Washington had been using "every tool at our disposal" to try to secure his release.
"Luke was a photojournalist who sought through his images to convey the lives of Yemenis to the outside world," the president added.
"He came to Yemen in peace and was held against his will and threatened by a despicable terrorist organisation.
"The callous disregard for Luke's life is more proof of the depths of AQAP's depravity."
'Home for Christmas'
In May 2013, Al-Qaeda seized Korkie and his wife Yolande, who was released in January. The couple had worked as teachers in Yemen for four years.
The Gift of Givers charity said logistical arrangements had already been put in place to fly Korkie out of Yemen on Sunday.
"The psychological and emotional devastation to Yolande and her family will be compounded by the knowledge that Pierre was to be released by Al-Qaeda tomorrow," it said on Saturday.
"Three days ago we told her 'Pierre will be home for Christmas'. We certainly did not mean it in the manner it has unfolded." Imtiaz Sooliman, head of the charity, said he had anticipated on Friday that the Americans, under family pressure after the AQAP video emerged, were going to act and that he feared Korkie would die in the operation.
"No one can be blamed for that; it is a hostage-taking, a crisis situation and each one works for his interests," he said.
A US State Department official said "we assessed that there were two hostages at this location", including Somers. "We did not know who the second hostage was." The United States has said American and Yemeni forces already tried unsuccessfully to rescue Somers last month.
Yemen's defence ministry said Al-Qaeda moved hostages, including Somers, a Briton and a South African, days before.
The Briton's whereabouts remain unknown.