Almost three years ago, Greg R. Lawson wrote for the Atlantic Sentinel that the United States should “pivot” on the Middle East’s Shia-Sunni divide. Whether by design or not, the Iranian-led fight against the self-declared Islamic State and a possible nuclear deal with Tehran are pushing America in his desired direction.

Although the Obama Administration is reassuring its Arab allies that any agreement with Iran about its nuclear program will not involve a “grand bargain” with the Shia state, the Sunni monarchs and Turkey are nervous. Any form of rapprochement between Iran and the United States would come at the expense of their perceived role as Iran’s balancers. If the Americans see Iran as less of a threat to stability in the Middle East, there is less of a need to maintain awkward alliances with unsavory regimes on the other side of the Persian Gulf and a now blatantly antisemitic government in Ankara.

The Arabs see the writing on the fall. President George W. Bush toppled the Iraqi dictator Saddam Hussein in 2003, removing Iran’s primary obstacle to expanding its influence into the Levant. His successor, Barack Obama, withdrew America’s support from Egyptian strongman Hosni Mubarak in 2011 and later refused to join Saudi Arabia and the other Sunni states in wholeheartedly backing the opposition against Iran’s Syrian ally, Bashar al-Assad.

Iran also expanded its influence in Baghdad during the prime ministership of Nouri al-Maliki, a Shia Muslim who spent decades in exile in Iran when Saddam Hussein was in power.

To the dismay of some American strategists, the United States have since allowed Iran to spearhead the war against Islamic State militants in Iraq as well as Syria. Iranian officers are on the ground aiding their Iraqi counterparts while the Western allies do little more than bombing terrorist targets.

The former American commander in Iraq, General David Petraeus, warns in an interview with The Washington Post that Iran is ultimately still part of the problem, not the solution.

The more the Iranians are seen to be dominating the region, the more it is going to inflame Sunni radicalism and fuel the rise of groups like the Islamic State.

Gary Anderson, a retired Marine Corps colonel, agrees, arguing in Foreign Policy magazine that effectively ceding this fight to Iran is a mistake, one that will leave it the region’s de facto hegemon and virtually ensure a regional Shia-Sunni conflict zone with global impact.

If Iraq is not a vassal state of Iran, it is certainly a failed state which will effectively be dominated by Iran if the Shiite-led militias triumph.

This is certainly the Arabs’ fear. They worry that Obama will accept Iran’s strategic gains in not just Iraq but places like Lebanon and Yemen as well in order to get a deal that will stop it from building nuclear weapons. In the former, Iran’s Hezbollah proxy is virtually in control of the country. In the latter, Iranian-backed Houthi rebels have taken over the former North Yemen and are battling an internationally-recognized remnant state in Aden.

But is it really in America’s interest to stay on the side of the Sunnis instead?

Iran’s clerical regime is a heinous and oppressive one but hardly far more despicable than the Saudis’. Iran exports terrorism but so, writes Ameer Ali in The Australian , does Saudi Arabia. Many of the Middle East’s jihadists either were or are financed and inspired by Saudi sheikhs and Saudi preachers. Iran is the enemy of America’s allies but those allegiances can change. What matters in the end is: does one side threaten America’s core interests so much that there is no alternative to an alliance with the other?

There is reason to doubt Iran is such an incorrigible, mortal enemy. Its aggression can reasonably be construed as a reaction to the security situation it faces in the Middle East, much of which owes to American policy.

Andrew Murray and Sean Matthew Tuohy suggested at the Atlantic Sentinel in 2013 that where the United States have utilized a policy of containment to blunt Iran’s ambitions as a regional power and minimize its ability to interfere with American strategic interests, Iran has pursued a strategy of deterrence, “an approach that is the result of Iran’s perception of its vulnerabilities.”

Its funding of Islamist terrorist groups, notably Hezbollah in Lebanon, is an effort to counterbalance the hegemony of Israel and the United States in the region. The question is, has Iran supported Hezbollah (and others) for ideological and religious reasons or has it done so for geopolitical reasons? Using the realist framework as a basis, it is feasible to argue that Iran uses its position as the only Islamic republic, not only to “promote the revolution” but to form a rejectionist axis against perceived Western imperialism in the Middle East.

To what extent Iranian leaders actually believe what they’re saying is a question Western analysts still haven’t been able to answer decidedly. But it seems safe to assume they care at least as much about their rational security interests as they do about their irrational ideological pursuits.

