The inauguration of Donald Trump has created considerable anxiety for Iran’s president Hasan Rouhani. The Iranian incumbent, who’ll be running for a second term in May, knows well that the fate of his main legacy, the nuclear deal (formally known as the Joint Comprehensive Plan of Action, or JCPOA), hangs on what the U.S. president-elect decides on relations with Iran.

In fact, Rouhani’s administration is stuck between a rock and a hard place. On one side, hardliners are mounting pressure, citing what they consider the meager results of the nuclear deal to convince the undecided portion of the public that the deal was a mistake. On the other side, the incoming administration in Washington is threatening to tear it up.

To make matters more complicated, Ayatollah Ali Khamenei, Iran’s Supreme Leader, added to the pressure on Rouhani’s government when he said on November 27, in reference to the U.S. Congress’s renewal of sanctions on Iran, that imposing new sanctions is no different than renewing existing ones.

Khamenei criticized Rouhani and his team without naming them, saying they rushed the deal. “When we are in a hurry … we ignore details and sometimes ignoring a trivial detail will create a hole and a negative point in that job.”

Uncertainty in Tehran

An Iranian official who spoke to me on condition of anonymity said that Trump’s election had increased uncertainty in Tehran. “All options are on the table. If Trump wants to live with Iran and the deal, we’ll live with him, and if he decided he wants to be a bad Trump then Iran will have to deal with the situation.”

The official said that Iran never planned around any particular outcome in the U.S. election. “It’s important to those who link their fates to the Americans, but not to us. We know [American presidential elections are] a choice between bad and worse, and we are yet to see if the winner was the worse.”

As the election results were still settling in, I asked a senior Iranian official on November 11 whether he thought Trump’s election meant the end of the deal. The official, who spoke on condition of anonymity, said that he’s not that concerned and that the newcomers to the White House had already started realizing the importance of the deal. The official suggested that what Walid Phares, an adviser to Trump, articulated as demands for changes in the deal is simply a walk back from the idea of tearing it up, because they’re not going to “flip flop overnight.”

A month later, in a security forum in Tehran on December 11, 2016, Iran’s defense minister Hussein Dehqan said he believed that Trump’s election wouldn’t upend the nuclear deal. “Considering Trump’s character and that he measures everything with dollars we don’t think he’ll take radical policies against our country,” the defense minister said. Yet in the same conference, Dehqan himself added that Trump’s advisors (he called them “assistants”) “might map a different path for him, and this has led to unease, particularly among Persian Gulf countries.”

Trump Viewed as a Hawk

In fact, Trump seems to have made it difficult for Iran to predict what he’ll do in office, not due to any ambiguity in Trump’s rhetoric but rather because of his frank, and often contradictory, rhetoric about Iran. Trump says he doesn’t want more involvement in the Middle East, he’s against regime change in Syria, and in favor of coordination with Russia over war with the Islamic State. On the other hand, Trump also says he wants tougher actions against Iran, he wants the nuclear deal changed, and his team of advisers is dominated by anti-Iran hawks.

“Policy makers in Tehran certainly prefer Trump over Clinton when it comes to regional issues,” Adnan Tabtabai, an Iran expert and CEO of the Germany-based think tank CARPO told me. “Clinton’s track record as secretary of state is viewed very negatively in Iran. Trump’s lack of knowledge and interest, in contrast, is welcomed. His lack of appetite for a prominent U.S. role in the region suits Iran’s overall principle of rejecting U.S. presence in the region.”

Clinton is seen in Tehran as a hawk in a dove’s clothing when it comes to Syria, due to a perception that the former secretary of state was much more radical on regime change in Damascus than anyone else in the Obama administration. Iranian officials also regard Clinton as much more experienced than Trump, which in their eyes, would have made her more likely to direct a foreign policy that ran counter to Iran’s regional interests, especially in Syria.

Still, Trump’s foreign policy nominees have raised concerns among Iranian officials, especially National Security Adviser Michael Flynn, as have the sharp view of some key Trump advisers like John Bolton, Newt Gingrich, and Rudy Giuliani.

“The entourage of Trump is composed of hawkish ideologues who may drive Trump towards a more proactive role in the Middle East,” Tabtabai said.

Hardliners Emboldened

To Supreme Leader Khamenei, the new American moment is a golden opportunity to promote his doctrine that calls for not trusting the United States, as he has said on several occasions in the past. Khamenei had to sip from the bitter chalice of watching his country’s officials negotiating with their American counterparts for the last three years since President Hasan Rouhani—who was not his preferred choice for president—and his team came to power.

