Prime Minister Haider A-Abadi had declared victory in Hawija earlier on Thursday during a visit to France.
The town was among the last Daesh strongholds in Iraq after troops retook the northern city of Mosul earlier this year.
Lt. Gen. Paul Funk II, the commanding general of the coalition in Iraq, said: “Our Iraqi partners fought bravely and professionally against a brutal and determined enemy, safeguarding innocent civilians throughout the entire campaign.”
Daesh still maintains a presence in the far western part of Iraq’s sprawling Anbar province, where another US-backed Iraqi offensive is underway.
The capture of Hawija was a boost for the Iraqi government, which faces a separate crisis in the north of the country, where the Kurdish minority last month voted overwhelmingly in support of independence for their autonomous region.
In Hawija, state TV showed footage of Iraqi forces raising flags in one of the town’s squares while Humvees patrolled empty streets littered with car wrecks, houses riddled with bullets and shattered storefronts.
Al-Abadi said the fight against Daesh was now focused on the border zone with Syria.
“This a victory not only for Iraqis but also for the whole world,” the premier said, as he announced the town’s recapture after talks in Paris with French President Emmanuel Macron.
Al-Abadi also urged Kurdish peshmerga forces to keep working with Iraqi forces in the fight against Daesh despite tensions over the independence referendum.
The premier made an appeal to his compatriots saying “we don’t want armed confrontation” among Iraqi forces at a time when the government is ousting Daesh from its last strongholds.
After Thursday’s talks with Al-Abadi about French support for the fight against Daesh and rebuilding Iraqi’s economy, Macron offered for France to mediate between the Iraqi government and Kurds.
Macron said France and others are worried about the situation of the Kurds after last month’s referendum, and said France supports the stability and territorial integrity of Iraq.
He insisted on the importance of “national reconciliation and inclusive governance” that includes Kurds, “with whom France maintains close ties.”
Macron said dialogue “is the only path” and “France is ready to contribute actively to mediation.”
Hawija lies between the two main routes north from Baghdad — to Mosul and to the city of Kirkuk and the autonomous Kurdish region — and its recapture is both a symbolic and a strategic victory for the government.
There was no immediate word on the fate of civilians in Hawija.
The UN said this week that an estimated 12,500 people had fled since the launch of the offensive to retake the town and surrounding areas last month.
The UN’s humanitarian affairs office said the number of people still in the town was unknown but could be as high as 78,000.
It said humanitarian agencies had set up checkpoints, camps and emergency sites capable of receiving more than 70,000 people who could flee.
The Norwegian Refugee Council said many of those arriving in the camps had little more than the clothes on their backs.
“In addition to the terror they have experienced during years under the control of the IS group (Daesh), many of the families who are arriving are malnourished,” said its acting area manager, Silvia Beccacece.