Afghan forces have recaptured a remote village where Taliban and Islamic State fighters allegedly massacred dozens of civilians earlier this month, officials said on Tuesday.
Militants killed about 50 men, women and children in Mirzawalang, a mainly Shia village in Sayad district of northern Sar-e Pul province, on August 5 after overrunning a government-backed militia, according to officials and residents.
A spokesman for the Afghan National Army's northern military corps said troops had retaken the village following several days of intense fighting that left at least 50 insurgents dead.
"Our forces are in full control of the village and are searching for Taliban mines and booby traps," Nasratullah Jamshidi told AFP.
Dawlat Waziri, a spokesman for the Afghan defence ministry, said forces had "pushed the Taliban out of the village" on Monday afternoon.
He told AFP that militants had suffered "heavy casualties". There has been no word on any casualties to Afghan forces.
Troops are expected to start searching for mass graves following claims from families and local officials that about 50, mostly-Shia and Hazara, villagers were either shot or beheaded after Taliban and IS insurgents took Mirzawalang in a rare joint operation.
The Islamic State group claimed responsibility for killing 54 Shias in Sar-e Pul in a statement released by its propaganda outlet Amaq late on Monday.
The Taliban earlier claimed capturing the village but said it did so alone. It also denied allegations it had killed civilians.
Survivors fleeing the violence described nightmarish scenes, detailing how militants went from house to house, shooting villagers.
The insurgents also took a number of residents captive, but later released 235 hostages after elders and provincial officials struck a deal with the group.
Taliban and IS fighters have regularly clashed since the latter gained a foothold in the country in 2015 but security sources say they have teamed up to attack Afghan forces on a few occasions.
IS has carried out a number of deadly attacks on Shias in the past year, providing a sectarian twist to the Afghan conflict.
This month two suicide bombers killed more than 33 worshippers at a mosque in Afghanistan's western city of Herat, in an attack claimed by the group.
A resurgent Taliban, whose ranks are mostly made up of ethnic Pashtuns, is at the height of its summer fighting season.