The rapidly escalating conflict between Saudi Arabia and Iran, sparked by the execution of a Saudi Shiite activist, may seem like the natural outgrowth of a decade’s Sunni-Shiite tensions. But more than denominational differences, what’s driving the open conflict is the Saudis’ deepening fear that the U.S. is shifting its loyalties in the Persian Gulf region from its traditional Saudi ally to a gradually moderating Iran. And in a sense, they’re right: Although the U.S. is a long way from becoming an instinctive Iranian ally, the nuclear deal has led Washington to start broadening its base in the Gulf, working with Iran where the two sides have overlapping interests. Of which there are many these days.

The Saudis executed the activist, Nimr al-Nimr, last weekend because they wanted to send a message to the country’s Shiite minority and neighbors, and because they thought they could get away with it. The outspoken al-Nimr symbolized the possibility that Saudi Shiites might never fully accept their second-class status and, worse, might seek autonomy or independence in the event of the Saudi state’s weakness. The Saudis seem to have calculated that if Iran made any noise about the execution, it would not have leverage to do anything about it. Undoubtedly the Saudis knew the Americans wouldn’t be best pleased with them for killing a nonviolent activist — but again, they must have thought it wouldn’t matter.

Executing al-Nimr was thus probably intended to demonstrate that the Saudis can go it alone, making security-related decisions without worrying what their neighbors or the U.S. think. If that’s right, the execution was an indirect signal that Riyadh is feeling isolated, and that if isolated, it will act unilaterally.

Here the Saudis overplayed their hand. The Iranians reacted cleverly. First, the government stirred up public sentiment by condemning the execution. Then, it allowed angry protesters to storm the Saudi Embassy in Tehran. Finally, the Iranian government shut down the protest, made arrests and issued public statements disclaiming responsibility for what had happened.

To be sure, the Iranian government is a complex organism with many moving parts, and the whole response likely wasn’t planned or coordinated by a single actor. But the result was effective. It showed the Saudis that Iran took the execution as directed toward it. And it simultaneously gave other countries the cover they would need to side with Iran.

The Americans, rather remarkably, took the Iranian side. U.S. Secretary of State John Kerry let it be known that he was talking to his Iranian counterpart. In the past, a U.S. secretary of state would’ve reached out solely to the Saudi foreign minister, not least because there were no official diplomatic ties to Iran. Meanwhile, a former deputy CIA director, Michael Morell, publicly praised the Iranians for their handling of the situation in Tehran. This was astonishing, given Americans’ historical associations with embassy occupation there.

These reactions show that Saudi worries about American abandonment are to a degree justified. After the Iran nuclear deal, American foreign policy makers can look at an episode like the al-Nimr affair and ask: Whose fault is this? If the answer is the Saudis, the U.S. can now afford to side with Iran.

More broadly, this shift reflects increasingly overlapping U.S.-Iranian interests. Both want to stabilize Iraq, including by keeping the Iraqi Sunnis in a secondary position. Both would like to defeat Islamic State, a relatively low priority for the Saudis, who either don’t fear the Sunni militant group or fear it so much they don’t want to join the battle.

There are still plenty of points where U.S. and Saudi interests converge, and oppose Iranian interests. Both sides dislike Syrian President Bashar Assad and want Hezbollah to have less, not more power in Lebanon. Both want to stabilize Egypt and indeed the region more broadly, creating a broad-based Sunni alliance to balance Iranian expansion.

But an alliance based on accidents of converging policy is a lot less solid than what Saudi Arabia traditionally had with the U.S., namely an alliance based on reliable, instinctual friendship. In that longtime relationship, the Americans ignored Saudi human-rights abuses and absolutism, and the Saudis turned a blind eye to unflinching U.S. support for Israel. Among close friends, such aberrations can be forgiven. That’s now changing, and the Saudis are understandably feeling nervous about it.

The painful truth for the Saudis is that the U.S. and Iran are plausible strategic allies, whose once close relationship was disrupted by the Islamic Revolution. The U.S. preference for Saudi Arabia in the Gulf was the result of Iranian intransigence and ideology, not any inherent strategic advantage possessed by the kingdom.

A Republican president, urged on by Israel, might conceivably try to roll back the Obama administration’s steps to realignment, and bring back the good old days for the Saudis. And Hillary Clinton might be tougher on Iran than President Barack Obama has been. But foreign policy continuity on Iran is likely, regardless of rhetoric. Any president will need to try and produce wins on Islamic State and Iraq — and those can’t be achieved without Iran.

Noah Feldman, a Bloomberg View columnist, is a law professor at Harvard University.

In a time of both misinformation and too much information, quality journalism is more crucial than ever.
By subscribing, you can help us get the story right.