The two men were abducted outside the American University of Afghanistan in Kabul, where they worked as teachers.
Afghanistan will release two senior Taliban commanders and a leader of the Haqqani group in exchange for an American and an Australian professor who were kidnapped in 2016, Afghan President Ashraf Ghani said on Tuesday.
The two men – an American identified as Kevin King and an Australian man identified as Timothy Weekes – were abducted outside the American University in Kabul in 2016.
The decision to free top commander Anas Haqqani and two other Taliban commanders in a prisoner swap could pave the way for peace talks between the Afghan government and the Taliban.
"In order to pave the way for face-to-face negotiations with the Taliban, the government has decided to free Taliban prisoners in exchange for two university professors," Ghani said.
The prisoner exchange comes at a time when efforts were being made to revamp peace talks between the US and the Taliban.
The Haqqani network has in recent years carried out large-scale attacks on civilians. It is believed to be based in Pakistan and is part of the Taliban in Afghanistan.