The specter of the feared Middle Eastern group, the so-called Islamic State (IS), is now stalking the North Caucasus.

The organization claimed responsibility for a terrorist attack on the night of December 29 inside the fortress that towers over the ancient city of Derbent in southern Dagestan. Assailants killed a Russian border guard officer and wounded eleven other people.

The authorities were quick to deny the involvement of IS, with the leader of Dagestan, Ramazan Abdulatipov, insisting that the attack was carried out by local militants. They named 31-year-old Abutdin Khanmagomedov, who comes from Derbent, as the perpetrator.

However, Khanmagomedov and a group around him pledged allegiance to IS last year and they were behind two other recent terrorist attacks. They killed the family of a local fortuneteller and attacked a group of firefighters in the line of duty. The murder of the unfortunate fortuneteller is in keeping with Islamic Salafis’ fight against alleged paganism.

For years, the main radical Islamist movement in the region was the homegrown Caucasus Emirate, which grew out of the more extreme elements that fought Moscow in Chechnya and Dagestan in the 1990s. But its influence has waned recently and its two most recent leaders—who both rejected IS—have been killed.

In 2014, two prominent Dagestani Caucasus Emirate commanders pledged their allegiance—remotely, via a Skype call—to the so-called Islamic State. A leading Chechen commander, Aslan Byutykayev, did the same in June 2015 on behalf of all Chechen militants. As many as five Dagestani imams swore loyalty to IS last year.

Last summer, the official spokesman for IS, Abu Mohammad Al-Adnani, announced the formation of a separate branch in the North Caucasus.

The appeal of IS lies in the fact that Islamists in the North Caucasus can say they are no longer mere regional players, but are now worldwide jihadists. They also hope for the kind of financial support from abroad that Chechen separatists received in the 1990s but, given the current financial troubles of IS, that is unlikely to materialize.

The Caucasus Emirate has lost prestige and is in crisis. But it is unlikely that the so-called Islamic State will ever fully supplant it, as many local warriors do not want to submit to foreign leadership. There were many tensions in the ranks of the Chechen rebels, with local Chechens disliking incoming Arabs, whom they considered to be “bad Muslims.”

The Kremlin has good reason not to want to call the attack on tourists in Derbent the work of IS. Along with the explosion that brought down the Russian plane over Sinai in October, killing 224 people, that would suggest the authorities are failing to protect their citizens.

In December 2015, IS posted on its websites a video showing cultural landmarks in Moscow and Kazan, as if to demonstrate potential targets. The Karyn-Kala fortress in Derbent, a well-known tourist attraction, falls into the same category. By attacking tourists there, Khanmagomedov’s group mimicked militants in the Middle East who have targeted tourists in museums and hotels in Egypt and Tunisia.

The apparent intervention of IS into the North Caucasus is just one more episode in its turbulent history.

It is a fertile ground for recruitment, and locals may join its ranks for many reasons. For instance, there are 17,000 Dagestani truck drivers, many of whom are suffering because of the new government-imposed road taxes. The perception that they are the victims of injustice could lead some of them to turn to religion. The spread of radical Islam in the North Caucasus is primarily a reaction to various unresolved socioeconomic problems, corruption, and the brutal measures the authorities have taken to suppress any kind of Islamic dissent.

The next question is whether those militants who left the region to fight in Iraq and Syria will return, and what will happen if they do.

According to Abdulatipov, there are 643 Dagestani jihadists fighting in the Middle East among several thousand Russian-born fighters. (Some officials in Dagestan’s Interior Ministry put the figure closer to 900, and others still say it’s nearer to 2,000.)

According to the police, more than 900 jihadists have come back to the region. In reality, the number is far greater. So far, these individuals haven’t been particularly active, but their combat experience in Iraq and Syria may count for something in the future.

If these men take up the fight, the question of whether it is locals or Islamic State who is responsible for acts of terrorism will be a merely academic one.