Iran is also inherently more stable than its competitors, the private intelligence company Stratfor’s Robert D. Kaplan and Kamran Bokhari have argued. Whereas Saudi Arabia is “built around the parched and deeply conservative upland of Najd which has always struggled to subdue the more cosmopolitan maritime peripheries like Hijaz,” Iran is a coherent geographical entity that “straddles the Middle East and Central Asia as well as the two energy producing regions of the Persian Gulf and the Caspian Sea.”

Rather than an artificial contrivance of a single family, Shiite Iran — with its relative geographic logic — is heir to Iranian states going back to antiquity, when Persia was the world’s first superpower. Iran encapsulates a rich and eclectic civilization. Even under the present regime, in Iran there is a semblance of a democratic foundation, while in Saudi Arabia there is an utter lack of any sense of democracy.

Ali agrees, writing that the oil kingdoms “lack popular legitimacy and export their puritanical ideology to destabilize the Westphalian world order.”

Surely Iran hasn’t always acted in the best interest of such a stable order, nor in the best interest of a balance of power in the Middle East, but it is at least a proper nation, not a family enterprise like Saudi Arabia or the United Arab Emirates.

Withdrawing what Iran perceives to be American threats to its security is unlikely to shake up its behavior. After decades of confrontation and amid an ongoing cold war with its Sunni rivals, Iran is not suddenly going to play nice just because the United States pack up and go home.

Americans should also be under no illusions about the damage Iran can do. Even if Murray and Tuohy are right and its foreign policy is defensive at heart, the consequences of Iran’s ideologically-infested strategy can be horrendous.

The American Interest ‘s Adam Garfinkle pointed out last year that Iran’s hegemonic exertions had “raised an existential threat to the Sunni Arab regimes” and “radicalized heretofore mostly latent sectarian cleavages in the region.”

When the feeble Sunni Arab states proved feckless in responding, the radicalization process, with mischievous help from countries like Qatar as well as Turkey, created the monster that is ISIS. The point? It is not possible to extirpate ISIS unless we also address its source: Iranian power projection through Arab Shia militias (which, by the way, extends all the way to the Houtis in Yemen).

Petraeus is saying more or less the same thing and he is right.

America shouldn’t wish for an alliance with a regime that does such damage. But is not a matter of picking sides.

Indeed, that is the point Lawson was making three years ago. He didn’t suggest that America should shift from an alliance with the Sunni world to an alliance with the Shia state. Rather, he called on the United States to “seize the geopolitical initiative” and be “the decisive weight on the scale of Sunni-Shia relations.”

If Iran and the United States can come to some terms, the ability to tilt between the Sunni Saudi and Turkish regimes and the Shia ascendancy in Iran and Iraq will be possible.

This would no doubt be disconcerting to America’s Arab and Turkish allies and could foment unrest in the short term. But American security is not dependent on stability in the Middle East, nor is its economy anymore.

The Arab Gulf states’ inherent regime instability and the United States’ partisan allegiances in the Middle East’s sectarian conflicts — which make it vulnerable to power shifts — suggest it could altogether do better with Iran than contain it. In the long term, some form of accommodation could help advance American strategic goals.

America and Iran share an aversion to radical Salafism and the religious warriors it produces. Neither wants to see Sunni fanatics establish a state in the heart of the Arab world nor see the fanatical Taliban return to power in Kabul. Nor does nearby India which seeks to strengthen its security ties with the United States in order to balance against China’s rise in Asia but which is also dependent on Iranian oil and gas supplies. American-Iranian discord stands in the way of a great power settlement in Afghanistan as well as closer American-Indian relations.

Moreover, a cornered Iran could seek an alliance with an equally aggrieved Russia, raising the specter of Iranian-Russian domination in the Caspian Sea region and Central Asia — where the two are still more competitors than collaborators — and Russian access to the Persian Gulf and Arabian Sea, a longtime Russian strategic goal America successfully blocked during the Cold War.

From America’s perspective, it is far more important that India joins its liberal, maritime world order and helps prevent China from establishing a “new type of major power relations” that is based on intimidation and fear than it is to keep the Arabs and Turks happy. It is even more important to stave off any possibility of a Sino-Russo-Iranian condominium in Central Asia that would represent the sum of all American fears: a single, hostile entity dominating the bulk of the Eurasian landmass.

If the price of safeguarding those long-term goals is more trepidation in the capitals of the Middle East, it is a price America is probably willing to pay.