BAGHDAD -- Iraq's prime minister on Thursday declared the town of Tal Afar "fully liberated" from the Islamic State of Iraq and Syria (ISIS) after a nearly two-week operation, the latest blow to the extremist group which ran nearly a third of the country just three years ago.

Iraqi troops "eliminated and smashed Daesh terrorists" in al-Ayadia district, about 6 miles northwest of Tal Afar, where the militants fled last week, Haider al-Abadi said in a statement. Daesh is the Arabic acronym for ISIS.

With Tal Afar liberated, all of Nineveh province -- the first area ISIS militants captured in a 2014 blitz -- "is in the hands of our brave troops," al-Abadi said.

Get Breaking News Delivered to Your Inbox

"To Daesh criminals we say: Wherever you are we will come to liberate and you have to choose only death or surrender," he said.

Iraqi officials often declare areas liberated before the fighting has completely ended, and the militants have been known to carry out surprise counterattacks.

U.S.-backed Iraqis troops launched the operation to retake Tal Afar early last week, a month after it declared the northern city of Mosul, its second largest, to be fully liberated. Tal Afar is about 93 miles from Syria's border and it was among the last ISIS-held towns in Iraq.

The U.S.-led coalition released a statement on Thursday congratulating the Iraqi Security Forces on their "stunning victory" in Tal Afar, but acknowledging the risks posed by ISIS militants in the area could linger.

"While the city and critical infrastructure are under ISF control, dangerous work remains to completely remove explosive devices, identify ISIS fighters in hiding and eliminate any remaining ISIS holdouts so they do not threaten the security of Tal Afar in the future," said the statement from Operation Inherent Resolve command.

Iraqi forces have driven ISIS from most of Iraq's major towns and cities seized by the militants in the summer of 2014, including Mosul, which was retaken after a grueling nine-month campaign.

ISIS stills control the northern town of Hawija as well as towns in western Iraq near Syria.