KABUL (Reuters) - Afghanistan will release two senior Taliban commanders and a leader of the Haqqani militant group in exchange for an American and an Australian professor who were kidnapped in 2016, Afghan President Ashraf Ghani said on Tuesday.

The government’s decision to free Anas Haqqani and two other Taliban commanders in a prisoner swap was taken in the hope of securing direct talks with the Taliban, which has hitherto refused to engage with what it calls an illegitimate “puppet” regime in Kabul.

“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.

Ghani said Anas Haqqani and Taliban commanders Haji Mali Khan and Hafiz Rashid were being released. All three were captured in 2014.

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.

Anas Haqqani is the younger brother of Sirajuddin Haqqani, who is second-in-command in the Afghan Taliban hierarchy and leads the Haqqani network, considered to the deadliest faction of the Afghan Taliban.

Slideshow ( 2 images )

A Taliban spokesman earlier this year said that the movement was determined to obtain Anas Haqqani’s release and named him as a member of a negotiating team that would hold talks with U.S. officials.

The Taliban had kidnapped U.S. citizen Kevin King and an Australian Timothy Weeks, both professors, in August 2016 from the American University of Afghanistan in Kabul.

Ghani said authorities had been unable to discover where the Taliban were holding the two captive.

“Information suggests that their health while being held by the terrorists has deteriorated,” he said.

Pakistani Prime Minister Imran Khan during a three-day visit to Washington in July that he would do his best to help release the American University professors.

A Pakistani delegation, including the chief of the powerful Inter-Services Intelligence (ISI) spy agency was in Kabul to meet Afghan authorities on Monday. A senior Pakistani official in Islamabad said the exchange of prisoners was discussed by the delegation.

According to Afghan officials, the next round of talks between the Taliban and Afghan representatives is slated for this month in Beijing.