Iranian-Saudi hostilities peaked during the 1980-88 Iraq-Iran war when Saudi Arabia poured billions of dollars into financing Saddam Hussein with the aim of toppling the Iranian government, which had promoted the export of its revolution.

At the conclusion of the war, however, from 1989 to 2005, during the presidencies of centrist Akbar Hashemi Rafsanjani and reformist Mohammad Khatami, relations between the two states improved to such an extent that their leaders met in Tehran and Riyadh and in 2001 signed a security pact on terrorism and drug trafficking.

The pendulum shifted again following the election of Mahmoud Ahmadinejad in 2005. Radicals supported by Iran’s supreme leader, Ayatollah Ali Khamenei, took over Iran’s foreign policy. Iran sought to project its influence in Iraq politically as well as militarily through Shia proxies. Concurrently its nuclear program emerged as a full-fledged international crisis. Both developments made the Saudis extremely nervous.

The unrest in Syria, which began in the early spring of 2011, created the ground for a proxy war between the two states that has escalated despite Ahmadinejad’s succession by a more pragmatic president, Hassan Rouhani. Amid a heated rhetorical battle between Saudi Arabia and Iran, in a clear sign of a desire for rapprochement, Mohammad Javad Zarif, the Iranian foreign minister, congratulated his Saudi counterpart’s appointment. But the Saudi foreign minister responded harshly.

The conciliatory efforts by Rafsanjani and Khatami would have not borne fruit if the Saudis had not responded in kind.

The Saudis were a cautious and geopolitically conservative player on the international stage for decades. However, they shifted foreign policy dramatically when King Salman was crowned following the death of King Abdullah in January 2015. The current Saudi policy toward Iran is ultra-aggressive.

Combined with Iran’s own escalation in support of the Assad regime in Syria, the conflict between the Muslim world’s two powerhouses has resulted in a dangerous rise sectarianism and competition over regional hegemony.

Saudi Arabia is fiercely confronting Iran’s expanding influence, which it views as a catalyst for a Shia uprising that could potentially disintegrate the Saudi state. Shias, who according to some estimates form 10 to 15 percent of the Saudi population, are concentrated primarily in the Eastern Province, home to Ghawar, the largest oil field in the world.

Since the Iranian Revolution in 1979, Saudis have witnessed several Shia uprisings that have led to clashes with police and anti-riot forces. It could be safe to assume that the Saudis would not have entered such a high-risk, high-cost conflict with Iran had it not perceived a threat from the Shia minority.

The Saudis are using every means at their disposal to defeat Iran in the Muslim world, challenging and confronting it in Lebanon, Syria and Iraq and bombarding Yemen to defeat Iran-backed Houthi rebels. However, for a number of reasons, the Saudis are unlikely to succeed.

Ayatollah Khamenei has repeatedly emphasized his opposition to making strategic concessions under coercion. Iran’s nuclear program is a case in point. Iran was adamant about retaining the ability to enrich uranium domestically while the United States and Israel initially insisted on a complete halt to Iranian enrichment.

Iran’s leader, under the immense pressure of sanctions, revised a solid position of “no talks with the Great Satan” by introducing the concept of “heroic flexibility” in diplomacy. But no progress would have been made toward the resolution of the crisis if the United States had not abandoned its decade-long policy of “zero uranium enrichment inside Iran.” Notably, even military threats by the United States – and, more seriously, Israel – did not make Iran bend.

Serious secret meetings began in March 2013 in Oman after then Deputy Secretary of State William Burns conveyed a message from President Barack Obama that he would be prepared to accept a limited domestic enrichment program in Iran as part of a nuclear deal.

Saudi Arabia, which would rely on the United States were a military confrontation to occur between it and Iran, was understandably upset by the nuclear agreement. In the Saudi view, the Obama administration has linked survival of the nuclear deal to the stability of the Iranian regime. In other words, any effort to destabilize the Iranian government would be tantamount to undermining the nuclear agreement.

The next US president, be it Hillary Clinton or Donald Trump, will most likely not have the same level of engagement with Iran that Obama has had and will be unfriendly to the Islamic Republic. However, despite both candidates’ anti-Iranian government rhetoric, it is unlikely that the next administration would support the Saudis in their confrontation with Tehran to the point where the Joint Comprehensive Plan of Action (JCPOA) is put in jeopardy.

The JCPOA is not a bilateral deal between the United States and Iran, but a delicate and complex agreement involving all world powers and blessed by the United Nations. Therefore, it seems that when the moment of truth arrives for the next US president, Washington will be unlikely to unilaterally abandon the deal and risk adding more chaos to the turmoil-ridden Middle East.

Meanwhile, current Saudi policies are unlikely to tame hardliners in Iran. During the decade-long nuclear crisis, the West’s confrontational stance resulted in a significant expansion of Iran’s nuclear program and almost brought the United States and Iran to the brink of a disastrous war.

Applying this lesson to the Iran-Saudi case, the more aggressive the Saudis become, the more Iran’s foreign policies will be determined by hardliners. Policies will be radicalized, marginalizing moderates.

The history of Saudi-Iran relations shows that more pragmatic approaches will bring better results.

Shahir Shahidsaless is an Iranian-Canadian political analyst and freelance journalist writing primarily about Iranian domestic and foreign affairs. He is the co-author of Iran and the United States: An Insider’s View on the Failed Past and the Road to Peace. He is a contributor to several websites with focus on the Middle East as well as the Huffington Post. He also regularly writes for BBC Persian.