Fighters of the Islamic State of Iraq and the Levant (ISIL) group launched a string of counterattacks in western Mosul, setting off clashes that continued overnight on Monday, according to Iraqi officials.

An unknown number of suicide bombers and gunmen targeted the Hay al-Tanak and Yarmuk neighbourhoods, military officials told news agencies.

The fighters set fire to houses and cars in Tanak, an area that had been declared free of ISIL in May.

Several people are reported to have died in the attacks, which sowed panic among residents who had returned to the area, and prompted hundreds of families to flee overnight.

Staff Lieutenant General Abdulwahab al-Saadi, a top commander in the Counter-Terrorism Service (CTS), which sent forces to fight the ISIL gunmen, said the attackers had infiltrated the neighbourhood by blending in with returning displaced civilians.

READ MORE: Journalist Veronique Robert dies of Mosul blast wounds

"The group came with the displaced and settled in the Tanak district. They regrouped and launched counterattacks," he told the AFP news agency.

"Yarmuk is being searched house to house," he said, adding that two groups of ISIL attackers were still believed to be in the area.

While the exact circumstances were unclear, Sunday night's attacks were described as a diversionary tactic by west Mosul-based "sleeper cells" to ease the pressure on the Old City, where Iraqi forces are closing in on the last remaining pockets of ISIL fighters. 

ISIL blamed for the destruction of Grand al-Nuri Mosque

The offensive to retake Mosul, in northern Iraq, was launched eight months ago with air and ground support from a US-led international coalition.

Brigadier General Mohammed al-Khodari told the Associated Press news agency that counterattacks were tactics the Iraqi army had seen in other areas that were previously recaptured from ISIL.

"When they sense defeat somewhere, they counterattack somewhere else to draw away attention and to show that they are still strong," said Khodari.

"This attack shows that they will soon be defeated in Mosul."

'ISIL is finished'

A curfew was in force over western Mosul, a Reuters news agency correspondent reported. 

A CTS medic said the attack had caused several victims but he could not say how many.

"There are martyrs who were killed by Daesh," the medic said, using an Arabic acronym for ISIL

He said 15 to 20 ISIL fighters were also killed in the battle. 

The fall of Mosul would mark the end of the Iraqi half of the "caliphate". ISIL is facing an offensive in Raqqa, its self-declared capital in Syria.  

READ MORE: UN - ISIL targets children of families fleeing Mosul

A senior commander who spoke to Reuters on Monday predicted that the battle for Mosul would be over in a few days.

Lieutenant General Abdul Ghani al-Assadi said the area under ISIL is now less than 2sq km.

"From a military perspective, Daesh is finished," he said. "It lost its fighting spirit and its balance. We are making calls to them to surrender or die."

The Iraqi military estimates that up to 350 fighters were besieged in the Old City, dug in among civilians in crumbling houses.

More than 50,000 civilians, about half the Old City's population, remain trapped behind ISIL lines with little food, water or medicines, according to those who escaped.

Aid organisations say ISIL has stopped many from leaving, using them as human shields. Hundreds of civilians fleeing the Old City have been killed in the past three weeks.

Is it over for ISIL? - UpFront special

Source: News agencies