Afghan authorities 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.

The move 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 yesterday, said National Security Council spokesman Javid Faisal, tweeting that it would "speed up efforts for direct talks and a lasting, nationwide ceasefire".

But for some victims' families, the plan to free the Taliban prisoners is a step too far. 

It "felt like being stabbed in the heart with a knife", said Juma Khan, 77, as he recalled watching Afghan leaders gather to debate and eventually approve the release.

His son, Aziz Ahmad Naween, an IT specialist, was killed in a massive truck bombing near the German embassy in May 2017 while heading to work. He was 24.

"We all want peace, but they never asked for our opinion, the victims," Mr Khan said. 

"That was the worst day of my life. I fell unconscious on seeing the body of my young son in a coffin," he told AFP at his home in Kabul.

"I don't believe that the decision to release them will lead to any peace in this country any time soon."

Taliban prisoners great each other as they are released from Pul-e-Charkhi prison

The decision also shocked Shahnaaz Ahmadi, 42, whose 45-year-old husband Faiz Ali Ahmadi was killed in the same truck bombing.

"It was unbelievable... and hard to watch what was happening," said Ms Ahmadi, who watched thousands of Afghan elders and stakeholders debate the release at last week's "loya jirga" meeting.

"How could they do that? We all cried that day," the mother of seven told AFP.

The "loya jirga" is a traditional gathering of tribal elders and other prominent citizens called by Mr Ghani at the weekend. It approved the release of the 400 militants to pave the way for talks and a possible ceasefire.

The peace talks will be held in Doha, Qatar.

The family of French woman Bettina Goislard, a United Nations refugee worker who was shot dead by Taliban militants in 2003, also opposed the release of her killers.

"Such a decision to free (them) made on the basis of horse-trading would be, to us, her family, inconceivable," her family told AFP.

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.

President Ghani warned this week 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," he said in a video conference organised by a US think tank.

"We have now paid the major installment on cost and that means peace will have consequences," he added.

A prisoner swap formed part of a deal signed by the Taliban and the US in February, which saw Washington agree to withdraw its troops from Afghanistan in return for a pledge from the insurgents to hold peace talks with the Afghan government.

The Afghan government was excluded from that agreement.

The February deal had stipulated that Kabul release 5,000 militants in return for 1,000 Afghan government prisoners held by the insurgents.

Ahead of the jirga, US Secretary of State Mike Pompeo had urged the gathering to release the prisoners, although he acknowledged the move was "unpopular".

The Taliban, meanwhile, has warned of possible attacks against the freed prisoners by extremists of Islamic State group in coordination with Afghanistan's spy agency.