The 30ish Fatehi was busy making a living and had little time for jihad or geopolitics. Instead he and his friends liked to discreetly mock the bearded zealots who were wreaking havoc all over the region by beating anyone they deemed to be acting un-Islamic.

For months prior to that fateful late summer evening in 2013, the hardscrabble mountain town in the heart of Iranian Kurdistan had been buzzing with rumors that local Kurds were sneaking into Turkey and heading to the Syrian battlefront. Several had left backbreaking jobs on the region’s farms and orchards to join US-backed leftist rebel groups, but many others were pledging allegiance to extremist outfits such as the Islamic State and al-Qaeda.

[[Bahram Fatehi’s tea house in Paveh was bustling with clients smoking shisha when the religious fanatic who would later stab him to death first walked in.]]

Bahram Fatehi in an undated photo. Noryaw.ir

That all changed the night Afshar Minayi, a heavy-built young man sporting the long beard and shaved upper lip popular among Salafists, stopped at the tea house with several of his acolytes. Declaring it their religious duty, they cherry-picked verses from the Quran to demand that the tea house stop selling shisha. They also accused Fatehi, who wasn’t there that night, of selling drugs to his customers, many of them unemployed young men hooked on the cheap heroin pouring in from Afghanistan. The manager on duty denied doing anything illegal and told them to get lost.

Miffed, the men walked out into the night. The manager had parked his Iranian-made SAIPA Pride outside, and they saw their chance for revenge. Minayi’s gang doused the aging white car with petrol and set it on fire, sparking a feud that would end in Fatehi’s death.

For the next four years, Fatehi and his friend hounded the men, demanding compensation. Minayi’s crew in turn threatened to kill the tea house owner. The local authorities did nothing.

In January 2017, Fatehi spotted Minayi in a busy square and approached him. The two men quarreled. Suddenly, the jihadi pulled out a butcher’s knife and stabbed Fatehi several times, shouting “Allahu akbar.” He tried to slit the dying tea house owner’s throat, but a horrified crowd of onlookers blocked him until police arrived.

A butcher’s knife lies at the scene of Bahram Fatehi’s murder in Paveh, Iran, in January 2017. Mehr News Agency

The case barely made the local news in the town of 25,000. “Bloody quarrel in Paveh results in death of one young man,” read one headline. The state media blamed a “personal” dispute. One outlet published two grainy photos of the scene: The bloody knife lying in the street, a crowd gathered around an ambulance a few feet away. Ominously, one reader left a cryptic message on a local news site covering Fatehi’s funeral: “We need to understand why someone can butcher another person … we are all to blame.”

[[Throughout this period, long-simmering tensions in Iranian Kurdistan were reaching a boiling point. Militant trends that emerged after the United States toppled Saddam Hussein in 2003 hardened as the black-clad fighters of IS rampaged through Iraq and Syria. Radicalized young men began to prowl the streets, flaunting their allegiance to Sunni extremism in the land of the Shiite revolution.]]

Throughout Iranian Kurdistan, bearded militants harassed women drivers, burned down hookah joints and marched through the streets carrying machetes and the black IS banner. In Paveh, the police force’s apathy began to raise suspicion.

“On three occasions I told the local authorities that the Salafi-jihadi groups were dangerous and would become a headache later,” a nongovernmental organization worker from Paveh told Al-Monitor on condition of anonymity for fear of arrest. “The authorities were more focused on nationalist Kurdish groups that were based just across the border in Iraqi Kurdistan.”

That laxity would come to a sudden and bloody end last spring, five months after Fatehi’s death.

On June 7, four armed men donned women’s clothing and stormed the parliament building in Iran with assault rifles and explosive belts. A fifth attacker blew himself up at the nearby mausoleum of Ayatollah Ruhollah Khomeini, the Islamic Republic’s founder. Together, the twin attacks on two of the state’s most important symbols claimed 23 lives, including the five jihadis.

Two-year-old Emad is evacuated during an attack on the Iranian parliament in central Tehran, Iran, June 7, 2017. Omid Vahabzadeh/TIMA via Reuters

Faces covered, the men had pledged allegiance to IS in a video filmed shortly before the assault. The group soon claimed responsibility for the first major terrorist attack in the country since 2010, while Iran blamed the usual suspects: Saudi Arabia, Israel and the United States.

