Afghan security forces have discovered around 40 bodies in a mass grave in the northern Sari Pul province during the government forces’ cleanup operations in the troubled region.

The bodies were recovered on Tuesday amid reports that militants loyal to the Islamic State (IS) group and Taliban outfit massacred more than 50 civilians after overrunning the strategically important Mirza Olang district two weeks ago, Xinhua news agency reported.

The IS has claimed responsibility for the carnage and said in a statement that its fighters had killed 54 people in the troubled district.

Although the Taliban rejected its involvement in the bloodshed, villagers said both the Taliban and IS insurgents jointly attacked Mirza Olang and committed the “crimes against humanity”.

Most of the victims had been shot dead and some beheaded.

To clean up the area, the government forces launched a massive offensive over the weekend and recaptured the district on Tuesday.

“The security forces succeeded in evicting the rebels from Mirza Olang and restoring government control there,” army commander General Amanullah Mubin told the media.

People in the country have described the killing of civilians in Mirza Olang as carnage and strongly condemned it.

“Killing civilians including women and children is against the teaching of Islamic values and those behind the heinous crimes should be brought to justice,” Kabul resident Mohammad Asghar told Xinhua.

Sayed Musa, a resident of the district, expressed his hatred for the insurgents, saying the militants killed his son “mercilessly” although he had never taken up arms in his life.