As predicted, the June 7 terrorist attacks in Tehran have complicated the rule of newly re-elected President Hassan Rouhani and his pragmatic coalition. More aftershocks have occurred, some of which potentially threaten his tenure.

To understand the complexity of the situation, a short note on the political system of the Islamic Republic of Iran is in order.

The system, referred to as a negotiated political order, was a compromise between Ayatollah Ruhollah Khomeini, who wanted to create a theocracy ruled by the velayt a- faqih (religious guardian), and those in his entourage who understood that the public demanded democratic representation. The 1979 Constitution provided for a complex mixed system in which the state sector vies for power with parastatal organizations. A circumscribed public vote elects the president, who presides over the executive branch. The parastatal sector, comprising the Revolutionary Guards, which run a substantial chunk of the economy, and large foundations (bonyads), are not accountable to the state and its institutions.

In principle, the Supreme Leader oversees settling the frequent disputes between the state and the parastatals. Khomeini’s successor, Ayatollah Ali Khamenei, set up the Rahbar’s (Leader’s) Office, which was staffed with aides who liaised with the various branches of the government and the parastatals. In addition to chairing the Supreme National Security Council, and commanding the Quds Force, the external operations arms of the Revolutionary Guards, Khamenei heads the “Setad Ejraiye Farmane Hazrate Emam” (Headquarters for Executing the Order of the Imam), one of the largest bonyads.

Over the decades, the various sectors of the Islamic Republic have coexisted through a series of uneasy balances and power struggles. For instance, when President Mohammad Khatami tried to reform the political system, the Guards, supported by Khamenei, stripped the presidency of much of its power. The Basij, a voluntary paramilitary organization operating under the Revolutionary Guards, and several shadowy auxiliaries launched coordinated violent attacks on Khatami and his supporters, some of whom were murdered or went missing. Khatami appealed to the Supreme Leader, who sided with the parastatals. Although Khatami served out his second term, for much of that time, he was a virtual lame duck.

Buoyed by a resounding victory in May over the hardline Ebrahim Raisi, Khamenei’s favorite, Rouhani hoped to challenge the legitimacy of the Supreme Leader and the parastatals. But his immediate concern is reform of the ailing economy and reducing the Guards’ control over vital enterprises. Rouhani has long complained about the so-called privatization that took place under his predecessor, Mahmoud Ahmadinejad. In Rouhani’s view, state-owned enterprises were largely turned over to a military state, which was not privatization. In a June 23 speech, Rouhani said, “Part of the economy was controlled by a gun-less government but now we have delivered it to a government with guns.”

Initially demoralized by their election defeat, the hardliners have utilized the Tehran terror attacks to turn the tables on Rouhani, accusing him of underestimating the internal and external threats to Iran. On June 14, Khamenei delivered a humiliating denouncement of Rouhani before an audience of senior officials, including the president, the judiciary chiefs and the speaker of Parliament.

The Supreme Leader followed up with a warning that Rouhani may face the same fate as Abolhassan Banisadr, the first president of the Islamic Republic. After less than 17 months in office, Banisadr was impeached on June 20, 1981. With his life in danger, he went into hiding and was subsequently smuggled out of the country.

Khamenei noted that, “in 1980-1981 the then president polarized society in two camps, and divided the country into opponents and supporters; this should not be repeated.” To make this point clear, the Rahbar’s Office website released a video of Banisadr’s impeachment. Khamenei contextualized the narrative by commenting that the present political situation resembled that of Banisadr’s time.

The annual celebration of Quds (Jerusalem) Day, the last Friday in Ramadan, offered another platform for undermining the president. The holiday originated in Khomeini’s declaration that after the 1979 revolution in Iran, Shi’ite Islam was henceforth the new liberator of Jerusalem and the Holy Land from the “Zionist enemy” or “Little Satan.” Khamenei elaborated on the subject by postulating that, based on Qur’anic readings, Israel would cease to exist in 2040. The festivities, organized by the Revolutionary Guards, the Quds Force, and the Basij, are known for fevered parades, calls to liberate Jerusalem with the “blood of the martyrs” and chants of “Death to Israel” and “Death to America.” Rouhani, aware of the damage to Iran’s international image, has tried to tamp down such hostile rhetoric.

But with the tension between moderates and hardliners running high, the 2017 Quds Day turned into a show of defiance against the president. A large digital “Doomsday Clock” showing that Israel would cease to exist in 8,441 days was unveiled. The Guards put on display three surface-to-surface ballistic missiles, including the Zolfaghar and the Ghadr, with a range of 2,000 km; the latter could reach Israel and American bases in the Middle East. For good measure, groups of demonstrators, allegedly organized by Hamed Talebi, a member of the hardline Mashregh News Agency, chanted “Rouhani, Banisadr, happy union to you.”

Unlike the hapless Banisadr, Rouhani, who has a large following among the middle classes and younger Iranians tired of the stifling theocracy, faces little danger of impeachment. The Guards and the Supreme Leader, fear unrest — which, according to secret estimates of the Ministry of Intelligence and Security, would dwarf 2009 post-election protests – and are not likely to remove Rouhani. Rather, they seek to undermine Rouhani’s legitimacy and block his plans to realign the system with public sentiments. Indeed, in a veiled signal to the Supreme Leader, Rouhani noted that, “ISIS is not the only one who can threaten our security. Government, parliament and the judiciary can also threaten our security by setting rules and provisions which can disrupt our peace.”

At such a tense time in Iran, pressure from the United States can only strengthen the hardliners and hurt Rouhani. Friday prayers leaders in Tehran, Mashhad, and other cities have attacked Rouhani’s efforts at detente with the United States and called on Iranians to follow the advice of the Supreme Leader, who has argued that Washington’s promises can never be trusted.  The Guards’ Fars News Agency stated that instead of “begging Trump for crumbs,” Iran should strive to defeat the “Great Satan.”

The US Senate has approved new sanctions against Iran. The Trump administration, while grudgingly complying with the nuclear agreement, has harshly criticized Iran’s regional and domestic actions and is embroiled in a lengthy review of Iran policy. Iran’s complex negotiated political order should be taken into consideration before deciding on any drastic changes in US policy.

Dr. Farhad Rezaei is a research fellow at Center for Iranian Studies (IRAM) in Ankara where he researches Iran’s foreign policy. He is the author of Iran’s Nuclear Program: A Study in Proliferation and Rollback  (New York: Palgrave Macmillan, 2016). His writings have appeared in Harvard-Iran Matters, Atlantic Council, the National Interest, Middle East Policy, British Journal of Middle Eastern Studies, Journal of International Affairs,  Insight Turkey and  Asian Affairs among others. His new book is Iran’s Foreign Policy after the Nuclear Agreement: The Politics of Normalizers and Traditionalists, Palgrave Macmillan, forthcoming. He tweets at @Farhadrezaeii