With Mosul recaptured from Islamic State and Raqqa probably just weeks from being taken, the militant group is likely soon to be wiped off war-zone maps. Like Lord Voldemort in the early Harry Potter books, it won’t have a physical presence — but it will live on in other forms: the minds of the foreign fighters returning to their homelands, the online presence it has built and the souls of the disaffected Sunni populations in the areas that the terrorist group has held for years.

It’s important to assess all three dangers and start dealing with them even before the looming military defeat of IS.

The foreign fighters, reportedly, have been abandoning the failed caliphate in droves — the ones, that is, who haven’t been killed, a number that’s hard to estimate. But thousands of them are still in Syria and Iraq, and many will try to go home.

In 2013, Thomas Hegghammer, an authority on foreign fighters at the University of Oslo, calculated that of 401 terrorists who took part in attacks in the West between 1990 and 2010, 107 had traveled to foreign countries to fight for Islamist causes. Hegghammer has estimated that at most, one in nine foreign fighters return to strike in the West, but in a 2016 paper Daniel Byman of Georgetown University argued that one in 20 would be more accurate. That could still mean a lot of attacks considering how big a magnet for foreigners Islamic State has been.

According to Byman, the returnee threat is overrated, though. The former foreign fighters take a number of “off-ramps” on the road to terror, even if they outlive the conflicts in which they went to fight. Some go off to other Middle Eastern wars, and IS fighters now have the opportunity to move to Afghanistan and other places where the organization has active cells. Others are intercepted by the intelligence services and put under such intensive surveillance that they can’t be effective as terrorists. Yet others find it hard, and perhaps demeaning, to apply the skills they gained fighting in a civil war to clandestine planning of attacks on civilians.

But, in the case of IS returnees, the reasons why most won’t continue their jihad will be psychological. Byman wrote:

At the start, simply defending the Syrian people against the regime’s brutality was the primary motivation of many foreign fighters, not defending them against a Western or other “foreign” enemy. Most joined the fight to gain bragging rights among their friends or to seek “excitement and adventure.” In their eyes, Syria seemed an admirable and an honorable way for them to do so.

Taking the fight to one’s peaceful neighbors is far more iffy in terms of bragging rights.

Besides, many will come back disappointed. IS propaganda promoted the caliphate’s territory as a jihadist paradise, based on Muslim camaraderie and noble goals. But in reality, many of the foreigners couldn’t blend in with the locals, were given menial tasks and were appalled by the brutality of the Middle Eastern civil conflict. Especially after a military defeat, they won’t come back as poster boys for the cause. It’s up to Western societies to make contact with them and seek their help in countering further terrorist propaganda. Denmark’s experience in foreign fighter rehabilitation could come in handy.

The Islamic State’s propaganda network will still be in place after its military defeat, though the group’s dwindling financial resources have already hit its media operations hard. Ultimately, running recruitment campaigns on the social networks is cheap, and taking down the terrorists’ propaganda product is nothing but a game of whack-a-mole. But the propagandists will have trouble with the message.

The dream of an actual state was an effective propaganda tool for a while, and so was the buzz of early victories. That’s all in the past now, and propaganda channels have to push the tired idea of vengeance. It doesn’t measure up to the enormity of a looming apocalyptic battle against crusaders near the Syrian town of Dabiq, a mainstay of Islamic State propaganda in previous years — until the town was captured from IS by the Syrian rebels last October, without much fanfare.

Soon, IS will be just another terrorist group competing for the angry attention of potential recruits. Defeat is hard to sell, as al-Qaida has found out in the long years while its leaders were killed off and its bases destroyed one by one. The rise of IS would have been impossible without the erosion of that major terrorist “brand.”

The plight of the Sunni Arabs in the areas of Iraq and Syria that are being liberated today is more difficult to cope with than the returnees or the remaining IS propaganda operation. IS couldn’t have held on to these lands for as long as it did without local support.

But Mosul was ruined by the time it was liberated, and Raqqa will follow in its path. Rebuilding either — and other areas formerly held by IS — seems like a long shot given the resources of the Iraqi government and Syrian rebels. Reaching a political settlement is more realistic, but will also take time. The areas that IS occupied are likely to be worse off once the terror group is gone.

A 2013 Rand Corp. report that attempted to summarize the modern experience of dealing with insurgencies has found that only one strategy (out of the 24 Rand singled out) was a glaring failure: “Crush them,” or “escalating repression and collective punishment.” It’s still a likely scenario at this point, and locals fear it from the Shiite-led government of Iraq. What works is confident policing coupled with a rebuilding effort — a difficult combination to get right.

A June report from the Combating Terrorism Center at West Point shows that IS remains active in the liberated cities, conducting terror attacks and maintaining a clandestine presence. There must be a better alternative for the locals than a new insurgency, and that’s the biggest challenge in Mosul and, soon, in Raqqa.

Leonid Bershidsky is a Bloomberg View columnist. He was the founding editor of the Russian business daily Vedomosti and founded the opinion website Slon.ru.

In a time of both misinformation and too much information, quality journalism is more crucial than ever.
By subscribing, you can help us get the story right.