The last US prisoner of war held in Afghanistan was handed over to US Special Operations forces on Saturday, in a dramatic swap for five Taliban detainees who were released from Guantanamo Bay prison and flown to Qatar.

Army Sergeant Bowe Bergdahl had been held for nearly five years by Afghan militants and his release, following years of on-and-off negotiations, suddenly became possible after harder-line factions of the Afghan Taliban apparently shifted course and agreed to back it, according to US officials.

Bergdahl (28) was handed over about 6pm local time on Saturday, a senior official said. The US forces, who had flown in by helicopter, were on the ground very briefly, said the officials, who would not specify the precise location of the handover.

A US defense official said Bergdahl was able to walk and became emotional on his way to freedom.
“Once he was on the helicopter, he wrote on a paper plate, ‘SF?’” the official said, referring to the abbreviation for special forces.

“The operators replied loudly: ‘Yes, we’ve been looking for you for a long time.’ And at this point, Sergeant Bergdahl broke down.”

President Barack Obama hailed the release in a brief appearance with Bergdahl’s parents, Bob and Jani, in the White House Rose Garden, saying that “while Bowe was gone, he was never forgotten”.

Bergdahl was on his way to an American military hospital in Germany, a US defence official said. Another defence official said it was expected that after treatment in Germany he would be transferred to a military medical facility in San Antonio, Texas.

US special forces took custody of Bergdahl in a non-violent exchange with 18 Taliban members in eastern Afghanistan, senior US officials said, adding that he was believed to be in good condition. Before leaving for Germany, he received medical care at Bagram Air Base, the main US base in Afghanistan.

Within hours of his release, a second US defence official said the five Taliban detainees, now formally in Qatari custody, had departed the Guantanamo prison. They were aboard a US military C-17 aircraft and en route to the Gulf emirate.

The prisoner swap comes as America is winding down its long war in Afghanistan, and raises the question of whether this could lead to broader peace talks between the Taliban and the Afghan government for a negotiated end to the conflict.

“We do hope that having succeeded in this narrow but important step, it will create the possibility of expanding the dialogue to other issues. But we don’t have any promises to that effect,” said one senior US official deeply involved in the diplomacy.

Tough recovery processBergdahl, who is from Idaho, was the only known missing US soldier in the Afghan war that was launched soon after the September 11 2001 attacks on the US to force the Taliban – accused of sheltering al-Qaeda militants – from power.

He was captured under unknown circumstances in eastern Afghanistan by militants on June 30 2009, about two months after arriving in the country.

His recovery after long years in captivity could be difficult. At the White House, Bergdahl’s father began his words speaking a Muslim prayer and said his son was having difficulty speaking English. He asked for patience from the media as the family helped him re-adjust.

A US defence official said Bergdahl would continue treatment at Landstuhl Regional Medical Center in Germany, including the start of his “reintegration process. That includes time for him to tell his story, decompress, and to reconnect with his family through telephone calls and video conferences,” the official said.

Bergdahl’s release could be a national security boost for Obama, whose foreign policy has been widely criticised in recent months.

But some members of Congress have worried in the past over the potential release of the five Taliban detainees, particularly Mohammed Fazl, a “high-risk” detainee held at Guantanamo since early 2002. Fazl is alleged to be responsible for the killing of thousands of Afghanistan’s minority Shi’ite Muslims between 1998 and 2001.

A US defence official, speaking on condition of anonymity, identified the five men as Fazl, Mullah Norullah Noori, Mohammed Nabi, Khairullah Khairkhwa and Abdul Haq Wasiq. Pentagon documents released by the WikiLeaks organisation said all five were sent to Guantanamo in 2002, the year the detention facility opened. They were classified as “high-risk” detainees “likely to pose a threat” to the United States, its interests and allies.

US officials referred to the release of the Taliban detainees as a transfer and noted they would be subject to certain restrictions in Qatar. One of the officials said that would include a minimum one-year ban on them traveling outside of Qatar as well as monitoring of their activities.

Bergdahl’s freedom followed a renewed round of indirect US-Taliban talks in recent months, with Qatar acting as intermediary, the officials said.

The US had been trying diplomacy to free Bergdahl since late 2010, but talks had been complicated, US officials said, by an internal split between Taliban factions willing to talk to Americans and those staunchly opposed.

The swap also comes days after Obama said he would keep 9 800 US troops in Afghanistan, mostly to train Afghan forces, after Nato combat operations end at the end of 2014. The last soldiers, aside from a small presence at US diplomatic posts, will leave at the end of 2016.

A US official said he did not think there was a link with the announcement on Tuesday of the troop withdrawal timetable.

“This discussion predates the decision on troops,” he said. “This is just a matter of things coming together with the help of the Qataris and the Taliban realising that we were serious.”

CelebrationsThe Bergdahl family was in Washington, DC, when informed by Obama of the release. The parents said in a statement they were “joyful and relieved”, adding: “We cannot wait to wrap our arms around our only son.”

Bergdahl’s hometown of Hailey, Idaho, also began celebrating.

“Once we heard about it. We were pretty excited,” said 17-year-old Real Weatherly, who was making signs on Saturday and blowing up balloons to hang outside the shop where she works.

The Afghan Taliban confirmed on Saturday it had freed Bergdahl. “This is true. After several rounds of talks for prisoners’ swap, we freed US soldier and our dear guest in exchange of five commanders held in Guantanamo Bay since 2002,” a senior Taliban commander said.

The Taliban commander said Bergdahl had mostly been held in the tribal areas between Pakistan and Afghanistan after what he termed his “dramatic” kidnapping from Afghanistan’s Paktika province in June 2009.

Reuters first reported the potential deal involving the five Taliban detainees in December 2011.

While US and Taliban envoys have met directly in the past, there were no direct US-Taliban contacts during the most recent negotiations, US officials said. Messages were passed via Qatari officials.

The final stage of negotiations, which took place in the Qatari capital, Doha, began one week ago, the US officials said. Obama and Qatar’s emir spoke on Tuesday and reaffirmed the security conditions under which the Taliban members would be placed, they said. – Reuters