In 2014, ISIS controlled around 34,000 square miles of territory in Iraq and Syria. As of Friday, ISIS lost its last stronghold in Iraq.

That’s because on Friday morning Iraqi troops and US-led coalition forces retook Rawa — a small town in northwestern Iraq — after about five hours of fighting. ISIS has now effectively lost all of its territory in Iraq, even though some of the group’s militants still operate in the country’s western rural areas near the border with Syria.

Now that Iraq’s flag hangs over Rawa once more, Brett McGurk, President Donald Trump’s diplomatic envoy for the US-led coalition, congratulated the Iraqi fighters on Twitter and announced that the “days of [ISIS’s] phony ‘caliphate’ are coming to an end.” Iraqi Prime Minister Haider al-Abadi also praised his forces, noting how quickly they retook the town.

The Pentagon says the US has around 5,300 troops tasked with helping the Iraqi military fight ISIS, usually by training its troops, gathering intelligence, and conducting airstrikes.

It’s a big moment for Iraq, as retaking Rawa has essentially ended ISIS governance in its country after three long and brutal years of fighting. But that doesn’t mean that anyone can relax just yet. If anything, the ISIS threat is morphing.

ISIS isn’t defeated yet

It’s more than likely that ISIS will continue to plague Iraq, Syria, and much of the world, even as it loses land.

Just a day ago, when asked about ISIS, Secretary of Defense Jim Mattis said that “anyone who thinks they're down is premature.”

Hassan Hassan, a Middle East security expert at the Tahrir Institute for Middle East Policy, wrote in the National on November 15 that ISIS is already beginning to redefine itself. The group is shifting from governing territory to quickly striking Iraqi towns and cities. The strategy, Hassan notes, is to begin “a war of attrition to deplete its enemy through a ceaseless and incessant campaign of terror and hit-and-run attacks.”

ISIS may carry this strategy forward into Syria, too. The group lost the capital of its so-called caliphate, Raqqa, in October, but it still controls parts of urban areas in eastern Syria. As the US-led coalition tries to remove ISIS from that territory, it could use terror tactics to try to ward off the US-led coalition.

As my colleague Yochi Dreazen notes, ISIS may turn into more of an idea as it loses more territory. That idea may continue to inspire ISIS followers in various countries to stage attacks — especially in Europe and the United States. The attack in New York City this month, which killed eight people and injured 11, was believed to have been inspired by ISIS. It only underlined how hard it will be to prevent similar attacks by an individual encouraged by ISIS propaganda.

So while it’s worth celebrating the military defeat of ISIS in Iraq, it doesn’t mean the fight against the group is over.

Watch: What happens after ISIS falls?