Gangs of Isis fighters have attacked a town in Iraq’s western Anbar province, in a diversion effort to distract Iraqi coalition forces from the rapid gains being made on the Isis-controlled city of Mosul.

Local security forces said around 30 members of Isis launched a surprise attack on the town on three different fronts in the early hours of Sunday, using car suicide bombs and mortar fire.

Calling for urgent back up, one military official said the militants had come from Syria as a counterattack in the struggle for control of Mosul, Iraq’s second largest city, which Isis has occupied since 2014.

Iraqi state television said the fighting had led to at least 10 police deaths.

Isis launched a similar strategy in the town of Kirkuk on Friday, about 60 miles (100 kilometres) away from Mosul, killing workers at a power plant in a suicide mission and attempting to storm a government compound in the town centre.

Local media reported there were still bursts of fighting on Saturday, contradicting government claims that the 80 or so militants who launched the attack had been driven out or killed.

The long-anticipated US-backed offensive to retake Mosul from Isis’ hands began on Monday. Coalition forces made up of Kurdish peshmerga fighters and Iraqi government troops have made significant gains to the south and east of the city, retaking almost 50 villages on the Nineveh plain that surrounds it.

Progress has been hampered by fierce resistance from Isis, including car suicide bomb attack and landmines, as well as fires lit at a sulphur plant near Qurayyah which has sent toxic fumes into the atmosphere.

Iraqi forces wear protective masks to protect themselves from sulphur fumes from a plant set on fire by retreating Isis fighters near Mosul, Iraq, 22 October 2016. (Reuters)

Within Mosul itself, aid agencies are worried for the welfare of the city’s estimated 1.5million inhabitants, whom they say are at risk of being caught in crossfire and used as human shields by the 4,000 or so Isis fighters embedded in the city.

Isis has also stepped up suicide bombings in Baghdad and neighbouring towns in recent weeks, retaliatory moves designed to show that the group is still capable of inflicting death and destruction even in areas where it does not hold territory.

A string of military defeats in the past few months has seen Isis’ territory across Iraq and Syria shrink by one third.

Losing control of Mosul will spell the end of the group as a land-occupying force in Iraq.