The next day, the Intelligence Ministry published the photos and first names of the attackers: Seriyas, Fereydoun, Qayyum, Abu Jahad and Ramin. They were revealed to be Iranian citizens who had fought with IS in Mosul and Raqqa.

Back in Paveh, it dawned on residents what had happened. Disbelief gave way to panic after a cleric working for the city government told his congregation that several of the terrorists were Kurds.

“People are scared of a crackdown,” an anxious resident confided to Al-Monitor the day after the attack. “Many are hoping that the attackers are not from Paveh.”

Four of the five terrorists, it soon became evident, were indeed from their small town. At least two of them — identified to Al-Monitor by three Paveh residents as Seriyas Sadeqi and Qayyum Fatemi — were close associates of Minayi who were with him on the fateful night when he made a scene at Fatehi’s tea house.

Across Iranian Kurdistan, villagers braced for the repression they knew from experience was surely coming. They would not have long to wait.

[[The attacks in Tehran were a colossal security breach for the Iranian government, which had long prided itself on avoiding the chaos that has engulfed its neighbors to the west. Within days, the authorities had rounded up hundreds of people across the Kurdish region as well as in Tehran and other cities. Some 100 residents were arrested in Paveh alone.]]

For older residents, history seemed to be repeating itself.

Nestled deep within the Zagros mountain range along the border with Iraq and Turkey, tiny Paveh has long occupied an outsized role in the Kurdish and Iranian psyches. Located right across from Halabja in Iraqi Kurdistan, the town lies at the heart of an Iranian Kurdish enclave stretching more than 600 miles (1,000 kilometers) from Ilam province in the south through Kermanshah and Kurdistan provinces and into west Azerbaijan along the Turkish border.

“On three occasions I told the local authorities that the Salafi-jihadi groups were dangerous and would become a headache later. The authorities were more focused on nationalist Kurdish groups.”

The Kurds, a distinct ethnic group with their own language and customs, had long clashed with their Persian overlords. By the 1970s they were again in open revolt, this time against the US-backed Mohammad Reza Shah Pahlavi, who proved to be as unresponsive to their demands for autonomy as many of his predecessors.

As a result, many Kurds eagerly applauded the 1979 revolution. They would soon be disappointed.

Obsessed with religious purity and consumed with xenophobic paranoia, Tehran’s Shiite regime quickly proved inherently inimical to the majority-Sunni Kurds and their ancient international connections, forged through centuries of cross-border trade and smuggling.

Within months of Khomenei’s accession to power in February 1979, a new uprising began when Kurdish militants overpowered government militias in Paveh. Soon the revolt spread to surrounding towns and provinces as Kurdish activists released their plan for independence. When Iran held a referendum on the creation of an Islamic republic in April, many Kurds refused to endorse a regime that seemed bent on cementing Shiite primacy and rejecting regional autonomy.

Tensions deepened over the summer, following nationwide elections to a panel tasked with writing a new constitution. After the regime in Tehran refused to recognize the Kurds’ elected representative, sporadic skirmishes gave way to all-out confrontation.

In mid-August 1979, some 2,000 Kurdish militants captured Paveh, killing 40 out of 280 Revolutionary Guard Corps (IRGC) forces garrisoned in the town, according to the Iranian government. On Aug. 17, Khomenei issued his first fatwa, or religious edict, declaring Kurdish independence leaders enemies of the state. Within days, the town was back in Tehran’s hands, at an official cost of 400 Kurds and 18 Iranian security forces killed.

“They are foreign collaborators — they are either American collaborators or another country’s collaborators,” Khomeini said in a television interview at the time. “We gave them freedom but they misused it. We will not give them freedom from now on.”

Gelawij Heidari was a 23-year-old mother of three living in Paveh at the time. She’d already suffered greatly under the shah, but would soon face far worse.

“The bruises on my body from the club wielders of the Pahlavi regime had not yet healed when the Islamic Republic came to power,” Heidari recalled in a 2011 interview with the Iran Human Rights Documentation Center, a US-based nonprofit.

Around noon on Aug. 21, 1979, she testified, the IRGC took her husband, a member of the nationalist Kurdistan Democratic Party of Iran. They lined him up in front of a firing squad along with eight other men, including a doctor from Tehran who had come to Paveh to treat the wounded. Those caught fighting were abused even in death.

