Five years a captive from the Afghanistan war, Sgt. Bowe Bergdahl is back in American hands, freed for five Guantanamo terrorism detainees in a swap stirring sharp debate in Washington over whether the U.S. should have negotiated with the Taliban over prisoners.

'It is like a diver going deep on a dive and he has to stage back up through recompression to get the nitrogen bubbles out of the system. If he comes up too fast, it could kill him.'- Bob Bergdahl, father of Bowe Bergdahl

U.S. officials said Sunday that Bergdahl's health and safety appeared in jeopardy, prompting rapid action to secure his release. Republicans said the deal could place U.S. troops in danger, especially if the freed detainees return to the fight — one called it "shocking." Arizona Senator John McCain said of the five detainees, "These are the hardest of the hard core."

Visiting troops in Afghanistan, Defence Secretary Chuck Hagel stepped forward at Bagram Air Field to thank the special operations forces who retrieved Bergdahl, who officials said was the only American prisoner of war still held by insurgents in that conflict. Gen. Joseph Dunford spoke of the excitement that spread through U.S. ranks when the sergeant's release was confirmed. "You almost got choked up," he said. "It was pretty extraordinary."

Tireless campaigners for their son's freedom, Bob and Jani Bergdahl thanked all who were behind the effort to retrieve him and said they cannot wait to welcome him home, adding they have not yet spoken to their son.

"There is reason for that, and that is because Bowe has been gone for so long, that it is going to be very difficult to come back," Bob said in Boise, Idaho, as residents in the sergeant's hometown of Hailey prepared for a homecoming celebration.

"Bowe is still very resilient. He has passed though all the check points with flying colors."

But he said the recovery process for his 28-year old son would take time.

"It is like a diver going deep on a dive and he has to stage back up through recompression to get the nitrogen bubbles out of the system. If he comes up too fast, it could kill him."

Jani addressed her comments to her son, saying she cannot wait to hold him in her arms again.

Captured Soldier

Sgt. Bowe Bergdahl was transferred to a military medical centre in Germany for treatment before he will travel to the United States. (The Associated Press)

"Right now so many people are in place to assist you in all the aspects of your recovery to full health. Trust them. It's OK. Give yourself all the time you need to recover and decompress. There is no hurry," she said.

The Taliban handed Bergdahl over to special operations forces in an area of eastern Afghanistan, near the Pakistani border, U.S. officials said. In a statement on its website, the Taliban put the location on the outskirts of Khost province.

Bergdahl, 28, was taken to Bagram Air Field for medical evaluations, then transferred to Landstuhl Regional Medical Center in Germany before he is reunited with his family in the U.S., probably at the San Antonio Military Medical Center, officials said.

Officials did not offer details about Bergdahl's health. National security adviser Susan Rice said he had lost considerable weight and faced an "acute" situation. Yet she said he appeared to be "in good physical condition" and "is said to be walking."

Deal may encourage more kidnappings

Questions persisted, too, about the circumstances of Bergdahl's capture; Hagel declined to comment on earlier reports that the sergeant had walked away from his unit, disillusioned with the war. Such matters "will be dealt with later," Hagel said.

Hagel was met with silence when he told troops in a Bagram hangar: "This is a happy day. We got one of our own back." It was unclear whether the absence of cheers and applause came from a reluctance to display emotion in front of the Pentagon chief or from any doubts among the troops about Bergdahl.

In weighing the swap, U.S. officials decided it could help the effort to reach reconciliation with the Taliban, which the U.S. sees as key to more security in Afghanistan. But they acknowledged the risk that the deal would embolden insurgents, perhaps encouraging them to grab U.S. troops or citizens as bargaining chips for the release of others in U.S. custody.

Captured Solider

U.S. Defence Secretary Chuck Hagel said of Saturday's operation that Bergdahl's 'safety and health were both in jeopardy, and in particular his health was deteriorating,' but that he was hopeful the prisoner exchange could lead to a breakthrough with the Taliban. (The Associated Press)

Republicans pressed that point. "Have we just put a price on other U.S. soldiers?" asked Senator Ted Cruz of Texas. "What does this tell terrorists, that if you capture a U.S. soldier, you can trade that soldier for five terrorists?"

President Barack Obama, joined in the Rose Garden on Saturday by the sergeant's parents, said the deal was struck because the U.S. "does not ever leave our men and women in uniform behind."

Also Saturday, the five detainees left Guantanamo aboard a U.S. military aircraft flying to Qatar, which served as go-between in the negotiations. They are to be banned from leaving Qatar for at least a year.

Among the five: a Taliban deputy intelligence minister, a former Taliban interior minister with ties to al-Qaeda leader Osama bin Laden and a figure linked by human rights monitors to mass killings of Shia Muslims in Afghanistan in 2000 and 2001.

Soldier has trouble speaking English

Administration officials and lawmakers pressed their points on the Sunday news shows. Republicans said the deal violated requirements that Congress be given 30 days' notice before any exchange of captives at Guantanamo.

Rice said "an urgent and an acute situation," which she did not specify, did not allow that time.

"We did not have 30 days to wait," she said. "And had we waited and lost him, I don't think anybody would have forgiven the United States government."

Bowe Bergdahl's parents

Sgt. Bowe Bergdahl’s parents, Bob and Jani Bergdahl, thanked all those who took part in their son's recovery. (Reuters)

Several dozen U.S. special operations forces, backed by multiple helicopters and surveillance aircraft, secured Bergdahl's transfer from about 18 Taliban members. He is believed to have been held by the Haqqani network since June 30, 2009. Haqqani operates in the Afghanistan-Pakistan border region and claims allegiance to the Afghan Taliban but operates with some degree of autonomy.

"I'm going to celebrate him coming home," said Representative Adam Kinzinger of Illinois. But the release of "five mid- to high-level Taliban is shocking to me, especially without coming to Congress."

As they stood with Obama in the Rose Garden, Bob Bergdahl said his son was having trouble speaking English after his release, although the family had not talked with him directly. The elder Bergdahl, who grew a long, thick beard to honour his son, had worked to learn Pashto, the language spoken by his son's captors, and delivered a message to him and the people of Afghanistan in that language.

Switching back to English, he said "the complicated nature of this recovery will never really be comprehended."

Murky circumstances

The circumstances surrounding Bergdahl's capture remain murky.

In 2012, Rolling Stone magazine quoted emails Bergdahl is said to have sent to his parents that suggest he was disillusioned with America's mission in Afghanistan, had lost faith in the U.S. Army and was considering desertion. Bergdahl told his parents he was "ashamed to even be American." The Associated Press could not independently authenticate the emails.

Hagel brushed aside such questions for now.

"Our first priority is assuring his well-being and his health and getting him reunited with his family," Hagel said. A senior U.S. official told The Associated Press that the Army would make the decision on any charges but the feeling at the moment was that Bergdahl had suffered enough. All the officials who discussed details of Bergdahl's transfer insisted on anonymity because they were not authorized to be identified.

The U.S. has long sought Bergdahl's release, but there was renewed interest in his case as Obama completed plans to pull nearly all U.S. forces out of Afghanistan by the end of 2016.

Officials said the Taliban signalled to the U.S. in November that they were ready to start fresh talks on the issue of detainees. After the U.S. received proof that Bergdahl was alive, indirect talks began, with Qatar sending messages back and forth.

With files from Reuters