Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

BAGHDAD, Iraq — U.S.-backed Iraqi forces have liberated the town of Hawija and the surrounding area from ISIS, the Iraqi military said in a statement on Thursday.

The capture of Hawija, the militants' last stronghold in northern Iraq, means the only area that remains under ISIS's control in Iraq is a stretch of land alongside the western border with Syria.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Iraq launched the offensive last month to liberate the area north of Baghdad where up to 78,000 people were estimated to be trapped, according to the United Nations.

U.S.-backed Iraqi forces, backed by fighters from the Popular Mobilization militia, advance towards Hawija on Wednesday, during an operation to recapture the town from ISIS. AHMAD AL-RUBAYE / AFP - Getty Images

Troops, police and paramilitaries liberated the city, said the operation's commander, Lieutenant-General Abdul Ameer Rasheed Yarallah. The U.S.-backed Iraqi government forces were backed up by Iranian-trained and armed Shiite paramilitary groups known as Popular Mobilization.

ISIS still controls the border town of al-Qaim and the region surrounding it. They also hold parts of 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.

Related: ISIS Claim of Responsibility in Las Vegas Is Sign of Desperation

ISIS's cross-border "caliphate" effectively collapsed in June, when U.S.-backed Iraqi forces captured the city of Mosul in a grueling battle which lasted nine months. U.S. -led coalition forces are currently closing in on the Syrian city of Raqqa, the de facto capital of ISIS's self-declared caliphate.

ISIS released an audio recording last week that it billed as a message from leader Abu Bakr al-Baghdadi, rumored to be dead since the summer.

He called on his followers to keep up the fight despite the setbacks.