“The government paraded the naked corpses of killed Kurds around Paveh,” Heidari recalled. “Three of the people executed with my husband were placed in a truck and revolutionary guards instructed the townspeople over a loudspeaker: ‘Come and see those we have killed.’”

A few days later, Heidari approached the judge who had presided over the executions, a cleric named Sadeq Khalkhali, and asked him why he had ordered her husband’s death.

“He said that if my husband was innocent, he became a martyr and would go to heaven,” she recalled. “And if he sinned, then he got what he deserved.”

Defeated, the Kurdish fighters retreated into the mountains, their rebellion thwarted but their defiance unbroken.

[[The Kurds would continue to wage a dwindling insurgency well into the early 1980s, far outlasting simultaneous ethnic rebellions by the Arabs, Baluchis and Turkmens. By the revolt’s end, more than 10,000 Kurds would perish, with 20,000 more displaced.]]

Thousands of farmers and shepherds lost their farms and herds. Some joined the IRGC, fighting their own Kurdish kinsmen. Others left their villages for a life of squalor in nearby towns. The families of Sadeqi and Fatemi, the jihadis who attacked Tehran, were forced to leave their village of Zhiwar and ended up in poverty in Paveh.

The uprising also had a lasting impact on the young Shiite militiamen galvanized by Khomeini’s fatwa, many of whom would soon come to form the core of the Iranian security forces. Hossein Hassani Sadi, a former ground forces commander, recalled in a television interview in September that the situation in Kurdistan “was such that no one could move around on the front lines because of the anti-revolutionaries.”

That first bloody encounter with the battle-hardened peshmerga would fuel the clerical government’s obsessive fear of Kurdish separatism to this very day. Almost four decades after the revolution, Kurdish students in Iran are taught Persian, Arabic, even Western “imperialist” languages such as English and French — but rarely their native tongue. With as many as 8 million Kurds living in the country today, Iran still views Kurdish nationalism as a potential threat to the regime’s long-term survival.

From the beginning, the new leaders in Tehran saw the Kurdish Islamists as useful allies of convenience against the separatists, said Hawzhin Baqali, a Paris-based expert on Salafism in Iran. The leaders of the Shiite revolution shared natural affinities with the Sunni militants, with no less a figure than Ayatollah Ali Khamenei, now the country’s supreme leader, engaged in translating Sayyid Qutb’s works and spreading the Muslim Brotherhood’s ideology in the early days of the 1979 uprising.

"The regime that seized power after the revolution was in harmony with the nascent political Islam in Kurdistan,” Baqali told Al-Monitor. “Its interests required strengthening political Islam in Kurdistan and its support ... started immediately after the revolution as part of its strategy in Kurdistan.”

That initial alliance with the Kurdish Islamists proved short-lived, however.

“As soon as it strengthened the pillars of its power, the government's need to sympathize with Muslim Kurds was over,” Baqali added. “Shortly after crushing the resistance in Kurdistan, it [turned on] its sympathetic Islamic forces.”

Tehran’s Kurdish divide-and-conquer strategy resurfaced during the war with Iraq, which broke out in September 1980 when Saddam Hussein took advantage of the revolutionary chaos to invade his neighbor. At the time, Iranian Kurds defeated in their uprising against Tehran were streaming across the border into Iraq. Hussein would soon become a key patron of Kurdish separatist groups in Iran.

Hussein, however, had no intention of putting up with Kurdish demands in his own country, providing Tehran with a tit-for-tat opportunity to incite domestic unrest across the border. One of Tehran’s early allies in its war against Iraq’s Baathist regime was an Iraqi Kurdish cleric named Sheikh Osman Abdulaziz, who fled to Iran in the 1980s after refusing Hussein’s entreaties to declare the Iraqi offensive a holy war.

With Tehran’s help, Abdulaziz established the Islamic Movement of Kurdistan (IMK) in 1987 and brought a number of small Kurdish Islamist parties under its umbrella. From the beginning, the party’s founders framed their pro-Kurdish militancy in religious terms. With Iran’s blessing, they declared jihad against Hussein’s government.

“[Abdulaziz] would say we are an oppressed Muslim nation. The priority is to free this Muslim nation from the oppression of the Baath regime,” Irfan Abdulaziz, Osman’s nephew and the current head of the IMK, recalled in a 2014 interview with the Iraqi Kurdish channel NRT. “We took up arms to defend the persecuted Kurdish Muslim people.”

