The Taliban has released two Western hostages in southern Afghanistan, handing them over to US forces more than three years after they were abducted in Kabul.

American Kevin King and Australian Timothy Weeks are both professors at the American University in Kabul.

Their release comes one week after President Ashraf Ghani announced that Afghanistan would free three high-ranking Taliban prisoners in an apparent swap that he hoped would help jumpstart peace talks.

A local police source and three Taliban sources said the men had been released.

"We released the professors and are now expecting the Kabul government and Americans to release our three prisoners as soon as possible," one Taliban source told AFP.

There was no immediate comment from the US embassy in Afghanistan.

President Ghani had first announced the exchange on 12 November, saying the Taliban prisoners held at Bagram prison would be "conditionally" released.

They include Anas Haqqani, who was seized in 2014 and whose older brother is the deputy Taliban leader and head of the Haqqani network, a notorious Taliban affiliate.

Afghan authorities accuse Anas of a being a high-level player in the network. The Taliban has long demanded his release, insisting he is a student. 

The other two Taliban prisoners to be released are Haji Mali Khan, believed to be the uncle of Sirajuddin Haqqani, and Abdul Rashid, said to be the brother of Mohammad Nabi Omari, a member of the Taliban's political office in Qatar.

Mr Ghani said he hoped the swap would "pave the way" for the start of unofficial direct talks between his government and the Taliban, who have long refused to negotiated with the Kabul administration.

Prof King and Prof Weeks were kidnapped by gunmen wearing military uniforms in the heart of Kabul in August 2016.

They later appeared looking haggard in a Taliban hostage video, with the insurgents going on to say that Prof King was in poor health.

President Ghani said that the pair had been "deteriorating while in the custody of the terrorists".

The US has welcomed the release, saying both men had been "successfully recovered" and were receiving US medical care.

"We pray for the full recovery of both men, who endured significant hardship during their captivity, and wish them well as they reunite with their loved ones in the near future," Press Secretary Stephanie Grisham said in a statement.

American Kevin King and Australian Timothy Weeks were handed over to US forces by the Taliban Tuesday in a successful swap for three high-ranking insurgent prisoners that could boost peace talks.

"We thank the Afghan government for its actions, in the spirit of our partnership that enabled the freeing of the hostages," Ms Grisham said.