Sergeant Bowe Bergdahl, 28, was handed to US forces after being held for nearly five years by the Taliban.
He has left Afghanistan and is en route to a US military hospital in Germany.
Five Afghan detainees were released from the US prison in Cuba and handed to Qatar, which mediated the deal.
Sgt. Bowe Bergdahl, who is said to be in good condition, was the only US soldier being held by the Taliban in Afghanistan.
His parents said they were “joyful and relieved” to hear of their son’s release.
Hours after the release, President Barack Obama told reporters the Qatari government had given the US assurances “that it will put in place measures to protect our national security”.
He also thanked the Qatari authorities for their role in acting as a go-between during indirect US-Taliban negotiations that led to the deal.
The exchanged prisoners are thought to be the most senior Afghans still held at Guantanamo. Under the deal, they will be banned from leaving Qatar for at least a year.
The Taliban said they welcomed their release with “great happiness”.
“While Sgt. Bergdahl was gone he was never forgotten,” Barack Obama said, adding that the US had an “ironclad commitment” to bringing home its prisoners of war.
He was joined by Sgt. Bowe Bergdahl’s parents, Robert and Jani, at the White House on Saturday. They offered thanks to those who took part in securing their son’s freedom.
In an emotional speech, Robert Bergdahl said his son was having trouble speaking English after his rescue.
Officials said the Taliban had handed Sgt. Bowe Bergdahl over on Saturday evening, local time, in eastern Afghanistan, in an exchange that involved several dozen US special forces.
Bowe Bergdahl, of Hailey, Idaho, was captured on June 30 2009, about two months after arriving in eastern Afghanistan.
In January, the US military obtained a new video of Sgt. Bowe Bergdahl, giving his family renewed hope of his eventual return.
dm6u4voY44gThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…