King and Weeks were kidnapped by gunmen wearing military uniforms in the heart of Kabul in August 2016.
Three ranking Taliban prisoners released by the Kabul government have been flown to Qatar for an expected swap for an American and an Australian hostage held by the insurgents since their abduction in 2016, Taliban officials said Tuesday.
By releasing two Westerners and 10 members of the Afghan security force, the Taliban are delivering captives that do not have the same strategic or security value as the three Taliban figures.
President Ghani also announced the release would be conditional and should pave the ground for face on face talks between government delegation and the Taliban to find negotiated settlement for the country's lingering crisis.
Mr Ghani said in a televised speech that the exchange aimed to "facilitate direct peace negotiations."
The American and Australian were exchanged with three insurgent leaders, including a key militant figure, Anas Haqqani.
The American University of Afghanistan confirmed the release of the two, saying that its "community shares the relief of the families of Kevin and Timothy, and we look forward to providing all the support we can to Kevin and Tim and their families".
Prime Minister Imran Khan welcomed the release. They had appeared in a proof-of-life video looking gaunt and disheveled in January 2017 requesting then-President-elect Donald Trump secure their release by agreeing to a deal.
Presidential spokesperson Sediq Sediqqi earlier said President Mohammad Ashraf Ghani phoned the Secretary of State of the United States Mike Pompeo and National Security Adviser Rober O'Brien on Monday night to review the steps necessary to implement President Ghani's recent decision to release the three high-level Taliban/Haqqani detainees. The two prisoners were forced to appear in a video that displayed them in poor condition and ask for a prisoner exchange to obtain their freedom.
Subsequently, US officials said that American forces had launched a rescue mission to free the two, but the captives were not found at the raided location.
The premier expressed hopes for better outcome of ongoing efforts of the worldwide community to bring peace in Afghanistan which will end the suffering of Afghan people. They include Paul Overby, who is believed held by the Taliban in Afghanistan, Jeffery Woodke, a missionary taken hostage in Niger by ISIS, and a third US citizen whose name and circumstances are not public.
"The U.S. officials reiterated their support for President Ghani's decision and committed to work closely together to respond to any possible Taliban violence in the event the group don't respond in good faith", Sediqi tweeted.