The Taliban says it has freed two hostages in a swap for the release of three of its commanders.
Kevin King, from the US, and Timothy Weeks, from Australia, were released hours after the Afghan government freed three Taliban commanders and sent them to Qatar.
Taliban officials said Mr King and Mr Weeks, both professors at the American University of Kabul, were freed in the Now Bahar district in Zabul in southern Afghanistan.
The region is largely under the terror group’s control.
It is not known whether the professors were handed over to Afghan government representatives, intermediaries, or US forces.
The three released Taliban prisoners included Anas Haqqani, the younger brother of the Taliban’s deputy leader Sirajuddin Haqqani, who also leads the fearsome Haqqani network.
It appears the Taliban had refused to hand over the two professors until they received proof their men had reached Qatar.
Officials from the terror group had said the exchange would likely take place on Tuesday.
They added three of their members arrived in the Gulf Arab state of Qatar on Monday.
The officials spoke on condition of anonymity because they were not authorised to speak to the media.
Afghan President Ashraf Ghani announced the “conditional release” of the three Taliban commanders a week ago, saying it was a very hard decision but it was in the interests of the Afghan people.
Mr King and Mr Weeks were abducted outside the American University in Kabul in 2016.
The Taliban released two videos showing the captives the following year.
Footage showed them appearing pale and gaunt in January 2017.
Mr King and Mr Weeks looked healthier in the second video, and said a deadline for their release was set for 16 June 2017.
Both said they were being treated well by the Taliban but appealed to their governments to help set them free.
It was impossible to know whether they were forced to speak.
US officials subsequently announced they had launched a rescue mission to free the pair, but they were not found at the raided location.
US Secretary of State Mike Pompeo and US National Security Adviser Robert O’Brien made separate calls to Mr Ghani on Monday to discuss the prisoners’ release, the Afghan president’s spokesman said.
The release and swap were intended to try to restart talks to end Afghanistan’s 18-year war and allow for the eventual withdrawal of US troops from Afghanistan.
The White House had been close to an agreement with the Taliban in September, but a fresh wave of violence in the Afghan capital that killed a US soldier brought talks to a halt.
The agreement called for direct talks between the Taliban and Afghan government, as well as other prominent Afghans, to find a negotiated end to the war and set out a roadmap for what a post-war Afghanistan would look like.
Mr Ghani said in his discussions with Mr Pompeo and Mr O’Brien that he wanted a reduction in violence and an all-out ceasefire, his spokesman said.
Mr Pompeo told Mr Ghani the United States was “committed to work closely together to address violence if the president’s decision does not produce the intended results”, according to a US State Department statement on Tuesday.