Soleimani, who has battled IS and other groups since 2012, knew the dangers that IS posed to Iran and presented the Islamic Republic’s strategy in dealing with the threat, “Daesh [IS] is a plague and a grave catastrophe in the world,” said the Iranian commander. “To safeguard the security of our nation, we need to quarantine our borders and aid our neighbors so this cancer does not spread to our country.”

US Deputy Assistant Secretary of State Brett McGurk, who was pushing the White House for a military response to IS advances in Iraq in the summer of 2014, must have envied Qasem Soleimani, the powerful commander of Iran’s Quds Force, who was on the front line in Jalawla in Diyala province deploying Islamic Revolutionary Guard Corps (IRGC) advisers and heavy artillery to stop IS at that time. “I was advocating as aggressive a response as possible, just given how dire the situation was. So those who were responding … that this needs a political solution, I just thought they were completely out of their minds,” McGurk recalled in a PBS documentary.

Despite Iran’s important role in degrading IS, the terrorist group has not been able to carry out any attacks inside the Islamic Republic, unlike much of the rest of the Middle East, Europe and the United States. Since its establishment in 1979, the Islamic Republic has been under constant domestic and foreign threats. As a result, it has developed a sophisticated intelligence and surveillance network that has effectively dealt with internal threats. In terms of external threats, Iran prefers to fight them in neighboring countries and has in those endeavors managed to prop up and support various proxies including Shiite, Sunni and secular groups across the region. Perhaps the most potent aspect of this strategy to deal with external threats has been the streamlining of the Iranian decision-making process.

In the 37-minute clip published in late March, titled “Persian Land, From Yesterday to Today,” Iranian IS members list what they see as crimes against Sunnis committed by the Islamic Republic and call on their brethren to take up arms against Tehran, saying, “Our war has started against the Persians. … I call in particular on the Sunnis in Iran to prepare for this war … and we are behind you.”

“Today Iran stands at the forefront of the battle and confrontation with the project of the Islamic caliphate, in a way that it funds more than 90 … armed militia groups in Islamic cities,” the narrator proclaimed in a newly released Islamic State (IS) video in which Shiite-majority Iran is portrayed as the source of division in the Muslim world.

Iranian officials are quick to point out that this strategy has been successful and that IS has not succeeded in carrying out attacks inside their country. “Due to the vigilance of … the security forces and the people, Daesh [IS] has not been able to even set off a firecracker for propaganda [purposes],” IRGC public relations chief Ramazan Sharif said last year.

But the cancer that Soleimani referred to may have already spread to Iran — and Tehran might come to regret one pillar of its strategy in dealing with external threats in the region.

From 2001, when the US-led invasion forced the jihadis of al-Qaeda out of Afghanistan, and until late 2011, when US forces left Iraq, Iran reportedly turned a blind eye to jihadis transiting its territory in order to bleed the United States and coalition forces in both countries. Salafi jihadis from eastern Iran, near the Afghan border, are said to have traveled freely across Iran’s Sunni heartland. Toleration of jihadis so long as Tehran was not at the receiving end of their violence is reported to have created a mass following for these groups in Iran’s Sunni areas.

For instance, the number of young Kurds adopting Salafi jihadi ideology has greatly increased in western Iran since 2001. Many Iranian Sunnis have traveled through Turkey to join IS and other jihadi groups in Iraq and Syria, often facing IRGC commanders aiding Iraqi and Syrian forces on the front lines.

Some IS supporters in Iran’s Kurdish areas even celebrated IS’ gains in the summer of 2014, as the group swooped across northern Iraq, according to Kurdish media. In the latest IS video, which is labeled as originating from the IS “wilayah” (province) of Diyala in Iraq, four members of the Popular Mobilization Units are seen kneeling down. They are then beheaded by four IS militants, two of whom are apparently Iranian Kurds.

Secular Kurdish activists inside Iran often complain about how parts of Iranian Kurdistan have been turned into battlegrounds where supporters of IS and Jabhat Fatah al-Sham (previously known as Jabhat al-Nusra) settle scores in the streets. Indeed, there have been reports in the Iranian media about a number of clashes between elements that espouse IS ideology and the security forces in Kurdish areas.

As Salafi jihadis become degraded and lose their territory in Iraq and Syria, some of the Iranian Sunnis who have honed their military and intelligence skills over the years will inevitably survive the battlefield and pose a threat to the Iranian state.

Tawhid Qoureishi, an Iranian Sunni religious scholar, traveled to northern Syria via Turkey to join IS along with two other Iranians in the fall of 2013. Prior to that, he engaged in religious studies near the Afghan border and then became a preacher in a Sunni village in the northern Iranian province of Gilan. Qoureishi, who was 30 when he joined IS, stayed with the group for over six months, roaming around northern Syria and meeting many high-ranking IS members. However, he later came to question some of the brutal methods IS deployed, which created division among Salafi jihadis. He participated in the first battles between IS and Jabhat al-Nusra, but soon afterward, he became disillusioned with the group and returned to Iran in the spring of 2014, where he was arrested upon arrival. “The main reason [I left IS] was the crimes that were committed there [in Syria], such as killing people. … I went there to defend people and confront oppression,” Qoureishi said from an Iranian prison when asked why a young man from a village in northern Iran would go to Syria to join IS.

He is now serving a seven-year prison term in Iran.

While most Iranian Sunnis reject the ideology promulgated by IS and other Salafi jihadi groups, some of the government policies deemed oppressive appear to push more young Sunnis into the arms of jihadi groups, which are quick to exploit such situations. "Iranian Jews live in security under the protection of the government and have synagogues in Tehran and Esfahan,” said the narrator in the IS video from March, comparing the status of the over 1 million Sunnis in Tehran with that of the Iranian Jews who are mostly concentrated in the capital. “There is not a single mosque for the Sunni people in Tehran,” disputing the Iranian authorities’ assertion that there are nine Sunni mosques in the capital.

“This [jihadi] thought is spreading day by day. I think they must have grown by a hundredfold since the Taliban era," warned Qoureishi in the prison interview, adding, "I don’t think it is possible to contain these movements.”