ERBIL, Iraq/BAGHDAD (Reuters) - Iraqi Prime Minister Hayder al-Abadi declared victory over Islamic State militants in Tal Afar and the entire province of Nineveh on Thursday, despite continued fighting in the small town of al-‘Ayadiya.

FILE PHOTO: A still image taken from a video shows Iraqi Prime Minister Haider Al-Abadi speaking as he makes a statement on Tal Afar, in Baghdad, Iraq August 20, 2017. Al Iraqiya TV/ via REUTERS TV

Tal Afar had become the next target of the U.S.-backed war on the jihadist group following the capture of Mosul, where it had declared its “caliphate” over parts of Iraq and Syria in 2014.

“Tal Afar has been liberated,” Abadi said in a statement. “We say to the Islamic State fighters: wherever you are, we are coming for you, and you have no choice but to surrender or die.”

The defeat in Mosul, Nineveh’s provincial capital, marked the latest in a string of territorial losses for the group. However, the militants still control areas on both sides of the Syrian-Iraqi border.

This includes Hawija, a city between Mosul and Baghdad that Iraqi officials have said will be the coalition’s next target.

The Iraqi army dropped millions of leaflets over Hawija on Thursday, warning residents it was preparing an offensive to recapture the city from Islamic State, the military said in a statement.

The leaflets urged residents to stay away from militants’ headquarters, to drop weapons and turn themselves in to avoid being killed.

Iraqi forces had been waiting to clear al-‘Ayadiya, 11 km (7 miles) northwest of Tal Afar, before declaring complete victory in the offensive. Islamic State militants had retreated to the town.

Divisions from the Iraqi army and federal police, backed by units from Shi’ite paramilitaries, retook al-‘Ayadiya on Thursday, military officers told Reuters, after several days of unexpectedly fierce fighting.

However, pockets of resistance remained and Iraqi forces were still working to clear the remaining militants from the town.

“We have to make sure that no more terrorists remain hiding inside the town’s houses,” Army Lieutenant Colonel Salah Kareem told Reuters.

Slideshow ( 2 images )

Two military officers whose units are leading the fight in al-‘Ayadiya on Thursday said scattered groups of militants were still hiding in houses and using tunnel networks to move through the town.

Four soldiers were killed and 10 more wounded as clashes continued in parts of al-‘Ayadiya on Thursday night, despite the announcement hours earlier by the prime minister.

Three soldiers were killed on Thursday evening and seven more wounded when a woman detonated a suicide vest, Kareem said.

“Soldiers thought the woman was a civilian trying to escape the fighting, but as soon as she came close to the soldiers, she blew herself up and killed three,” an army officer said.

In a separate incident, an Islamic State sniper killed a soldier and wounded three others during a search.

“We are still being shot at by snipers and coming under heavy gunfire from Daesh fighters,” Kareem said.

Iraqi forces will intensify their operations on Friday, to dislodge the militants still entrenched inside scattered houses, army officers said.

HUNDREDS OF TROOPS

Hundreds of additional troops had been sent into al-‘Ayadiya on Wednesday, as Iraqi forces came under increasing pressure to clear Islamic State fighters before the start of the Muslim holiday of Eid on Thursday evening. The battle was unexpectedly tough, with house-to-house fighting in the center of town.

If reclaiming the town was harder than expected, the larger battle for Tal Afar was easier. The city’s rapid collapse on Sunday after just eight days of fighting lent support to Iraqi military reports that the militants lack sturdy command and control structures west of Mosul.

Up to 2,000 battle-hardened militants were believed to be defending Tal Afar against around 50,000 government troops last week. It was unclear how many had retreated to al-‘Ayadiya.

U.S. Army Lieutenant General Stephen Townsend congratulated the Iraqi forces on achieving a “stunningly swift and decisive” victory in Tal Afar.

“This is Iraq liberating Iraqis,” he told a Pentagon teleconference from Baghdad.

Townsend added however, that a quick victory in Tal Afar did not necessarily mean the fight to retake Islamic State’s remaining territory would be easy.

“While I would like to say that we would see this elsewhere in Iraq and Syria, we are not really planning for that,” Townsend said.

“We pledge to you, our people, that we will continue to liberate every inch of Iraq,” Abadi said in his statement.

Tens of thousands of people had fled Tal Afar, a city with a pre-war population of about 200,000, in recent months. The United Nations estimated that 20,000 people had fled the city and its surrounding areas between Aug. 14 and 22 alone.

Civilians who fled Tal Afar in recent weeks told Reuters they had faced months of starvation and brutal treatment by the militants, who threatened them with death if they tried to escape.