Iraqi forces have captured the town of Hawija and the surrounding area from Islamic State, though some fighting still raged in a pocket to the north and east of the town where the militants were surrounded, the military said on Thursday.
With the capture of Hawija, the militants' last stronghold in northern Iraq, the only area that remains under control of Islamic State in Iraq is a stretch alongside the western border with Syria. Hawija is near the Kurdish-held oil city of Kirkuk.
"The army's 9th armoured division, the Federal Police, then Emergency Response division and (..)Popular Mobilisation liberated Hawija," said a statement from the joint operations commander, Lieutenant-General Abdul Ameer Rasheed Yarallah.
The offensive on Hawija was carried out by U.S.-backed Iraqi government troops and Iranian-trained and armed Shi'ite paramilitary groups known as Popular Mobilization.
The capture of Hawija brings them 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.
Iraq launched its offensive on Sept. 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-Qaimand 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 U.S.-backed, Kurdish-led coalition and Syrian government troops with foreign Shi'ite militias backed by Iran and Russia.
Islamic State's cross-border "caliphate" effectively collapsed in July, when U.S.-backed Iraqi forces captured Mosul, the group's de facto capital in Iraq, in a grueling 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.
He called on his followers to keep up the fight despite the setbacks.