Iraqi forces backed by the United States-led coalition retook on Friday the last town in the country that was held by the Islamic State group, more than three years after the militants stormed nearly a third of Iraq's territory, the Defense Ministry said.

At dawn, military units and local tribal fighters pushed into the western neighborhoods of Rawah in western Anbar province, and after just five hours of fighting they retook the town, according to Brig. Gen. Yahya Rasool, the ministry's spokesman.

Iraq's Prime Minister Haider al-Abadi congratulated his forces on retaking Rawah. In a statement released on Friday afternoon, Al-Abadi said Iraqi forces liberated Rawah in record time and were continuing operations to retake control of Iraq's western desert and the border area with Syria.

Rawah, 175 miles northwest of Baghdad, lies along the Euphrates River Valley near the border town of Qaim that Iraqi forces retook from IS earlier this month.

US-led coalition forces supported the operations to retake Rawah and Qaim with intelligence, airstrikes, and advisers, coalition spokesman Ryan Dillon said.

ISIS blitzed across Iraq's north and west in the summer of 2014, capturing Iraq's second-largest city of Mosul and advancing to the edges of the Iraqi capital, Baghdad. Later that year the US began a campaign of airstrikes against the militants that fueled Iraqi territorial gains, allowing the military to retake Mosul in July this year.

All that now remains of ISIS-held Iraq are patches of rural territory in the country's vast western desert along the border with Syria.

ISIS has steadily been losing ground across the border in Syria as well where its so-called "caliphate" has basically crumbled with the loss of the city of Raqqa, the former Islamic State group's capital, which fell to the US-backed Syrian Democratic Forces in October.

Both the US and Russia have embedded special forces with their respective partners and are supporting their advances with airstrikes. Russia backs Syrian government forces of President Bashar Assad.

The last urban areas controlled by the militants in Syria are parts of the border town of Boukamal and a patch of territory near the capital, Damascus, and in central Hama province.

Syrian government forces, backed by Russian troops and Iranian-backed militias, originally pushed ISIS out of Boukamal earlier this month, but the militants retook a large part of the town, mostly its northern neighborhoods days later. Since then, ISIS has repelled government forces trying to push back into the town.

Meanwhile, US-backed Kurdish-led forces are also approaching Boukamal from the eastern side of the Euphrates.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

Despite ISIS's significant territorial losses, the group's media arm remains intact, allowing it to still recruit supporters and inspire new attacks. Iraqi and American officials say ISIS militants are expected to continue carrying out insurgent-style attacks in Syria, Iraq, and beyond.

This story was reported by The Associated Press. AP writer Sarah El Deeb in Beirut contributed to this report.