"The convoy of buses transporting newly graduated police was targeted by two suicide attackers in the limits of Kabul province. As a result 30 police were martyred and 58 more injured," a statement issued by the interior ministry said.

Sediq Sediqqi, a spokesman for the ministry, said the cadets were returning from a training center in neighboring Wardak province and were heading to the capital when targeted on Kabul's outskirts.

One attacker was on foot, and the other was in an explosive-packed car, he said.

The Taliban quickly claimed responsibility for the attack, the group's spokesman, Zabihullah Mujahid, said in a statement.

An AFP reporter said the area had been cordoned off but it appeared that five green police cadet buses had sustained damage, as well as a military Humvee vehicle assigned to escort them.

Twisted metal and glass shards littered the scene as security personnel gathered around the wreckage.

President Ghani said the attack demonstrated the Taliban's weakness on the battlefield, a statement from his office said.

"This cruel and complete disregard for human life during the holy month of Ramazan is abhorrent," the US embassy in Kabul added.

Resurgent Taliban

The resurgent Taliban have been fighting against the Western-backed Kabul government since they were ousted from power by a US-led invasion in late 2001.

They have been gaining ground across the country but the Islamic State group are also making inroads into Afghanistan, particularly in the east, where they are challenging the Taliban on their own turf.

On June 20, 14 Nepali security guards were killed in an attack on their bus that prompted Kathmandu to ban its nationals from working in the war-ravaged country.

Eleven others were killed in a string of bombings across Afghanistan on the same day.

The US and NATO combat mission in Afghanistan ended in December 2014. US forces have been in an advisory role since then, while carrying out counterterrorism missions against IS and remnants of Al-Qaeda.

US forces had only been authorized to hit Taliban targets for defensive reasons, or to protect Afghan soldiers.

But the recent changes mean US troops can now work more closely with local fighters in striking the Taliban, who have demanded the departure of all foreign forces.

The Taliban regularly attack police as part of their campaign, and a recent AFP investigation found that the insurgents are exploiting child sex slaves employed by security forces to deploy deadly insider attacks.

President Ghani on Tuesday ordered an investigation into the institutionalized abuse.

Efforts to bring the war to a close via peace talks meanwhile appear indefinitely stalled after the US killing of former Taliban chief Mullah Akhtar Mansour in a drone attack inside Pakistan last month.

It is not yet clear whether his successor Haibatullah Akhundzada will emulate his former boss in shunning dialogue with the Afghan government.