WASHINGTON -- Nearly five years after his capture by insurgents, Sgt. Bowe Bergdahl climbed into an American helicopter. He took out a pen and wrote on a paper plate, "SF?" -- asking the troops who had come to find him in eastern Afghanistan if they were U.S. special operations forces.
Over the roar of the rotors, one of them shouted to Bergdhal: "Yes, we've been looking for you for a long time."
The only American prisoner of the Afghan war, Bergdahl broke down in tears.
The emotional moment was described by a defense official, one of several U.S. officials who detailed Bergdahl's release Saturday. In exchange for the 28-year-old American, President Barack Obama agreed to release five high-level Afghan detainees from the U.S. prison at Guantanamo Bay, Cuba.
"While Bowe was gone, he was never forgotten," Obama said in a statement from the White House Rose Garden, where he was joined by Bergdahl's parents. "The United States of America does not ever leave our men and women in uniform behind."
Two top Republican lawmakers said that Obama violated U.S. laws when he approved the exchange.
Rep. Howard "Buck" McKeon of California and Sen. James Inhofe of Oklahoma said the law required Obama to notify Congress 30 days before any transfer of terrorists from Guantanamo. In response, the White House said that officials considered what they called "unique and exigent circumstances" and decided to go ahead with the transfer in spite of the legal requirement.
Secretary of Defense Chuck Hagel said the operation to free Bergdahl was not relayed to Congress because officials believed the soldier's life was in danger and the military had to move quickly to get him safely out of Afghanistan.
In his first extensive public comments about Saturday's operation, Hagel, who was traveling to Afghanistan to meet with U.S. troops, said intelligence the U.S. had gathered suggested that Bergdahl's "safety and health were both in jeopardy, and in particular his health was deteriorating."
At Bagram Air Field, Hagel met Sunday with about a dozen of the special operations forces that participated in the rescue and thanked them for their work.
Gen. Joseph Dunford said there was a sense of excitement in the headquarters as the news spread
"You almost got choked up," he said. "It was pretty extraordinary. It has been almost five years and he is home."
Bergdahl's parents, Bob and Jani, led a tireless campaign to keep their son's story in the public eye. They were expected to hold a news conference Sunday in their hometown of Hailey, Idaho, where residents were planning a homecoming celebration for the soldier.
Bergdahl, in good condition and able to walk, was handed over to U.S. special operations forces by the Taliban 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.
The handover followed indirect negotiations between the U.S. and the Taliban, with the government of Qatar serving as the go-between. Qatar is taking custody of the five Afghan detainees who were held at Guantanamo.
Some U.S. officials said this type of exchange is somewhat unprecedented during the last 13 years of war in Iraq and Afghanistan. In weighing the swap, U.S. officials decided that it could help further the effort to reach reconciliation with the Taliban, something the U.S. sees as key to reaching a level of security in Afghanistan.
But they acknowledged that there was a risk of emboldening other insurgent groups who might grab U.S. troops or citizens in an effort the secure the release of others prisoners.
Several dozen U.S. special operations forces, backed by multiple helicopters and surveillance aircraft, were involved in securing Bergdahl's transfer that evening from about 18 Taliban members. Officials said the commandos were on the ground for a short time before lifting off with Bergdahl.
Bergdahl 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.
The U.S. believes Bergdahl was held for the bulk of his captivity in Pakistan, but officials said it was not clear when he was transported to eastern Afghanistan.
Officials said Bergdahl was taken to Bagram Air Field, the main U.S. base in Afghanistan, for medical evaluations, then transferred to Landstuhl Regional Medical Center, a military facility in Germany, before he's returned to the U.S. An official said Bergdhal was tentatively scheduled to go to the San Antonio Military Medical Center where he would be reunited with his family.
Bergdahl's parents had been in Washington on a previously planned visit when they received a call Saturday from Obama informing them that their son had been freed.
As they stood with Obama in the Rose Garden hours after their son's release, Bob Bergdahl, who grew a long, thick beard to honor his son, said Bowe Bergdahl was having trouble speaking English after his rescue. The elder Bergdahl had worked to learn Pashto, the language spoken by his son's captors, and delivered a message to him in that language.
Switching back to English, the elder Bergdahl said "the complicated nature of this recovery will never really be comprehended."
The circumstances surrounding Bergdahl's capture remain murky. There has been some speculation that he willingly walked away from his unit, raising the question of whether he could be charged with being absent without leave or desertion.
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, speaking with reporters traveling with him in Asia, declined to say whether he believes Bergdahl was attempting to desert the Army or go AWOL when he walked away from his unit and disappeared.
"Our first priority is assuring his well-being and his health and getting him reunited with his family," Hagel said. "Other circumstances that may develop and questions -- those will be dealt with later."
A senior U.S. official told The Associated Press that the Army would make the decision on any charges but that the feeling at the moment was that Bergdahl had suffered enough in his ordeal. 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 been seeking Bergdahl's release, but there was renewed interest in his case as Obama finalized plans to pull nearly all American forces out of Afghanistan by the end of 2016.
Officials said the Taliban signaled 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 still alive, indirect talks began, with Qatar sending messages back and forth between the two parties. The talks intensified about a week ago, officials said.
The five Guantanamo detainees departed the base on a U.S. military aircraft Saturday afternoon. Under the conditions of their release, they will be banned from traveling outside of Qatar for at least one year.
Obama and the emir of Qatar spoke last week about the conditions of the release, which have been codified in a memorandum of understanding between the two countries, officials said.
The detainees were among the most senior Afghans still held at the prison:
-- Abdul Haq Wasiq, who served as the Taliban deputy minister of intelligence
-- Mullah Norullah Nori, a senior Taliban commander in the northern city of Mazar-e-Sharif when the Taliban fought U.S. forces in late 2001
-- Khairullah Khairkhwa, who served in various Taliban positions including interior minister and had direct ties to Mullah Omar and Osama bin Laden
-- Mohammed Nabi, who served as chief of security for the Taliban in Qalat, Afghanistan, and later worked as a radio operator for the Taliban's communications office in Kabul
-- Mohammad Fazl, whom Human Rights Watch says could be prosecuted for war crimes for presiding over the mass killing of Shiite Muslims in Afghanistan in 2000 and 2001 as the Taliban sought to consolidate their control over the country.
In a statement on the Taliban website that was translated by the Washington-based SITE Intelligence Group, the Taliban announced the exchange with "great happiness and joy" and said it "was and has been for a long time attempting to free all the imprisoned Afghan prisoners inside and outside the country, and restoring the right of freedom to them quickly."
The Taliban said it was seeking the release of additional prisoners but offered no specifics. It also said the five freed detainees would be received by members of its political office in Qatar. That office was reportedly closed last year after a dispute with Afghan President Hamid Karzai, and its role in the exchange may be an indication that it is functioning.
In Pakistan, Foreign Ministry spokeswoman Tasnim Aslam said her government was "not aware of" Bergdahl's release or the negotiations leading up to it. She declined to comment further.
-- Baldor reported from Singapore. Associated Press writers Deb Riechmann and Darlene Superville in Washington; Rahim Faiez in Kabul, Afghanistan; and Zarar Khan in Islamabad contributed to this report.