Afghanistan's Taliban have freed US engineer Mark Frerichs in exchange for an Afghan tribal leader linked to the Taliban who the United States had held on drugs charges since 2005, the group's acting foreign minister says.
Frerichs was exchanged at the airport in the capital Kabul with Bashir Noorzai, acting foreign minister Amir Khan Muttaqi told a news conference in the city.
Noorzai was detained by the United States on suspicion of smuggling more than $US50 million ($A75 million) worth of heroin into the United States and Europe.
"The Islamic Emirate of Afghanistan is ready to solve problems by negotiation with all including the United States," Muttaqi said, referring to the Taliban.
Frerichs is an engineer and US navy veteran from Lombard, Illinois, who worked in Afghanistan for a decade on development projects.
He was abducted in February 2020.
A senior US administration official who declined to be named confirmed the release of both men.
"I can confirm that we have secured Mark Frerichs' release and that President (Joe) Biden called Mark's family this morning to share the good news," the official said.
"In order to bring home a US citizen and reunite him with his family, the president made the difficult decision to grant clemency to Haji Bashir Noorzai after he spent 17 years in US government custody," the official added.
The United States has been pushing for the release of Frerichs, including after the Taliban took over Afghanistan in August 2021, as US-led foreign forces were withdrawing.
The administration official said it had been a "top priority" for Biden.
US officials have said that his case would influence their view on the legitimacy of a Taliban-led government.
No foreign government has formally recognised the Taliban, in part due to the group's restriction of most secondary school-aged girls from education.
Noorzai briefly addressed the news conference at a Kabul hotel alongside Muttaqi and the Taliban's acting deputy prime ministers.
"I am proud to be in the capital of my country among my brothers," Noorzai said.
The tribal leader had longstanding ties to the Taliban.
Noorzai's lawyer had denied that his client was a drug dealer and argued that the charges should be dismissed because US government officials duped him into believing he would not be arrested.