Taliban fighters released the sole remaining American military hostage Saturday morning to a team of U.S. troops in eastern Afghanistan, who quickly hustled him onto a helicopter. Once airborne, Sgt. Bowe Bergdahl scribbled the letters “SF?” on a paper plate, seeking confirmation that he was with Special Operations forces.

“Yes!” one of the troops hollered back above the din of the aircraft’s blades, according to a defense official who described his first moments of freedom. “We’ve been looking for you for a long time.”

Bergdahl, 28, who had been held captive nearly five years, broke down in tears.

His release was secured after the Obama administration, working through Qatari government intermediaries, agreed to free five high-profile Afghan inmates held by the U.S. military in Guantanamo Bay, Cuba. The influential commanders, including the former head of the Taliban’s army, were loaded onto a U.S. military aircraft bound for Doha in Qatar after U.S. officials got confirmation that Bergdahl had been freed.

President Obama hailed Bergdahl’s recovery as a triumph of years of high-wire diplomatic efforts that reached a breakthrough in the waning months of the U.S. combat mission there.

“He wasn’t forgotten by his country,” Obama said Saturday evening in the Rose Garden, standing alongside Bergdahl’s parents, Robert and Jani. “The United States of America does not ever leave our men and women in uniform behind.”

His father, who has grown the type of scraggly beard favored by members of the Taliban, said a few words to his son in Pashto, the language spoken in southern Afghanistan, saying that he understood his son is having trouble speaking English.

“I am your father, Bowe,” Robert Bergdahl said. “I look forward to continuing the recovery of our son which will be a considerable task for our family.”

While leaders across the political spectrum expressed relief at the news, prominent Republican lawmakers chided the White House for skirting a legal requirement to notify them about the planned release of Guantanamo inmates. Some criticized the president for breaking with longtime U.S. policy against negotiating with militant groups.

“This fundamental shift in U.S. policy signals to terrorists around the world a greater incentive to take US hostages,” Rep. Mike Rogers, R-Mich., the chairman of the House Intelligence Committee, said in a statement.

Bergdahl’s release at 10:30 a.m. in Khost province, which borders Pakistan, capped a week of intense, secret negotiations conducted through the Qataris. A team of dozens of Special Operations forces took custody of Bergdahl from a group of 18 Taliban fighters. The rare encounter on the battlefield between warriors that have spent years killing one another lasted just a few minutes and was peaceful, U.S. officials said.

Bergdahl walked onto the aircraft, U.S. officials said, suggesting he is in relatively stable health. Officials said it was too early to know anything definitive about the mental state of a soldier who bewildered his comrades after he walked off base in volatile Paktika province on June 30, 2009.

Officials at the Pentagon, who had grown concerned that the end of the U.S. combat mission in Afghanistan at the end of the year would dim the prospect of getting Bergdahl back alive, rejoiced.

“It is our ethos that we never leave a fallen comrade,” Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff, said in a statement. “Today we have back in our ranks the only remaining captured soldier from our conflicts in Iraq and Afghanistan. Welcome home Sgt. Bowe Bergdahl.”

There was no indication that the soldier would face any reprimand for the circumstances under which he was taken, which led some of his comrades to call him a deserter. While it is unclear whether he will remain on active duty, a senior U.S. military official said the Army plans to promote Bergdahl to staff sergeant next month.

“I can’t imagine there would be repercussions,” said the official, who was among several who would speak about the case only on the condition of anonymity.

Defense officials said they were working to get Bergdahl to the United States as soon as possible. After passing through Bagram air base in Afghanistan, Bergdahl was en route to the U.S military hospital in Landstuhl, Germany, according to Pentagon officials traveling with Defense Secretary Chuck Hagel.

They said his first U.S. stop would likely be the Brooke Army Medical Center in San Antonio, where after a thorough medical screening he will likely be debriefed by intelligence officials.

The released inmates include Mullah Mohammad Fazl, a former Taliban deputy defense minister. U.S. officials said that under a memorandum of understanding signed by Washington and Doha, the men will be subject to a year-long travel ban in Qatar. They declined to offer more details about any restrictions the men would face but expressed confidence that their release would not put Americans in harm’s way.

“The United States has coordinated closely with Qatar to ensure that security measures are in place and the national security of the United States will not be compromised,” Hagel said in a statement from Singapore, where he was attending a security conference. “Sgt. Bergdahl’s return is a powerful reminder of the enduring, sacred commitment our nation makes to all those who serve in uniform.”

Hagel informed members of Congress on Saturday about the prisoner swap deal. The administration is required by law to notify Congress about its intention to release Guantanamo detainees 30 days in advance.

“Due to a near-term opportunity to save Sergeant Bergdahl’s life, we moved as quickly as possible,” a senior administration official said, speaking on the condition of anonymity to explain the timing of the congressional notification. “The administration determined that given these unique and exigent circumstances, such a transfer should go forward notwithstanding the notice requirement” in the law.

The Obama administration began seriously exploring the possibility of negotiating Bergdahl’s release in late 2011, when secret talks between U.S. diplomats and members of the Taliban appeared to be gaining traction. The talks collapsed in March 2012 when the Taliban suspended them. Last summer, when the Taliban was allowed to open a political office in the Qatari capital, American officials grew hopeful that prisoner swap negotiations could resume. The effort foundered just hours after the office formally opened after the Afghan government protested that the Taliban had been given de-facto diplomatic status.

Unexpectedly, representatives of the Taliban conveyed to U.S. officials last fall that they were once again amenable to discussing the release of Bergdahl, but set as a condition that they would only deal with Washington through intermediaries, American officials said.