At least 26 people were killed, including children, in Afghanistan's Ghor province. Ghor Gov. Ghulam Nasir Khazi told BBC News the civilians were taken as they collected firewood in the mountains along with two flocks of sheep.
An Islamic State commander was killed during a police operation to free the civilians and the IS militants killed the civilians in revenge, Khazi said. The Wall Street Journal reported the civilians were killed after an attempt to steal the sheep was thwarted.
Three Afghan troops also died during an exchange of gunfire with the Islamic State. The Taliban has denied involvement and the Islamic State has not yet issued a claim of responsibility.
BBC News reported the Islamic State militants are former Taliban militants. The Taliban and the Islamic State declared war on one another in 2015 as they fight for control of territory. Both are contested by Afghan security forces.