With the capture of Hawija, the only area that remains under control of the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group in Iraq is a stretch alongside the western border with Syria.
Prime Minister Haider al-Abadi said in Paris on Thursday that "I want to announce the liberation of the city of Hawija today," calling it a "victory not just of Iraq but of the whole world".
He said that the fight against ISIL is now focused on the border zone with Syria.
The offensive was carried out by US-backed Iraqi government troops and Iranian-trained and armed Shia paramilitary groups known as Popular Mobilisation Forces (PMF).
"The army's 9th armoured division, the Federal Police, the Emergency Response division and … Popular Mobilisation liberated Hawija," said a statement from the joint operations commander, Lieutenant-General Abdul Ameer Rasheed Yarallah, on Thursday.
Major General Raid Shaker Jawdat, commander of Iraq's Federal Police, said, "The federal forces liberated the district of Hawija, the Hawija hospital as well as the Askari, Nidaa and Thawra neighbourhoods, and are in control of the centre of the province of Hawija in full".
Its geographical location in the oil-rich province of Kirkuk and its proximity to Mosul and the Iraqi Kurdish region has made it a centre of conflict between rival powers ever since the US invasion of Iraq in 2003.
Hawija is also one of the most important agricultural areas and the second-largest source of vegetables in Iraq.
The area's mainly Sunni Arab population of 450,000 is deeply hostile to both the Shia-led government in Baghdad and to the Kurds who form the historic majority in adjacent areas, which - in part - was what buoyed ISIL's control of the area.
In 2013, activists and political parties called for the conversion of Hawija from a province into a governorate, but the Kirkuk provincial council blocked the proposal.
US-led coalition troops nicknamed Hawija the "Kandahar in Iraq" after it put up fierce resistance to the 2003 US invasion, similar to that in the Taliban's bastion in Afghanistan.
|Interactive - Who controls what in Syria and Iraq [Al Jazeera]|
Source: Al Jazeera News