Iraqi forces have captured Islamic State's last stronghold in northern Iraq, the military said on Thursday, leaving the militant group holed up in pockets of land by the Syrian border, across which its self-proclaimed "caliphate" once stretched.
The town of Hawija and the surrounding areas were captured in an offensive carried out by US-backed Iraqi government troops and Iranian-trained and armed Shia paramilitary groups known as Popular Mobilisation.
Some fighting continued to the north and east of the town where the militants were surrounded.
With the fall of Hawija, which lies near the Kurdish-held oil city of Kirkuk, the only area that remains under control of Islamic State in Iraq is a stretch alongside the western border with Syria, where the militant group is also in retreat.
State TV showed footage of Iraqi forces putting flags in one of the town's main squares while Humvees patrolled empty streets littered with car wrecks, houses riddled with bullets and shattered storefronts.
Thick black smoke continued to rise from areas surrounding Hawija, from oil wells torched by the militants to prevent air detection.
The capture of Hawija brings Iraqi forces into direct contact with Kurdish Peshmerga fighters who control Kirkuk, a multi-ethnic region claimed by both Baghdad and the Kurdistan Regional Government (KRG).
Kirkuk shaped up as a flashpoint last month when the KRG included the city in a referendum on Kurdish independence in northern Iraq.
"We don't want any aggression or confrontations but the federal authority must be imposed in the disputed areas," Prime Minister Haider al-Abadi told a news conference in Paris, held with French President Emmanuel Macron.
Iraq launched its offensive on September 21 to dislodge Islamic State from the Hawija area, where up to 78,000 people were estimated to be trapped, according to the United Nations.
The militants continue to control the border town of al-Qaim and the region surrounding it.
They also hold parts of the Syrian side of the border, but the area under their control is shrinking as they retreat in the face of two different sets of hostile forces - a US-backed, Kurdish-led coalition and Syrian government troops with foreign Shia militias backed by Iran and Russia.
Islamic State's cross-border "caliphate" effectively collapsed in July, when US-backed Iraqi forces captured Mosul, the group's de facto capital in Iraq, in a gruelling battle which lasted nine months.
The militants' leader, Abu Bakr al-Baghdadi, who declared the caliphate from Mosul in mid-2014, released an audio recording last week that indicated he was alive, after several reports he had been killed.