BAGHDAD -- Iraqi forces backed by the U.S.-led coalition retook on Friday the last town in the country that was held by the Islamic State of Iraq and Syria (ISIS), 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.

Get Breaking News Delivered to Your Inbox

Iraq's military relased what it says is video of the operation to retake Rawa.

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

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

Brett McGurk, the special U.S. presidential envoy to the global coalition to defeat ISIS, took to Twitter to ridicule ISIS:

#ISIS lost nearly 6000 terrorists in #Raqqa, then surrendered in large numbers. Once purported as fierce, now pathetic and a lost cause. 4/6 pic.twitter.com/JV9EFywqd4 — Brett McGurk (@brett_mcgurk) October 17, 2017

IS 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 United States 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 ISIS capital, which fell to the U.S.-backed Syrian Democratic Forces in October.

Both the U.S. 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, U.S.-backed Kurdish-led forces are also approaching Boukamal from the eastern side of the Euphrates.

Despite ISIS' 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.