The choice seems simple. On one side are regally attired mullahs, the type that have protected Persia’s pre-Islamic treasures and even tweet in English. On the other side is the Islamic State (ISIS), with its conquest, rape, and pillage. Muhammad-Javad Zarif, Iran’s foreign minister, has made the pitch better than anyone. “The menace we’re facing—and I say we, because no one is spared—is embodied by the hooded men who are ravaging the cradle of civilization,” he warned, dangling out the possibility of rapprochement between Washington and Tehran against ISIS.

Beneath such expressions of concern, however, is a more cynical strategy. Iran is using ISIS’ ascendance in the Middle East to consolidate its power. The country is now the key ally keeping Iraq’s Shiites and the Alawite Bashar al-Assad regime standing against well-armed and tenacious Sunni jihadists. In those battles, Tehran will likely do just enough to make sure the Sunnis don’t conquer the Shia portions of Iraq and Assad’s enclave in Syria, but no more. Meanwhile, in ISIS’ wake, Tehran will strengthen its own radical Shia militias.

The result could be a permanent destabilization of the Arab heartland. That would be a major victory for the Islamic Republic, which has seen its fortunes rise as Egypt and Turkey have become mired in crises and as Saudi Arabia, Iran’s one remaining serious Sunni rival, has gotten bogged down in a war in Yemen.

Shiite fighters launch a rocket during clashes with Islamic State militants on the outskirts of al-Alam, March 8, 2015. Thaier Al-Sudani / Reuters Iran’s model for operating abroad draws from its experiences in Lebanon in the early 1980s, when the regime amalgamated a variety of Shia parties into Hezbollah. Under Iranian guidance, Hezbollah targeted the United States, finally driving the country out of Lebanon by bombing the U.S. marine barracks in Beirut in 1983. That attack remade Lebanon; ever since, Tehran has had a commanding voice in the country’s politics and Hezbollah has served as its terrorist proxy and its most destructive auxiliary force in the Arab world.

The Islamic Republic repeated the Lebanon model in Iraq after 2003. Tehran had two complementary objectives: drive the United States out and prevent the formation of a new anti-Iranian Iraq. Once again, Iran turned to the development of radical Shia militias. The paramilitary outfits lacerated U.S. forces and intimidated, and sometimes killed, secular Shiites and recalcitrant Iraqi clerics.

U.S. Secretary of State John Kerry speaks with Hossein Fereydoun (C), the brother of Iranian President Hassan Rouhani, and Iranian Foreign Minister Javad Zarif, before the Secretary and Foreign Minister addressed an international press corps gathered at the Austria Center in Vienna, Austria, July 14, 2015. Reuters In 2011, Tehran achieved a resounding success with the U.S. withdrawal. Since then, however, it has had trouble controlling independently-minded Iraqi Shiite leaders. ISIS was thus a blessing. Neither a flatfooted United States nor the crumbling Iraqi army could muster an effective response. Iranian advisors and Shiite militias stepped into a vacuum, safeguarding Baghdad and consolidating Tehran’s influence with Iraq’s Shia population.

Iran once had to be discreet in Iraq. Qasem Soleimani, the commander of the Quds Force, the primary expeditionary unit in the Islamic Revolutionary Guard Corps, moved around in near secrecy so as not to rile Iraqis who were wary of having Persian overlords. Further, Tehran used to care a great deal about what the Iraqi Shia clerical establishment, led by Grand Ayatollah Ali Sistani, was doing. Directly and through proxies, the Iranians mixed flattery, subventions, and a bit of intimidation to get their way in Najaf and Karbala, the great centers of Islamic learning in Mesopotamia. But those days are over. With the rise of ISIS, and the consequent rise of Iranian hard power, Tehran has become noticeably less concerned about Iraqi perceptions and intra-clerical harmony.

Members of the Iranian army's land force march during a parade to commemorate the anniversary of the Iran-Iraq war (1980-88), in Tehran, September 22, 2010. Morteza Nikoubazl / Reuters Gone, too, are the days in which Tehran worried much about moderate Sunnis. Throughout the 1980s and the 1990s, Iran assiduously practiced an ecumenical approach to radical Sunnis. President Ali Akbar Hashemi-Rafsanjani, and his aide de camp, Hassan Rouhani, spearheaded this outreach, trying to get Sunni Arabs to focus on the common enemy, the United States and Israel. Lebanese Hezbollah, with Imad Mughniyya in the lead, played an essential role in helping the mullahs bridge their differences with Arab Sunni militants.

Yet the Islamic Republic’s efforts produced only marginal success: a few Sunni groups aligned themselves with Tehran; more were willing to take the mullahs’ money and weaponry. Al Qaeda sporadically accepted Iranian assistance and badly damaged the United States. But Tehran’s ability to force Arab governments to accept its priorities remained limited. Tehran has always known that in the Islamic heartland of the Middle East, Shias and Sunnis are almost evenly matched in numbers. By embracing sectarianism, Iran now plays a pivotal, if not dominant, role throughout the region.

If Sunni radicals were to establish terrorist cells inside Iran’s minority Sunni communities, Tehran might want to throttle ISIS. Barring that eventuality, however, the clerical regime has no interest in diminishing the sectarian bloodbath that has allowed it more influence than at any time since the 1979 revolution. At best, anti-Americanism brought Tehran fellow-travelers; ISIS, however, has given the regime its best shot at an empire. For Iran’s ruling elite, Shia-hating Sunnis have never looked so good.