Sheikh Osman Abdulaziz leads members of his Islamic Movement of Kurdistan in Iraq in 1992. Chris Kutschera / Library of Kurdistan

Abdulaziz would prove in many ways to be an ideal choice for both Tehran and the Kurds: a relatively moderate Islamist scholar, respected by nationalist leaders in Iraqi Kurdistan, fighting for Kurdish rights under a religious banner. Many Kurds welcomed the clerical regime’s imprimatur as a way to boost their Muslim bona fides in an increasingly sectarian region. Kurdish communities on both sides of the border had remained largely secular and welcoming to religious minorities, even drawing Christians to their revolt against Iraq's Baath Party. In turn, Arab countries — in particular Saudi Arabia and its Gulf neighbors — denounced the Kurds as godless communists fighting to overturn a friendly Arab regime in Baghdad. Khomenei himself, in his infamous 1979 fatwa, had declared the dissident Kurds “opponents of Islam [who] seek to spread atheism in the country.”

In June 1987, Kurdish fighters from across the region visited Abdulaziz at his headquarters near Paveh to pledge their allegiance.

“We were living in a camp right on the border … and three of my brothers joined the Islamic Movement when it was established,” Momen Zalmi, a native of the mountainous Hawraman region that straddles both countries, told Al-Monitor in an October interview. “There was a military base and the movement fighters were getting trained there sometimes by Iranian military advisers.”

Soon after the formation of the IMK, its fighters headed back across the border to carry out attacks against the Iraqi regime. Abdulaziz retained a great deal of autonomy, however, and warned that Tehran’s plans to open another front during the waning days of the Iran-Iraq war would beget a civilian slaughter.

His words would prove prescient. On March 16, 1988 — two days after Halabja fell to the Iranian army in the last days of the Iran-Iraq War — Iraqi MiG and Mirage jets unleashed an unprecedented mustard gas attack on the Kurdish town, killing as many as 5,000 people.

Ibrahim Mika Ali, an Iraqi Kurd who lived in Iran in the late 1980s, recalls armed IMK members visiting Kurdish refugee camps and beating those who spoke against the jihad against Baghdad. A member of a rival Muslim Brotherhood faction at the time, Ali remembers the IMK setting up “big tents” outside local mosques and recruiting fighters to its cause.

“Every day … the clerics of the movement leadership would give speeches and fiery sermons and encouraged people to jihad and to join the movement,” he wrote in a 2014 memoir.

All the while, he recalled, the Iranian authorities were keeping a close eye on their newfound Kurdish allies.

“The pressure was so much,” Ali wrote, “that there was not a day that the officials of the Intelligence Section of the IRGC would not summon our known members and interrogate them.”

The Islamist Kurds’ alignment with Tehran alarmed many of Abdulaziz’s fellow clerics, who had no desire to see Iran replace Iraq’s pan-Arab, Sunni-friendly Baath Party with a sectarian Shiite alternative. The Muslim Brotherhood leader in Paveh, Salahaddin Mohammad Bahaddin, wrote to Abdulaziz to ask him to reconsider, but his request fell on deaf ears. “My uncle tore the letter apart,” Irfan Abdulaziz told NRT.

Iran’s alliance with Sunni Kurdish Islamists would proceed, with far-reaching consequences for both sides.

[[For the next couple of years the Kurdish front remained relatively quiet, until Hussein’s ill-advised 1990 invasion of Kuwait threw the region into turmoil again.]]

In October 1991, in the wake of Iraq’s defeat in the first Gulf war, the Kurds established their own autonomous region around Erbil. In the Kurds’ first free elections the following year, Abdulaziz’s Iranian-backed Islamists were crushed, barely winning 5% of the vote — less than the minimum needed to obtain a seat in the new Kurdistan Parliament.

Iran’s Baghdad problem had just become an Erbil problem.

Many Kurds welcomed the clerical regime’s imprimatur as a way to boost their Muslim bona fides in an increasingly sectarian region.

