(Bloomberg) -- Iran’s Supreme Leader Ayatollah Ali Khamenei called it a “crushing response.” Yet the targeted missile strikes on U.S. bases in Iraq may offer President Donald Trump a path to avoiding a wider war with unpredictable and devastating consequences.

There were no American casualties resulting from the overnight attack, according to a U.S. official, and Iraq said that no coalition forces on its territory were killed. What’s more, Iran gave prior notice of the strikes, Iraqi Prime Minister Adel Abdul Mahdi’s office said in a statement.

That fact suggests the Islamic Republic’s dramatic retaliation was carefully calibrated to satisfy the outrage at home and provide an off-ramp to the crisis following the U.S. killing of General Qassem Soleimani last week.

The strikes are “very much a measured response,” said Faysal Itani, a deputy director at the Center for Global Policy in Washington who has lived and worked in the Middle East. “Its response has to be dramatic enough to save face, but limited enough so as to avoid triggering an escalation cycle that could lead to overwhelming U.S. military action. This is spectacular enough to ‘count’ but does not force the U.S. to escalate in return.”

Markets settled on Wednesday, with gold, oil and Treasuries paring earlier surges, after both Tehran and Trump left the door open for lowering tensions. Foreign minister Javad Zarif said Iran had “concluded proportionate measures” and didn’t seek war, while Trump tweeted “All is well!”

To be sure, unpredictability is a Trump hallmark and there is no guarantee he won’t change his tone. The president said he’ll make a statement on Wednesday morning in Washington. Trump has repeatedly warned Iran, and cited the U.S.’s military strength in a tweet after the missile attack, yet he also said last week that Soleimani’s killing was meant “to stop a war.”

“Hopefully the cycle, at least for the time being, ends here,” Cyrus Razzaghi, president of Ara Enterprise, a Tehran-based management consultancy providing advice to foreign companies, said in a note. On Iran’s side, he said, “I don’t think there will be any more immediate attacks and even if there are, they will be done in the same manner, sending a message but not causing death.”

Iran’s leaders faced tremendous domestic pressure to hit back hard after the U.S. took out one of the country’s most powerful generals. Soleimani’s exploits in regional conflicts made him a national hero in Iran, with hundreds of thousands turning out this week for his funeral procession.

Iran’s state media said that at least 80 U.S. soldiers had been killed in the strikes, without offering any evidence to back up the claim. The Iranian leadership fully understands the consequences of all-out war with the U.S., said Razzaghi, hence the initial reports show “they are trying to satisfy people’s demand for revenge without provoking the U.S. too much.”

Even with the measured response, Iran is unlikely to halt efforts to push U.S. forces out of the region. A day before the missile strikes, Iran vowed to inflict an “historic nightmare” on the U.S. and said it was evaluating 13 possible ways to retaliate. Following the attack, the Islamic Revolutionary Guard Corps -- the military’s premier fighting force -- called it the start of its “Martyr Soleimani” operation and said more responses would be coming.

Even so, Supreme Leader Khamenei has several restraints in considering potential military options -- not least the risk that a full-blown war could lead to ruin and regime change.

“I still think the Iranians are more likely to be trying to avoid a direct military confrontation with the United States because that will destroy a huge part of their defensive capability,” said Jon Alterman, director of the Middle East Program at the Washington-based Center for Strategic and International Studies. “Let’s not forget the Iranians are still using weapons the Shah bought -- they don’t have a lot to spare.”

Given that, Alterman said, Iran is likely to take actions that will undermine U.S. global leadership to blunt the effect of economic sanctions while also seeking to push U.S. forces out of Iraq, which also supplies forces in Syria. Following the missile attack, an Iranian cabinet minister tweeted “Get the hell out of our region!” along with the flags of Iran and Iraq.

Iran must also weigh the economic impact. The U.S. allowed key oil waivers for Iran’s remaining crude customers to expire in the early months of 2019 as part of its drive to wipe out the country’s main source of foreign exchange income. Accelerated inflation made it difficult for citizens to pay for staples such as meat, and a government decision to hike the price of gasoline triggered protests that the U.S. says killed more than 1,000 people.

Iran’s leaders also see a chance to benefit politically from the crisis, according to Joseph Siracusa, a lecturer at Melbourne’s RMIT University and co-author of “Going to War with Iraq: A Comparative History of the Bush Presidencies.”

“They are an aging theocracy reimposing their will on a younger population,” he said. “It’s united the Iranian people, who aren’t united about anything.”

Iran Vows ‘Historic Nightmare’ as Funeral Stampede Kills Dozens

Iran’s move to opt for a direct strike, instead of using armed proxy groups in the region, also shows its population that it’s not afraid to hit the U.S. Still, Iran is likely to hit back indirectly some time in the future to harm U.S. interests, possibly by killing American diplomats or military officials abroad, according to Heather Williams, a former deputy national intelligence officer for Iran on the U.S. National Intelligence Council.

“There is no imperative for the U.S. to respond to these rocket strikes, assuming that there continue to be no U.S. casualties, so Iran is also giving Washington the opportunity to deescalate tensions,” said Williams, who is now a senior policy researcher at Rand Corp. “It remains to be seen whether we will take it.”

--With assistance from Ruth Pollard, Nick Wadhams, Jason Scott and Marc Champion.

To contact the reporters on this story: Karen Leigh in Hong Kong at kleigh4@bloomberg.net;Iain Marlow in Hong Kong at imarlow1@bloomberg.net;Michael S. Arnold in Singapore at marnold48@bloomberg.net

To contact the editors responsible for this story: Daniel Ten Kate at dtenkate@bloomberg.net, Alan Crawford, Adam Majendie

For more articles like this, please visit us at bloomberg.com

©2020 Bloomberg L.P.