Right-wing politicians and activists continuously described the nuclear deal negotiations and potential rapprochement as “the American Trojan horse to infiltrate Iran.”

Their hostility, however, does not necessarily mean the hardliners want to see the deal derailed. The outcome of the deal on both economic and political levels has been positive. Iran’s oil exports have tripled since 2015 as a result of the deal, and foreign investors have expressed new interest, although U.S. sanctions are blocking the way. Iran also signed two huge contracts to renew its ailing airplane fleet, one with Boeing and another with Airbus.

Politically, the Islamic Republic, free of UN Security Council and European Union sanctions, ended a phase of isolation that dominated its relations with the world in the past decades.

“Whether JCPOA is in place or derailed, Trump may try to stop foreign companies or countries from working with Iran. This can be the concern of both the right and the left in Iran” said Abass Aslani, international affairs editor at Iran’s semi-official Tasnim news agency.

Aslani, who covered the final round of the nuclear talks in Vienna back in July 2015, explained that those concerned have in mind several issues: “Trump might pressure the Europeans not to work with Iran, either by introducing new sanctions or via punishing companies that decide to deal with Tehran. Trump is an unpredictable person and he might do things which are unlikely.”

Iran Enjoying International Recognition

For Iran, the nuclear deal brings more than just economic and political benefits. Security calculations are just as important. The JCPOA can also be seen as an overall renegotiation of Iran’s relationship with world powers, reducing the risk of a military strike against Iran and quieting talk of regime change. Therefore, Iran is not likely to provide reasons for the deal to fall apart, at least not easily.

CARPO’s Tabtabai forecasts that the Iranian political elite expect the Trump administration to do whatever it can to weaken the deal, for instance, trying to reduce Iran’s economic benefits—while not being in open breach of the deal, as this might be too costly politically. In this case, he added “Iran will probably reciprocate by adopting controversial measures that are not against the deal. Military drills, missile tests and talk about nuclear fuel vessels are examples of such measures. By doing that, Iran seeks to send out a message of resilience and vigilance with internal and external effect.”

Iran will watch carefully to see if the rest of the P5+1 powers who negotiated the JCPOA follow Trump’s hawkish lead. Tabtabai believes that Tehran would move closer to Europe if Europe were willing to maintain friendly relations despite Trump’s rhetorical shift.

A Lifeline in Syria?

While the nuclear deal might cause tension between Tehran and Washington, the conflict in Syria could be an opportunity for both administrations to coordinate—if not directly then possibly via Russia. Trump has declared the Islamic State a greater threat than Syrian President Bashar al-Assad, bringing him in harmony with Iran, which considers Assad its main ally in the Middle East.

The war in Syria brought Iran and Russia closer than ever with both sharing the same interim goals. Yet in Iran there are many who question whether closer Russian-American coordination might affect Tehran. Iranian elites fear that this would mean their country could be deprived of its status as a main player in the both the Syrian and Iraqi conflicts. Another main Iranian concern is that such coordination might have a fatal impact on its main ally, Hezbollah, given both countries’ full commitment to Israel’s security (whereas the group is regarded as a main threat to it). If both concerns turned out to have solid basis then this would mean that the Islamic Republic of Iran literally came out of this costly and devastating war empty handed.

Iran is worried because its own cooperation with Russia has been largely opportunistic, driven by circumstances in Syria and subject to change and evolve along with those same circumstances.

Both Iran and Russia share short-term objectives in Syria, yet they part ways on core interests. Moscow is committed to the Syrian state and regime, while Tehran is far more invested in the person of Bashar al-Assad. So long as there are no alternatives, this Iran can count on Russia’s partnership, but if Trump is willing to forge closer ties with Putin, then Iran could find itself losing clout.

To Iran, any administration in Washington is a foe, and whoever rules the White House is an adversary until proven otherwise.

To Iran, any administration in Washington is a foe, and whoever rules the White House is an adversary until proven otherwise. There is therefore no shock in Tehran over a president with anti-Iran notions. Fears aggravated by Trump could persuade hardliners to unify against Rouhani’s bid for a second term. A moderate in Tehran is a poor bulwark against a hardliner in Washington, they could argue.

Iran’s upcoming presidential election, in May, will be the first test of the fragile moderate, pro-nuclear-deal coalition in Iran—and whether its conciliatory principles can survive in the age of Trump.