The current wave of foreign fighters emerging from the conflict in Iraq and Syria will be larger and potentially more dangerous than the mujahideen guerrillas that were a byproduct of the Soviet-Afghan conflict in the 1980s, FBI Director James Comey warned last September.

That is an especially foreboding observation, since the foreign fighters borne from the Afghan conflict went on to form the core of Al Qaeda and fight in the internecine conflicts in Bosnia, Algeria and Chechnya during the 1990s.

When one conflict ends, these fighters often use their connections to move on and join another fight. This phenomenon is likely to worsen in the future.

The number of foreign fighters participating in the conflict in Iraq and Syria is significant compared to those who participated in Afghanistan in the 1980s. Even more concerning, jihadists have improved and facilitated their networking capacity—improved communication, eased transportation, and diversified access to sources of information and money can make even small cadres of experienced fighters a dangerous force. The foreign-fighter phenomenon is not new. Over the past two hundred years, they have appeared in more than a quarter of all civil wars. But now these fighters engage in foreign civil wars and insurgencies—and then export their expertise back to their home countries or to places they have newly immigrated.

While jihadism expert Thomas Hegghammer has estimated the number of foreign fighters in Afghanistan during the anti-Soviet conflict at between five thousand and twenty thousand, other scholars such as Edwin Bakker and Mark Singleton have pegged the crop of foreign fighters currently in Iraq and Syria at around thirty thousand. Other trusted sources have settled on a similar figure. The foreign fighters in Syria are not strictly Sunnis: significant numbers of Afghan and Pakistani Shia are also fighting alongside Hezbollah and other pro-Assad elements. Encrypted communications and the ubiquity of social media mean that even after the caliphate disappears, the ideology of Salafi jihadism will persist, existing online as a virtual caliphate, and offering aspiring jihadists hope that the next major battle is all but inevitable.

But what else might the international community glean from similarities and differences between the Afghan offspring versus the present-day Iraqi-Syrian progeny? For starters, as much as some scholars dismiss the importance of territory, the control of major cities like Mosul, Iraq and Raqqa, Syria has provided ISIS with consistent access to safe haven and sanctuary.

Given the continued assault on ISIS strongholds, there is little doubt that its members (foreign fighters as well as those from Iraq and Syria) will flee abroad to fight in other conflicts in places like Yemen, Libya, Afghanistan and elsewhere. With ISIS sustaining major territorial losses, some foreign fighters are refusing to fight while others are already attempting to return to their countries of origin. In Europe, this has been characterized as a low-probability, high-impact threat. Disrupting the reverse flow of the foreign-fighter pipeline remains a top priority for European governments and intelligence agencies.

To ensure that the foreign fighters who leave Iraq and Syria do not reconstitute elsewhere, it is critical they be denied safe haven, sanctuary, and the ability to train and network with other terrorists and insurgents in ungoverned territories. This must remain a priority, not only for the West, but for all nation-states affected by terrorism, including China and Russia.

The foreign-fighter contingent from Europe has been well-documented, but less understood are the ramifications of militants returning to countries that are ill-equipped and lack a domestic-security infrastructure to combat sustained acts of terrorism. This includes Trinidad and Tobago, which has the greatest per-capita number of foreign fighters in the Western Hemisphere.

In addition, some major global powers are preparing to deal with radicalized returnees from Syria. China is becoming increasingly worried about the growing threat of Uighur militants, jihadists from China’s western Xinjiang region, fighting in the Middle East, some of whom may return home to China to strike against Beijing. For Russia, the sheer number of its citizens fighting for ISIS—almost 2,400—is troubling; if even a fraction return home, it could cause major issues for Moscow. Jihadists from the former Soviet Union are rumored to be among the most effective and feared fighters in Syria today.

The mujahedeen that formed the core of Al Qaeda were able to rely upon Afghanistan as a hub for terrorist activity and training, provided in part by the Taliban. The global coalition arrayed to combat ISIS must do everything possible to ensure that Syria, Iraq, Libya, Yemen and other countries in the Middle East and North Africa do not become fertile soil for the current wave of jihadists to plant roots.

States with differing agendas and adversarial relationships have worked together in the past to counter terrorism. Most recently, the United States, Iran, Turkey and Russia came together in Syria to retake Palmyra from ISIS. Similar cooperation will be vital to ensuring that the threat from jihadists can be contained in the wake of the offensive against Mosul and the forthcoming assault on ISIS’s stronghold of Raqqa .

Colin P. Clarke is a political scientist at the nonprofit, nonpartisan RAND Corporation and an associate fellow at the International Centre for Counter-Terrorism (ICCT)-The Hague. Chad C. Serena is a political scientist at RAND. Amarnath Amarasingam is a senior research fellow at the Institute for Strategic Dialogue and a fellow at The George Washington University’s Program on Extremism.

Image: Sgt. Mike Garcia of the 8th Security Police Squadron is silhouetted against the sky as he holds a Stinger anti-aircraft guided missile during the air base ground defense Exercise Foal Eagle '89. Wikipedia Commons / Staff Sgt. Val Gempis​