The only American prisoner of war from the Afghanistan war was freed by the Taliban during an exchange on Saturday.

Sgt. Bowe Bergdahl has been held captive by the Taliban for nearly five years, but Obama administration officials said that his freedom was arranged in exchange for five captured Taliban members, reports The New York Times.

The prisoners, who were being held at Guantanamo Bay, were handed over to Qatar officials for transfer. Though now freed, they will be kept in the country due to a yearlong travel ban.

American Special Operations forces met 18 Taliban members at the designated meeting point in Afghanistan mid-morning local time. The sergeant was said to be in good condition.

Though some aspects of Bergdahl's capture remain unknown, he was grabbed on June 30, 2009 in the Afghanistan province of Patika.

In a statement, President Barack Obama welcomed Bergdahl back home, saying, "I was honored to call his parents to express our joy that they can expect his safe return, mindful of their courage and sacrifice throughout this ordeal."

Obama also noted that some thanks for the return of the U.S. soldier belonged to the Amir of Qatar who was involved in brokering the deal between the United States and Taliban forces.