An airstrike has killed a large number of civilians, with some reports saying as many as 40, as they celebrated a wedding in Afghanistan’s southern Helmand province, Afghan officials have said.

The group were hit during commando raids by Afghan and foreign forces in Musa Qala district, that the Afghan defence ministry said targeted “foreign terrorists”.

Details filtered out slowly because the area is under Taliban control, but Abdul Majid Akhundzada, a member of the Helmand provincial council, said that the majority of the dead from the 11pm airstrike were women and children. Many of the dead were in a car and minibus carrying wedding guests.

In addition over a dozen wounded victims were taken to the provincial capital, Lashkar Gah. “Some 40 people were killed and 18 others were wounded and were brought to the hospital, all the victims were civilians,” he told Agence France-Presse. He described it as “joint airstrike operation by Afghan and foreign forces.”

Sher Mohammad Akhundzada, a provincial senator, also put the toll at 40 dead.

Others put the toll lower. Haji Mir Ahmad Jan, also a member of the provincial council said 14 were killed and 18 wounded.

Omar Zwak, spokesman for the provincial governor, said 14 insurgents, including six foreigners were killed, and an insurgent weapons and ammunition cache had been blown up. The government was investigating reports of civilian casualties, he said.

Afghanistan is on high security alert this week ahead of a presidential election on Saturday that the Taliban have vowed to disrupt. Attacks have already hit a campaign rally and targeted the office of a vice-presidential candidate.

The latest deaths come after months of rising civilian casualties caused by Afghan forces and their international allies, as they intensified military efforts against the Taliban.

In the first half of this year, the United Nations found that pro-government forces killed more civilians than the Taliban and other militant groups.

It is the first time since the UN began keeping records over a decade ago that Afghan security forces and their allies have been responsible for more deaths than insurgents.

A large proportion of those deaths were in airstrikes, like the one that appears to have hit Musa Qala on Sunday night. Often they are carried out by American aircraft or drones. The fledgling Afghan airforce has relatively limited capacity.

Musa Qala is a poor, dusty tract of northern Helmand province, with clusters of mud houses strung along an opium trading route but for years it was a bloody focus of the west’s war in Afghanistan.

At least 23 British soldiers were killed in operations to capture and hold the district from 2006, when the then defence secretary called it iconic. In 2010, the British handed over to US forces, at least four of whom also died in the district.

But in 2015 it fell back under insurgent control. When Taliban soldiers overran the district centre, they celebrated publicly, releasing a victory song on Soundcloud called Long Live Musa Qala.

Afghanistan’s defence ministry said five Pakistanis and a Bangladeshi national had been arrested in the raid.