KABUL -- A top al Qaeda commander was killed in a raid by Afghan forces last month, Afghan intelligence officials said Tuesday, in an operation backed by U.S. airstrikes that also killed tens of civilians.

Afghanistan's National Directorate for Security said in a statement Tuesday that the raid on Sept. 23 killed Asim Omar along with six other al Qaeda members in the southern Helmand province.

Omar was the head of al Qaeda operations in South Asia.

Among those killed was Raihan, Omar's courier to Ayman Al-Zawahiri, the leader of the al Qaeda network, the statement added.

"They had been embedded inside the Taliban compound in the Taliban stronghold of Musa Qala," added the Afghan intelligence services' statement.

The joint U.S.-Afghan operation targeted a Taliban hideout in the Musa Qala district, but the civilian deaths it caused rattled Afghanistan.

At least 40 people attending a wedding party in the area were killed on the same day, according to provincial officials, in the U.S. airstrikes.

Abdul Majed Akhund, deputy provincial councilman in Helmand, had said that most of the dead were women and children. An additional 12 civilians were wounded and were hospitalized in Lashkar Gah, the capital of Helmand province.

For the first time in 18 years of war, civilian deaths caused by U.S. and Afghan government forces have surpassed those caused by the Taliban and other insurgents, according to a UN report.

The operation also killed 22 Taliban fighters, including foreigners, Afghanistan's defence ministry had reported in a statement. Fourteen people were arrested, including five Pakistani nationals and one Bangladeshi. The statement said a large warehouse of supplies and equipment was also destroyed.

The Taliban are at their strongest since their ouster in 2001 and hold sway over more than half the country, staging near-daily, deadly attacks across Afghanistan.

On Tuesday, a bomb detonated inside a classroom in eastern Ghazni province, wounding at least 19 university students, a provincial official said.

Arif Noori, spokesman for the provincial governor, said 12 of the wounded are female students of the Ghazni University, located on the outskirts of the provincial capital, the city of Ghazni.

Noori added that two of the wounded are in critical condition.

No one immediately claimed responsibility for Tuesday's attack.

Last month a magnetic explosive device attached to a minibus belonging to the same university detonated, killing the driver. Noori says five students were also wounded in that blast.

The Taliban are active in the province and regularly launch attacks against security forces there.

The UN report found that U.S. and Afghan forces killed 717 civilians and injured 680 in the first six months of the year, up 31 per cent from the same period in 2018. The Taliban and IS killed 531 and wounded 1,437, down 43 per cent.