The Taliban killed at least 291 Afghan security personnel over the past week, a top government official said Monday, accusing the insurgents of unleashing a wave of violence ahead of potential talks.

The previous week was the "deadliest" in the country's 19 years of conflict, said Javid Faisal, spokesman for the National Security Council, even as the insurgents dismissed the latest figures.

The Taliban carried out 422 attacks in 32 provinces during that time, killing 291 security force personnel and wounding 550 others, Faisal said on Twitter.

"Taliban's commitment to reduce violence is meaningless, and their actions inconsistent with their rhetoric on peace," he said.

The Taliban rejected the latest government figures.

"The enemy aims to hurt the peace process and intra-Afghan talks by releasing such false reports," Zabihullah Mujahid, the Taliban's spokesman in Afghanistan, told AFP.

"We did have some attacks last week, but they were mostly in defence."

In a cabinet meeting Monday, President Ashraf Ghani condemned the violence, which he blamed on the Taliban.

The government sees the violence "as running against the spirit of commitment for peace", Ghani said.

Afghan security forces stand guard at an outpost in Kunduz Province
Afghan security forces stand guard at an outpost in Kunduz Province AFP / STR

In an attack on Monday, gunmen shot dead two prosecutors and three other employees of the attorney general's office.

The attack happened on the outskirts of Kabul, when gunmen opened fire on the car in which they were travelling, the attorney general's office and the interior ministry said.

It was unclear who the attackers were, and the Taliban denied involvement.

The incident drew condemnation from US special envoy Zalmay Khalilzad, who led negotiations with the Taliban ahead of a deal signed in February.

He said the legal team had been working on a prisoner exchange that is considered vital before the Kabul government and the Taliban can start peace talks.

"This attack underscores what we all know: Spoilers (both domestic and foreign) are trying to disrupt and delay" the peace process, Khalilzad said on Twitter.

"Both sides should not be deterred, and push forward to take the steps necessary to reach intra-Afghan negotiation".

Violence had dropped across much of Afghanistan since the Taliban announced a three-day ceasefire on May 24 to mark the Eid al-Fitr holiday, but officials have accused the insurgents of stepping up attacks in recent weeks.

Ghani has vowed to complete the Taliban prisoner release. Afghan authorities have already freed about 3,000 Taliban prisoners, and plan to further release 2,000 as stipulated in the insurgents' deal with Washington.

The Taliban have said they are ready for peace talks but only after the release of the remaining 2,000 insurgents.