Saudi Arabia’s execution of prominent Shi’a cleric, Sheikh Nimr al-Nimr, is a gift in disguise to Iran’s hardliners seeking to undermine President Hassan Rouhani’s administration, and rally support ahead of key elections in February.

Although Saudi officials have insisted Iran is interfering in its internal affairs with its vociferous condemnation of the execution, Iranians, particularly the hardliners, saw the act as a direct provocation.

The latest round of tension has galvanized Iran’s hardliners and provided an additional headache to Rouhani and reformists intent on improving Iran’s international image. The Saudi execution touched on the sensitive political fault lines in Iran that have been at loggerheads over the nuclear deal, and are headed for battle in crucial parliamentary and Assembly of Experts elections next month.

While the Saudi leadership appears unified and consistent in pursuing its Iran strategy, in Tehran, the policy toward Saudi Arabia is anything but. Up to this point, it is unclear which interested state agencies in Tehran orchestrated the January 3 attack on the Saudi embassy, but much speculations and incriminations are already under way.

Within hours of the Saudi embassy coming under attack, a horrified Rouhani lambasted the culprits, calling it a shameful act and highly damaging to Iran’s international image. The incident was antithetical to the Rouhani administration’s strives to bring Iran back to the international mainstream and put the bad old habits of embassy-seizures and hostage-taking behind it.

With international sanctions on Iran due to be lifted over coming months, the image of a mob running amok in Tehran gives little confidence to foreign investors who have otherwise been significantly interested in the hungry 80-million Iranian market. A more internationally positive image of Iran has surprisingly a lot of bearing on the prospects of Rouhani and whether his political allies can do well in the upcoming elections.

An Iran that can return to global markets is deemed by Rouhani’s inner circle as a critical prerequisite for revamping the country’s ailing economy. In turn, improving economic conditions—a key election promise of Rouhani from 2013—will have a direct input on the prospects of Rouhani and his allies at the ballot box.

The economy has in fact supplanted the nuclear issue as the most sensitive policy question in Iran today. As soon as the nuclear agreement was signed, Rouhani’s hardline foes turned to his economic policies and lack of progress as his Achilles heel. This is why the potential economic fallout from the incident at the Saudi embassy is that much more sensitive for the Rouhani government.

The hope in the hardline camp is to show that the president’s pledge that a nuclear agreement is the path to economic restoration was from the outset a mere smoke screen to make excessive concessions to the West during nuclear negotiations. The charge levelled against Rouhani as weak in the face of foreign adversaries is also very much relevant in the context of the dispute with the Saudis. Even though Rouhani was quick to condemn the attack on the embassy, he had to balance it by also speaking strongly against Riyadh and banning Saudi imports to the Islamic Republic. Not doing so would have given his critics in Tehran more ammunition to depict him as an unsteady president at a time of heightened regional challenges for Tehran.  

To be fair to Rouhani, the Saudis have not given him much to work with. When he came to office in 2013, he vowed that he would seek to find common grounds with Riyadh. But Rouhani’s overtures toward the Saudis were largely left unanswered. Throughout Rouhani’s tenure, the Saudis have felt Iran had the upper hand in regional battlegrounds like Syria and Iraq and were not interested in launching a diplomatic process with Tehran while in the weaker position. When Foreign Minister Javad Zarif gambled and visited Riyadh in January 2015, he was promised his Saudi counterpart would reciprocate. It never happened, leaving the hardliners back in Tehran to mock Rouhani and Zarif’s “smiling diplomacy” as clueless. The hawkish Saudi government under King Salman has doubled-down in its hostility toward Iran and turned a cold shoulder to Rouhani’s diplomatic overtures.

It is highly probable that the organized forces that attacked the Saudi embassy are the same ones who opposed Rouhani’s nuclear deal. They want to make sure that this moderate Iranian president is not able to pursue his broad policy of rapprochement unhindered.

Among the major power factions in Iran that have the capacity to orchestrate such attacks is the Islamic Revolutionary Guard Corps (IRGC). This hardline interest group fears that Rouhani’s policy of détente with the world and reform agenda at home will undermine its influence. The corps has hence continuously opposed Rouhani whenever possible.

The IRGC is also the most anti-Saudi element in the power structures in Iran. It sees itself as directly engaged in a war with Riyadh. In an unusual move, the IRGC command quickly condemned the attack on the Saudi embassy, but its public disapproval is so far unconvincing given the repeated threats it has levelled against Riyadh in the wake of Nimr’s execution.

IRGC generals have too many vested interests that points to them and their lesser surrogates as the torchers of the Saudi embassy. The single act of attacking the Saudi embassy yielded two intended results: it undermined Rouhani, and signaled that at least the IRGC generals are not interested in engagement with Riyadh.     

It should also be noted that the frenzy in Tehran on January 3 began when Iran’s Supreme Leader Ayatollah Ali Khamenei spoke of “divine vengeance” against the Saudis for executing Sheikh Nimr. That was in effect a green light to the rioters, and it is a reality that will shield those who torched the embassy from punishment despite claims to the contrary by top officials in Tehran.

Despite their entrenched animosity, the Saudis and Iran’s hardliners share a goal to weaken Rouhani and his reformist allies, and derail the Iranian president’s rapprochement with the United States. Whether or not Nimr’s execution was intended as a gift to Iran’s hardliners, it will no doubt give them greater momentum heading into the elections.