Soon Tehran doubled down on its support for Islamist Kurds “in the hope of countering and destabilizing the Kurdish nationalist parties,” according to Stanford University’s Mapping Militant Organizations project. “The Iranian government began providing financial aid and military trainers to the IMK. … In return, the IMK began carrying out terrorist attacks, hoping to destabilize the new Kurdish nationalist government.”

In the mid-1990s, the IMK opened a sprawling military training complex just outside Halabja near the Iranian border. The gambit would prove short-lived. In December 1993, Kurdish peshmerga forces invaded the IMK’s Halabja stronghold, arresting Abdelaziz and sending his followers scurrying back to Iran.

The following year, civil war broke out between Iraq’s two largest Iraqi Kurdish factions. With conflict and international sanctions plunging the region into poverty, many Kurds were left with few choices other than picking up a gun and joining one of the myriad groups vying for power.

By the end of the Kurdish civil war in 1998, the IMK had re-established its rule in and around Halabja. Once again, Islamist ideas were spreading across the border region as Kurds who had fought the Soviets in Afghanistan began to publish heroic tales of mujahedeen warriors in magazines and religious young people took notice. Two decades later, IS militants are still singing IMK military songs from that era eulogizing Afghan and Chechen jihadis fighting to establish Islamic regimes in those lands.

Many of those Afghan veterans opposed Abdulaziz’s decision to join the Kurdish government following the end of the civil war and launched several splinter groups. Those breakaway factions “wanted to behave the same way as the Islamic State is ruling now,” Irfan Abdulaziz told NRT.

Kurdistan at first proved naturally resistant to radical foreign influence thanks to its tolerant strain of Sunni Islam tinged with Sufi mysticism. But the clerical regime in Tehran unwittingly chipped away at that moderating influence as it hunted down prominent moderate Kurdish Islamists, who were long seen as a bigger threat.

Ahmad Moftizadeh, who led negotiations for more freedom for the Kurds during the revolution, spent 10 years in prison and died less than six months after his release in early 1993. Naser Sobhani, the founder of a Quranic academy in Paveh, was arrested in 1989 and executed the following year.

Then in 1996, Mohammad Rabie, a champion of Sunni-Shiite unity, died, possibly at the hands of Iranian secret agents. His death sparked a wave of protest in Kermanshah, Javanrud and Paveh, during which two people were killed and hundreds were detained.

“They told me to sign that he had had a heart attack,” Rabie’s wife, Aiysha Mufakheri, recalled in a December 2011 interview. “I said my husband was a wrestler and swimmer. He had no health issues. But they had decided that he had had a heart attack, and there was nothing we could do.”

Mufakheri remembers being “constantly threatened” on the phone. When she visited his grave, “they did not allow us to mourn.”

By contrast, the battle-hardened jihadis were left largely free to implement Sharia in the areas under their control. Over time, they transformed the Hawraman border region into a Taliban-like Islamist enclave where women were barred from going to school and men were lashed for drinking.

“Music was not allowed, women had to cover up and some of the more extreme fighters even blew up the soccer goal posts,” Momen Zalmi, who was a 13-year-old living near Halabja at the time, recalled in a recent interview with Al-Monitor. “They even crossed out or removed the pictures of women on soap or shampoo imported from Turkey.”

Tehran had helped set the stage for an explosion of Salafi-jihadi ideology on both sides of the border. The George W. Bush administration would soon light the fuse.

[[Iran initially responded to the terrorist attacks of Sept. 11, 2001, with tentative overtures for better relations with the United States. President Mohammad Khatami and Supreme Leader Ali Khamenei both condemned the attacks, while huge crowds attended candlelight vigils across the country.]]

US and Iranian officials together began plotting the overthrow of the Taliban regime under UN auspices. When the United States invaded Afghanistan the following month, Iran helped US forces battle the Taliban and establish a new Afghan government. During that time, “Tehran deported hundreds of Qaeda and Taliban operatives who had sought sanctuary in Iran,” Hillary Mann Leverett, a former National Security Council staffer who was present at the 2001 talks, wrote in 2009.

But behind the scenes, Qasem Soleimani, the commander of the Quds Force, the IRGC’s special forces unit, prepared for what he correctly surmised would be an inevitable betrayal by Washington. On Jan. 29, 2002, Bush used his first State of the Union address since the Sept. 11 attacks to dub Iran part of an “Axis of Evil” along with Iraq and North Korea. Regime change had become the order of the day.

