An Afghan military spokesman says troops have freed 84 prisoners from a Taliban-run facility in the northern Faryab province.

Mohammad Anif Rezaye says most of those freed in the operation late Wednesday were Afghan security personnel and civilians, but that several captive Islamic State fighters were also found inside the facility.

It was not immediately clear what would be done with the IS fighters, including four from Uzbekistan, three from Tajikistan and one from Kyrgyzstan.

The Taliban and the local Islamic State affiliate are both at war with the Afghan government. But the two are fiercely divided over tactics and ideology, and have clashed repeatedly. The IS fighters were captured last year during a Taliban push to drive the extremists from the neighboring Jozjan province.