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.
dm6u4voY44gImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…