Soleimani began casting around for potential allies who could make life miserable for the Americans in Afghanistan. After the fall of the Taliban regime in December 2001, hundreds of al-Qaeda fighters began fleeing to Iran. Among them was Abu Musab al-Zarqawi, who would go on to form al-Qaeda in Iraq, the precursor to IS.

Back in Iraqi Kurdistan, several of the groups that had splintered from the Iranian-backed IMK joined forces under the name Ansar al-Islam in December 2001. They chose as their leader a former poet and Afghan war veteran known as Mullah Krekar. Krekar, a Sunni Kurd, had known Osama bin Laden and Abdullah Azzam — the founders of al-Qaeda — in the 1980s and had a reputation as a hardcore jihadi.

Internal Iranian politics further muddled the situation. Enraged at hearing Iran labeled a terror-supporting rogue regime, Khatami ordered the arrest and expulsion of the foreign fighters flocking in from Afghanistan. Many were handed over to the new Afghan government as well as Saudi Arabia. Several ended up at the US military prison at Guantanamo Bay.

Soleimani, meanwhile, did all he could to stop the Ministry of Intelligence from rounding up his guests. He was able to keep most senior fighters in the country by moving them around a network of safe houses, according to the book “The Exile” by investigative journalists Cathy Scott-Clark and Adrian Levy, which has been described as “the only authoritative description” of al-Qaeda militants’ stay in Iran after 2002.

“Senior al-Qaeda figures from bomb makers to former camp commanders, biological weapons specialists, operational planners, and financial chiefs were once more being smuggled into Iran,” the book says.

From Iran, Zarqawi visited Ansar al-Islam’s enclave in Iraqi Kurdistan, the authors write. He reportedly stayed there for several months and secured the safe transfer of several al-Qaeda fighters to Iraq. Soleimani’s Quds Force provided them with fake passports and cash.

Iran, the authors write, was fast becoming the “main supply artery for the coming war in Iraq.” Their account is confirmed by newly declassified documents from the 2011 raid in Abbottabad, Pakistan, that killed Osama bin Laden. One documents says Iran offered some “Saudi brothers” in al-Qaeda “everything they needed,” including money, arms and “training in Hezbollah camps in Lebanon, in exchange for striking American interests in Saudi Arabia and the Gulf.”

[[With the sudden influx of foreign fighters, Salafi-jihadi ideology began to permeate the Kurdistan Region on both sides of the border.]]

“The number of fighters slowly increased,” recalled Amanj, a farmer who lived in the Iraqi village of Sargat, near Halabja, when Ansar al-Islam took over from the more moderate IMK. “Groups of fighters came from Iran and descended … right down the mountains and joined the group. I saw Tunisians, Arabs and Kurds from Erbil.”

Amanj, who was 23 at the time and did not want to use his last name for fear of repercussions, often mingled with the jihadis and prayed alongside them in the village’s only mosque. He told Al-Monitor he remembers Westerners being among the group.

“There was a Canadian couple whose son Osman went to school in Sargat, so he picked up some Kurdish,” Amanj said. “Osman's father was white and he said this was the best thing for him. He had everything in Canada but he was ready to go anywhere where there is Islamic law. They were very nice people.”

Others have less fond memories.

Mohammad Hawrami, now a 22-year-old driver, was in Byara, Iraq when it became another hive of jihadi activity in 2002.

“I saw with my own eyes the Ansar militants lashing a 13-year-old boy for apparently being in love with a girl,” Mohammad told Al-Monitor. “They hit him with a shoe and forced everyone out of their homes to watch the punishment inflicted on the young boy.”

Soon it would be the militants’ turn to cower in fear.

The formation of Ansar al-Islam's enclave around Halabja hadn't escaped the US military's attention. The Bush administration's plans for the invasion of Iraq called for coalition forces to move south from Iraqi Kurdistan. Scattering the jihadis to secure the Americans' rear and free up allied Kurdish peshmerga forces was the first order of business.

On March 21, 2003, US forces fired a barrage of Tomahawk missiles at the militants. A ground and air attack followed a week later, forcing Ansar al-Islam and allied factions to pull back to the Iranian border.

At the time, the farmer Amanj estimated, the number of Ansar al-Islam militants had risen to about 1,000. The day of the strikes, he was visiting his family at a refugee camp about 5 miles (8 kilometers) from Sargat across the border in Iran.

