The decision to free top militant 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 a face-to-face negotiations with the Taliban, the government has decided to free Taliban prisoners in exchange for two university professors," Ghani said in a televised speech.
The prisoner exchange comes at a time when efforts were being made to revamp peace talks between the United States and the Taliban.
The Haqqani network has in recent years carried large-scale militant attack on civilians.
It is believed to be based in Pakistan and is part of the Taliban in Afghanistan.
The Taliban had kidnapped the Australian and American professors in August 2016 from the American University of Afghanistan in Kabul.