DUBAI, United Arab Emirates (AP) — U.S. President Donald Trump angered Iran with his speech on refusing to re-certify the nuclear deal, but Tehran is unlikely to walk away from the agreement in retaliation.

Brinksmanship aside, Iran needs to sell its oil on the international market as allowed by the atomic accord. And politically, Trump's speech helps the same hard-liners America's president says he wants to target, offering them a convenient punching bag as many Iranians took his words as a personal insult.

"Iran relents when it faces international unity and lacks domestic unity," wrote Karim Sadjadpour, a senior associate at the Carnegie Endowment for International Peace in Washington. "Trump is unifying Iran internally, splintering international unity."

In particular, Trump's insistence on using the term "Arabian Gulf" in place of the Persian Gulf riled the Iranian public. Online, Iranians shared historical maps and videos of former U.S. presidents all calling it the Persian Gulf. Many saw it as a nod to the Gulf Arab states of Saudi Arabia and the United Arab Emirates, two major U.S. allies that long have criticized the nuclear deal.

The comments could also be seen as validating Supreme Leader Ayatollah Ali Khamenei's longtime warnings against trusting the U.S. or expanding negotiations beyond the narrow scope of Iran's nuclear program.

Since Trump's speech, which puts the burden on Congress to decide the nuclear deal's fate, Iranian officials have threatened that they too could decide to unilaterally walk away.

"If someday our interests are not realized and other parties want to violate their commitments, they should be aware that Iran will not hesitate a moment," warned Iranian President Hassan Rouhani.

But the posturing belies the fact that Iran can ill-afford to risk the deal, which lifted crippling international sanctions in return for restrictions on its nuclear activities.

Iran rushed back into the global oil markets once the deal took effect, boosting its gross domestic product by 7.4 percent in the first half of 2016 and 2017, recovering from a recession in the period prior, according to the International Monetary Fund. That's even with global oil prices now halved, after falling from highs of over $100 a barrel in the summer of 2014.

U.S. lawmakers have about two months to decide whether to put the accord's previous sanctions back into place, modify them or do nothing.

But even if Congress restores all the pre-2015 sanctions, Iran could agree to a revised deal with Britain, China, France, Germany, Russia and the European Union, the other parties to the accord, which have been telling Trump's administration to stay in. That would hurt Boeing and other American companies, and make EU firms with U.S. business interests wary, but Iran would likely see it as a far better outcome than the pre-2015 status quo. It also would limit Trump's ability to unilaterally impose new terms on Iran, like limiting its ballistic missile program, and potentially affect his maverick, hard-line diplomacy with opponents like North Korea. 

"Iran is very unlikely to reflexively abrogate the agreement, given the substantial economic benefits it continues to receive," wrote Cliff Kupchan, the chairman of the Eurasia Group.

However, the IMF warned that GDP growth outside of the oil industry averaged just 0.9 percent, a sign of the continued difficulties the average Iranian faces in the deal's wake. While authorities announced landmark billion-dollar deals with Boeing, Airbus and other global entities, the typical person still struggles to find a job or have their stagnant salary keep pace with Iran's lowered but still nagging inflation.

"We are sure that despite all this rhetoric, foreign investment and participation in infrastructural projects will be continued in our country," Iranian Foreign Minister Mohammad Javad Zarif said Sunday. So far, Iran's stock market and hard currency markets remain unchanged.

Rallying around the flag does have its limits in Iran. Iranians applauded when Zarif challenged Trump on the naming of the Persian Gulf, but the foreign minister drew criticism from some quarters when he tweeted that "Iranians — boy, girls, men, women are all" part of the paramilitary Revolutionary Guard.

The Guard, while fighting against the Islamic State group in Iraq, supports embattled Syrian President Bashar Assad in his country's civil war, which some Iranians have started criticizing in public in recent months. The Guard also routinely arrests and imprisons dual nationals and others over espionage charges on secret evidence, drawing international rebukes. Its hand in putting down the Green Movement protests born out of Iran's disputed 2009 presidential election also lingers in Iranians' memory.

The Guard has made a series of threatening remarks around Trump's speech. It could test-fire another ballistic missile or force another tense encounter with the U.S. Navy, which bases its 5th Fleet in Bahrain.

So far this year, the Navy has recorded 14 instances of what it describes as "unsafe and/or unprofessional" interactions with Iranian forces, the most recent coming in August, when an unarmed Iranian drone flew close to a U.S. aircraft carrier as fighter jets landed at night. The Navy recorded 36 such incidents in 2016 and 22 in 2015. Most involved the Revolutionary Guard.

"We're watching closely," said Cmdr. Bill Urban, a 5th Fleet spokesman.

___

EDITOR'S NOTE — Jon Gambrell, an Associated Press reporter since 2006, has covered the Middle East from Cairo and Dubai, United Arab Emirates, since 2013. Follow him on Twitter at www.twitter.com/jongambrellap . His work can be found at http://apne.ws/2galNpz .