Kabul-Afghan authorities on Friday said they had started to release 400 Taliban prisoners, the final hurdle in long-delayed peace talks between the two warring sides, even as President Ashraf Ghani warned they were a “danger to the world”.

The Afghan government and the Taliban are set to meet within days of the prisoner release being completed, in a move that has drawn widespread condemnation after it emerged many of the inmates were involved in attacks that killed scores of Afghans and foreigners.

A group of 80 prisoners was released on Thursday, said National Security Council spokesman Javid Faisal, tweeting that it would “speed up efforts for direct talks and a lasting, nationwide ceasefire”. The peace talks will be held in Doha, Qatar.

The release of the 400 militants was approved at the weekend by a gathering of thousands of prominent Afghans called by Ghani after the authorities initially refused to free the militants. The prisoners include some 44 insurgents of particular concern to the United States and other countries for their role in high-profile attacks, according to an official list seen by AFP.

Australian Prime Minister Scott Morrison said earlier this week he had lobbied for a former Afghan army soldier, who went rogue and killed three Australian colleagues, to stay in jail.

Ghani warned on Thursday that the hardened criminals were “likely to pose a danger both to us and to (America) and to the world”.

“Until this issue, there was a consensus on the desirability of peace but not on the cost of it,” Ghani said in a video conference organised by a US think tank.