JALALABAD, Afghanistan — For nearly as long as the Taliban have been at war, Maulvi Abbas has been in the middle of it, leading a small squad of insurgent fighters in Nangarhar Province and demonstrating a certain talent for survival and success.

But in May, he was captured by the Taliban’s newest enemy, the Islamic State, said residents in one of the districts where Maulvi Abbas often stayed.

Throughout the month, fighters claiming allegiance to the Islamic State’s caliph had been attacking veteran Taliban units south and east of Jalalabad, the provincial capital. In one district, Islamic State loyalists have replaced the Taliban as the dominant insurgent power, and elsewhere they have begun making inroads in Taliban territory, one tribal elder, Mohammad Siddiq Mohmand, said in an interview.

On Wednesday, a spokesman for the Afghan Army corps responsible for the region said Islamic State fighters had captured and beheaded 10 Taliban who had been fleeing a military offensive, though that account has not been confirmed by other officials.