“There at the army base near the camp I saw the same men I had seen inside my village [in Iraq] being placed in buses and driven away by Iranians,” recalled Amanj. “I’m not sure what they did with them.”

For a while, the Kurdish jihadis and their Iranian handlers maintained good relations as they focused on their new common enemy across the border: America.

Another source who spent several years with Kurdish jihadis in Karaj Rajae Shahr prison just outside Tehran told Al-Monitor that the Ansar fighters were allowed to spread their Salafi-jihadi ideology, which the IRGC continued to see as an antidote to Kurdish nationalism.

“The irony is the followers of al-Qaeda now are considered moderate in prison, while Daesh followers are really extreme,” said the former inmate, using a common term for IS. “Whoever does not think like them, they are condemned to death.”

During his time behind bars, several prisoners were freed who later traveled to Syria and Iraq to join IS and other such groups, the 30-something man recalled in a recent interview via WhatsApp.

“When we arrived in Iran after March 2003, we gave a pledge to the Iranians not to endanger their security,” one top Ansar al-Islam commander told the man, who did not want to reveal anything about his identity, while they were locked up together in 2011. “We were free to roam around and we even carried guns and our wounded were treated in Iranian hospitals in Sanadaj.”

The jihadis got another boost with President Mahmoud Ahmadinejad's election in 2005. A former member of the IRGC's internal security force, the Basij, Ahmadinejad was fully supportive of what Soleimani was doing in Afghanistan and Iraq against the Americans.

Rebin Rahmani, a Kurdish activist who heads the Kurdistan Human Rights Network in Paris, told Al-Monitor he was arrested in Kermanshah province in November 2006 while making a film about drugs and AIDS. Accused of tainting the reputation of the Islamic Republic, Rahmani ended up spending 13 months locked up with three Iraqi Kurdish members of Ansar al-Islam. They'd been arrested that summer while trying to enter Iran with night-vision goggles, but flatly denied acting against the Iranian government.

“'Osama bin Laden, our emir, has said that Iran is our backyard and no attacks should be launched there,'” Rahmani recalled the men telling him. The Iranian authorities constantly interrogated the jihadis about the situation in Iraq and their own plans, Rahmani told Al-Monitor from exile in France. “'Our fight is not with you but with Christians in Iraq,'” he recalled one of the men telling the head of the prison.

Over time, the men told Rahmani of their efforts to spread their ideology across Iranian Kurdistan, in remote mountain towns where young men faced a bleak future hauling smuggled goods across the porous border while cushy government jobs were reserved for those with state connections. As the jihadi influence grew, despondent Kurds became more and more radicalized. They started to assassinate local religious figures.

“Most of the youths in Javanrud who followed the Salafists in the early days were drug addicts and thugs,” said Makwan Dino, 31, a political activist and native of Javanrud who spent four years in prison in Kermanshah for his political activism.

Dino harbors little doubt that the militants and the Iranian authorities were working together against nationalist Kurds.

“The Salafists believed that the nationalist Kurds were apostates and should be killed,” Dino told Al-Monitor in an October interview in Iraqi Kurdistan. “I had a friend who was almost beaten to death by seven Salafists in 2006.”

Baqali, the scholar of Iranian Salafism in Paris, said Tehran’s strategy at the time was to allow the jihadis to operate out in the open, where they could more easily be tracked and manipulated.

"Iran has used these groups to decrease the danger of jihadis in Iranian Kurdistan and bring their affairs under its own control and use them as a pressure tool in Iraqi Kurdistan,” he said. “By allowing these groups to operate freely, Iran did not want these jihadi groups … to go underground."

Even as the state ignored the threat, rival vigilante groups rose in opposition. In Javanrud, Dino said, these included the leftist Kurdistan Workers Party and the dervishes, Sufi followers who hated the jihadis for destroying their shrines and desecrating the graves of their saints.

“The moment the whirling dervishes came out, the Salafists would melt away,” Dino recalled.

All the while, tensions in the unnatural alliance between the Sunni jihadis and their Shiite patrons swelled below the surface, ready to erupt. The jihadi prisoners in Iran, for example, refused to eat meat, judging their Shiite captors to be unclean, Rahmani recalled. One of them made it clear he had had no such qualms while imprisoned at the US-run Camp Bucca in Iraq, because Americans belonged to “the people of the book,” according to Islam.

