The Taliban said they exchanged American engineer Mark Frerichs in exchange for the United States freeing a senior Taliban figure on Monday.
"Today, Mark Frerichs was handed over to the US, and Haji Bashar was handed over to us at Kabul airport," Taliban government's Foreign Minister Amir Khan Muttaqi told a press conference in the capital.
Muttaqi said the exchange happened "after long negotiations."
Hours after the Taliban statement, Frerichs's family confirmed he was freed.
The US Navy veteran was working in Afghanistan as a civil engineer on construction projects when he was taken hostage in January 2020.
The US has been pushing for the release of Frerichs after the Taliban takeover of Afghanistan.
There was no independent confirmation or word from Washington on Frerichs' release.
Taliban drug kingpin released
Meanwhile, Bashir Noorzai, an Afghan tribal leader, was arrested in 2005 and charged with smuggling more than $50 million worth of heroin into the US.
He was convicted and sentenced to life in prison on heroin importation and distribution conspiracy charges.
Noorzai briefly addressed the news conference at a Kabul hotel, alongside Muttaqi. "I am proud to be in the capital of my country among my brothers," he said.
Another Taliban spokesman, Zabihullah Mujahid, told the AFP news agency that Noorzai held no official position in the Taliban but "provided strong support including weapons" as the hardline Islamist movement emerged in the 1990s.