Afghan security forces inspect the site of a suicide attack Thursday on the outskirts of Kabul. (Rahmat Gul/AP)

Dozens of Afghan police cadets were killed Thursday when two Taliban suicide bombers targeted their convoy near Kabul in one of the deadliest attacks in months.

The Afghan Interior Ministry said at least 30 cadets were killed and 58 others wounded in the attack on the western outskirts of the capital. A police official, who spoke on the condition of anonymity because he was not authorized to provide information, said the death toll was higher.

The cadets were returning to Kabul for the Muslim religious festival of Eid after completing training in restive Wardak province when a suicide car bomber rammed one of the buses in the convoy, witnesses and police officials told reporters. A second bomber detonated explosives after police and local residents rushed to the scene. Several civilians were also killed, residents said.

The Taliban claimed responsibility for the attack, which left several buses in the police convoy badly damaged. The force of the blast pushed one bus off the road.

“As residents and other police in the convoy moved to evacuate the casualties of the first blast, another suicide bomber, possibly on foot, blew himself up among them,” said a witness who gave his name as Hamidullah.

President Ashraf Ghani denounced the attack as a “crime against humanity.” His government is locked in a power struggle and faces threats from a growing Islamic State presence, as well as the Taliban.

Ghani said the bombings were a sign of the Taliban’s “defeat on the battlefield.”

It was the deadliest attack on security forces since April, when Taliban militants used a suicide truck bomb to assault a compound housing an intelligence training office in the capital. At least 64 people were reported killed.

The Taliban has also repeatedly attacked convoys of security forces. The latest such assault Thursday raised further questions as critics asked why the government has not changed its policy of transporting large numbers of security forces in convoys.

Earlier this month, 14 Nepali security guards were killed in the suicide bombing of a bus in the capital.

Interior Ministry spokesman Sediq Sediqqi said more than 400 cadets were traveling in the convoy Thursday. They were riding in marked buses, according to witnesses.

“Why are they transporting so many police in marked police buses in the face of past deadly attacks?” asked one resident, Mohammad Bashir. “Why can’t the government learn from past mistakes?”

Ghani said he has ordered an investigation into how the cadets were transported to ascertain whether any negligence was involved.

The U.S. Embassy in Kabul condemned the bombings as “abhorrent” and indicative of a “cruel and complete disregard for human life.” It said in a statement, “We will continue to stand with our Afghan partners and friends as they work to bring peace and security to Afghanistan.”

Washington is widening its military campaign against the Taliban in the country, authorizing offensive airstrikes against the group in June. Previously, airstrikes on Taliban targets were allowed only for defensive reasons. U.S. officials have said such strikes will be used only when they are deemed to have a significant strategic impact on the fight.

Morris reported from Baghdad. Erin Cunningham in Istanbul contributed to this report.