MAZAR-I SHARIF, Afghanistan (Reuters) - Battles between Taliban and Islamic State fighters in a remote district of Jawzjan province in northern Afghanistan have caused heavy casualties and displaced thousands of people in recent days, officials said on Friday.

Islamic State and Taliban militants are fighting each other in several northern provinces. On Tuesday, IS fighters attacked the house of a Taliban commander in Sar-e Pul province, killing at least 15 people at a prayer ceremony.

Mohammad Reza Ghafouri, spokesman for the Jawzjan provincial governor’s office, said fighting between the two groups had been going on for over a week in the southern districts of Darzab and Qush Tepa.

“There have been heavy casualties, killed and wounded, on both sides, totaling close to 300 and the fighting is still going on,” he said.

Local people said they had been forced to flee their areas, leaving dead bodies unburied as the fighting went on around.

Taliban spokesman Zabihullah Mujahid confirmed there had been fighting with Islamic State in Darzab, vowing that the Taliban would drive them from the area soon.

Islamic State fighters first appeared in eastern Afghanistan almost four years ago and have fought the Taliban as well as government forces, establishing a reputation for unusual cruelty even by the standards of the Afghan conflict.

Top NATO commander in Afghanistan, General John Nicholson, estimated this year that Islamic State has around 1,500 fighters in Afghanistan, mainly in the east and in a “pocket” in Jawzjan.

A government offer for peace talks which the Taliban have not categorically rejected has given rise to speculation of a possible end to the conflict, but the fighting in the north underlines how complicated the security situation in much of Afghanistan remains with many areas out of either government or Taliban control.

“When Daesh came to our area, they killed a lot of people because they said we’d helped the Taliban,” said Masoma, a resident of the Aqsa area of Darzab who had taken his family to Sheberghan. “But now the Taliban have returned and they’re saying we helped Daesh.”

“You’re just left helpless, you don’t know what to do.”

Local officials say the situation in Darzab has been dire for months, with schools closed and food running short for many families. “These families have no shelter and their children are in a very bad condition,” said Halima, a member of the local provincial council.

Like its neighboring Faryab and Sar-e Pul provinces, Jawzjan has important smuggling routes for weapons and contraband that have been controlled for decades by armed groups.

“Commanders from the time of the (anti-Soviet) Jihad and the resistance are still around and still control the contraband traffic in weapons,” said Mohammad Faqir, a police commander in Jawzjan.

Darzab, where security forces control the district center but little else, and the adjacent district of Qush Tepa, have both seen regular fighting for a number of years with control passing from one group to another.

Ghafouri said Taliban forces from Sar-e Pul and Faryab were also involved in the fighting and hundreds of families had been forced to flee their homes and move to the provincial capital Sheberghan.

Officials from UNOCHA, the United Nations Office for the Coordination of Humanitarian Affairs, said they had an unconfirmed estimate that around 500 families, or some 3,500 people may have been displaced by the fighting but some local officials said the total may be twice that level.