Provincial officials say at least 35 civilians were killed and 13 were wounded in an attack conducted by the Afghan military in southern Helmand Province.
The incident occurred late on September 22 when special forces raided a house that the officials said was being used by the Taliban to train suicide bombers.
A wedding venue located near the target came under fire during the attack, the officials said.
"Thirty-five civilians were killed and 13 are injured. These people were attending a wedding party near to the attack site in the Khaksar area of the Musa Qala district," said Attaullah Afghan, a member of the Helmand provincial council.
A second provincial council member, Abdul Majid Akhundzadah, said 40 people, all civilians, were killed in the attack.
The U.S. military said 22 Taliban militants were killed in that raid.
Omar Zwak, the provincial governor's spokesman, says 14 militants including six foreigners were killed during the raid. Zwak said reports of civilian casualties were being investigated.
A senior Afghan Defense Ministry official said the raid was against "a foreign terrorist group actively engaged in organizing terrorist attacks." "During the operation, a large warehouse of the terrorists' supplies and equipment was also demolished," the official said.
A second ministry official said a foreign militant detonated a suicide vest that killed him and others around him, including a woman.
"The compound was being used to train men and women who were willing to become suicide bombers, [and] we raided it. We are aware that civilians were injured in the attack," he said.
The ministry said it would "share the result of the investigation" into the deaths overnight in Helmand's Musa Qala district.
The Taliban said in a statement that several civilians at a wedding party were killed and 18 members of the Afghan forces died in the fighting.
The incident comes after some 30 civilians working in a pine-nut field were killed last week in a drone strike in eastern Nangarhar Province
Meanwhile, a spokesman for the militants said that a Taliban delegation on September 22 met China's special representative for Afghanistan in Beijing to discuss the group's peace talks with the United States.
The meeting comes after U.S. President Donald Trump's cancellation earlier this month of negotiations with the Taliban, which had raised hopes for a broader peace deal with the Afghan government and ending an 18-year war.
Suhail Shaheen, the Taliban spokesman in Qatar, on his official Twitter account, wrote, "The Chinese special representative said the U.S.-Taliban deal is a good framework for the peaceful solution of the Afghan issue and they support it."
Mullah Baradar, the Taliban delegation's leader, said they had held a dialogue and reached a "comprehensive deal," Shaheen tweeted.
Speaking in Beijing on September 23, Chinese Foreign Ministry spokesman Geng Shuang confirmed that Baradar and several of his assistants came to China for exchanges in recent days.
"China's relevant Foreign Ministry official exchanged opinions with Baradar regarding the situation in Afghanistan and promoting Afghanistan's peace and reconciliation process," Geng said.
China's far western Xinjiang region shares a short border with Afghanistan.
Later this week, Afghanistan will hold its fourth presidential election since U.S.-led forces toppled the Taliban from power in 2001.