Tal Afar was the last major population centre in northern Iraq still under IS control
Iraqi Prime Minister Haider al-Abadi declared victory over Islamic State militants in Tal Afar and the entire province of Nineveh on Thursday.
Tal Afar became the next target of the US-backed war against IS following the recapture of Mosul, where it had declared its "caliphate" over parts of Iraq and Syria in 2014. Mosul is the capital of Nineveh province.
Tal Afar was the last major population centre in northern Iraq still under IS control and its loss deprives the group of what was once a key supply hub between its territory in Syria and Iraq.
"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."
Iraqi forces had been waiting to clear the small town of 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.
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
- Haider al-Abadi, Iraqi PM
Divisions from the Iraqi army and federal police, backed by units from Shia 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.
Hundreds of additional troops were sent into al-’Ayadiya on Wednesday, as Iraqi forces came under increasing pressure to clear Islamic State fighters from their final position in the group’s former stronghold.
Iraqi forces had faced an unexpectedly tough battle in al-'Ayadiya, fighting house-to-house in the centre of town.
They had come under pressure from top commanders to finish the offensive before the start of the Muslim holiday of Eid, which begins on Thursday evening.
No militants had been allowed to escape from al-'Ayadiya, Abadi said in his statement.
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 retreated to al-’Ayadiya.
Mosul was flattened in nine months of grinding urban warfare before it was recaptured in July.
Its recapture effectively marked the end of the caliphate, but the group remains in control of territory on both sides of the Syrian-Iraqi border.
"We pledge to you, our people, that we will continue to liberate every inch of Iraq," Abadi said in his statement.