“When we arrived in Iran after March 2003, we gave a pledge to the Iranians not to endanger their security. We were free to roam around and we even carried guns and our wounded were treated in Iranian hospitals in Sanadaj.”

The authorities in turn began to round up Sunni jihadis and execute those who preached violence inside Iran. Sunni preacher Shoresh Mehdi Khani was one of the first to be executed in July 2009.

By then, the jihadis' poisonous rhetoric was already flowing freely across Iranian Kurdistan. When his cellmates learned that Rahmani was an atheist, he told Al-Monitor, they were ready to condemn him to death.

“'You should be slaughtered,'” Rahmani recalled one of them telling him while looking him in the eye. “I genuinely thought of them as a great danger to humanity.”

[[The hateful rhetoric that had been building up for years in Iranian Kurdistan finally exploded into a spasm of brutality with the rise and fall of IS in next-door Iraq. Would-be jihadis in places such as Paveh watched their IS idols’ appalling exploits in Syria on YouTube and communicated with them through Facebook and Telegram.]]

Tehran, in a bid to save its ally President Bashar al-Assad, began to deploy hundreds of volunteers and advisers to Syria in late 2011 to fight jihadis and other rebel groups. But back home, authorities continued to turn a blind eye even as the Islamists grew more and more aggressive.

“The government gave space to these vigilante groups to organize themselves,” said a Paveh lawyer who works with accused jihadis and asked to remain anonymous. “The growth of Salafi groups and widespread availability of drugs was seen as a counterweight to Kurdish nationalism.”

Violence surged after the would-be caliphate captured the eastern Syrian city of Markada from the al-Qaeda-linked Jabhat al-Nusra in March 2014. Sunni Iranians — including Kurds — played an important role in that IS victory, according to Tawhid Qorishi, a 33-year-old Sunni man who spent six months with IS in 2013-2014 and is now in custody in Iran.

Soon rival militant groups were openly clashing in Paveh and other Iranian towns, with dozens of militants swinging clubs and machetes at each other in nearby Javanrud. Iran’s Interior Ministry finally took notice in June 2014 and sent two experts to investigate.

“As a result of intense [IS] propaganda … many Iranian Kurdish Salafists have expressed readiness to join them in Iraq, with many having already traveled to Syria,” the ministry's report concluded. “They are being portrayed as the heroes of jihad against oppression and apostasy.”

The authors singled out the Hawraman region around Paveh as a danger spot where Salafi groups were active. They predicted that more Iranian Sunnis, including Kurds, would join IS in the coming years and described its so-called caliphate as an “active threat to the internal security of the Islamic Republic of Iran.”

In many ways, the authors’ recommendations were the mirror opposite of the government’s unwritten policy in Kurdish areas. They called for more breathing space for moderate Sunni clerics and NGOs, propping up moderate Sufi clerics and clamping down on Salafists.

Unsurprisingly, the public report was quickly shelved. Local authorities began to arrest the most violent militants, but other Sunni extremists still got away with harassing local residents as they sought to impose their own version of Sharia.

Not until the attack on the capital did Tehran begin to come to terms with the monster it had unleashed. Within days, many Salafists were rounded up along with their wives and children, area residents told Al-Monitor at the time. Others went into hiding or shaved their beards to avoid the prying eyes of local informants.

Sadeqi’s brother, a local Salafist named Ahmad, was sentenced to 10 years in prison in October. His family was left destitute and his parents, who are suffering from cancer, survive thanks to local charities, an NGO worker told Al-Monitor. The lawyer from Paveh who has represented jihadis said at least a dozen more Salafists were sentenced to two to three years in prison. Several others are awaiting trial.

Friends and family bury Bahram Fatehi in January 2017. Noryaw.ir

Today, Paveh and the surrounding Kurdish countryside are relatively quiet, with the Salafists either in jail or keeping a low profile. Fatehi’s tea house has been shut down ever since the young man’s brutal slaying, but his former customers can once again smoke hookah pipes without getting harassed while their wives and girlfriends feel safe to dress more freely.

Below the surface, though, a lingering fear persists: Is Tehran finally serious about confronting its jihadi menace? Or is this crackdown, like so many before it, only temporary?