By Peter S. Goodman, New York Times–

Iran is caught in a wretched economic crisis. Jobs are scarce. Prices for food and other necessities are skyrocketing. The economy is rapidly shrinking. Iranians are increasingly disgusted.

Crippling sanctions imposed by the Trump administration have severed Iran’s access to international markets, decimating the economy, which is now contracting at an alarming 9.5 percent annual rate, the International Monetary Fund estimated. Oil exports were effectively zero in December, according to Oxford Economics, as the sanctions have prevented sales, even though smugglers have transported unknown volumes.

The bleak economy appears to be tempering the willingness of Iran to escalate hostilities with the United States, its leaders cognizant that war could profoundly worsen national fortunes. In recent months, public anger over joblessness, economic anxiety and corruption has emerged as a potentially existential threat to Iran’s hard-line regime.

Only a week ago, such sentiments had been redirected by outrage over the Trump administration’s Jan. 3 killing of Iran’s top military commander, Maj. Gen. Qassim Suleimani. But protests flared anew over the weekend in Tehran, and then continued on Monday, after the government’s astonishing admission that it was — despite three days of denial — responsible for shooting down a Ukrainian jetliner.

The demonstrations were most pointedly an expression of contempt for the regime’s cover-up following its downing of the Ukrainian jet, which killed all 176 people on board. But the fury in the streets resonated as a rebuke for broader grievances — diminishing livelihoods, financial anxiety and the sense that the regime is at best impotent in the face of formidable troubles.

Inflation is running near 40 percent, assailing consumers with sharply rising prices for food and other basic necessities. More than one in four young Iranians is jobless, with college graduates especially short of work, according to the World Bank.

The missile strikes that Iran unleashed on American bases in Iraq last week in response to Gen. Suleimani’s killing appeared calibrated to enable its leaders to declare that vengeance had been secured without provoking an extreme response from President Trump, such as aerial bombing.

Hostilities with the most powerful military on earth would make life even more punishing for ordinary Iranians. It would likely weaken the currency and exacerbate inflation, while menacing what remains of national industry, eliminating jobs and reinvigorating public pressure on the leadership.

Conflict could threaten a run on domestic banks by sending more companies into distress. Iranian companies have been spared from collapse by surges of credit from banks. The government controls about 70 percent of banking assets, according to a paper by Adnan Mazarei, a former I.M.F. deputy director and now a senior fellow at the Peterson Institute for International Economics in Washington. Roughly half of all bank loans are in arrears, Iran’s Parliament has estimated.

Many Iranian companies depend on imported goods to make and sell products, from machinery to steel to grain. If Iran’s currency declines further, those companies would have to pay more for such goods. Banks would either have to extend more loans, or businesses would collapse, adding to the ranks of the jobless.

The central bank has been financing government spending, filling holes in a tattered budget to limit public ire over cuts. That entails printing Iranian money, adding to the strains on the currency. A war could prompt wealthier Iranians to yank assets out of the country, threatening a further decline in the currency and producing runaway inflation.

In sum, this is the unpalatable choice confronting the Iranian leadership: It can keep the economy going by continuing to steer credit to banks and industry, adding to the risks of an eventual banking disaster and hyperinflation. Or it can opt for austerity that would cause immediate public suffering, threatening more street demonstrations.

“That is the specter hanging over the Iranian economy,” Mr. Mazarei said. “The current economic situation is not sustainable.”

Though such realities appear to be limiting Iran’s appetite for escalation, some experts suggest that the regime’s hard-liners may eventually come to embrace hostilities with the United States as a means of stimulating the anemic economy.

Cut off from international investors and markets, Iran has in recent years focused on forging a so-called resistance economy in which the state has invested aggressively, subsidizing strategic industries, while seeking to substitute domestic production for imported goods.

That strategy has been inefficient, say economists, adding to the strains on Iran’s budget and the banking system, but it appears to have raised employment. Hard-liners might come see a fight with Iran’s archenemy, the United States, as an opportunity to expand the resistance economy while stoking politically useful nationalist anger.

“There will be those who will argue that we can’t sustain the current situation if we don’t have a war,” said Yassamine Mather, a political economist at the University of Oxford. “For the Iranian government, living in crisis is good. It’s always been good, because you can blame all the economic problems on sanctions, or on the foreign threat of war. In the last couple of years, Iran has looked for adventures as a way of diverting attention from economic problems.”

How ever Iran’s leaders proceed, experts assume that economic concerns will not be paramount: Iran’s leaders prioritize one goal above all others — their own survival. If confrontation with outside powers appears promising as a means of reinforcing their hold on power, the leadership may accept economic pain as a necessary cost.

“The hard-liners are willing to impoverish people to stay in power,” said Sanam Vakil, deputy director of the Middle East and North Africa program at Chatham House, a research institution in London. “The Islamic Republic does not make decisions based on purely economic outcomes.”

But Iran’s leaders need only survey their own region to recognize the dangers that economic distress can pose to established powers. In recent months, Iraq and Lebanon have seen furious demonstrations fueled in part by declining living standards amid corruption and abuse of power.

As recently as November, Iran’s perilous economic state appeared to pose a foundational threat to the regime. As the government scrambled to secure cash to finance aid for the poor and the jobless, it scrapped subsidies on gasoline, sending the price of fuel soaring by as much as 200 percent. That spurred angry protests in the streets of Iranian cities, with demonstrators openly calling for the expulsion of President Hassan Rouhani.

“That’s a sign of how much pressure they are under,” said Maya Senussi, a Middle East expert at Oxford Economics in London.

In unleashing the drone strike that killed General Suleimani, Mr. Trump effectively relieved the leadership of that pressure, undercutting the force of his own sanctions, say experts.

Within Iran, the killing resounded as a breach of national sovereignty and evidence that the United States bore malevolent intent. It muted the complaints that propelled November’s demonstrations — laments over rising prices, accusations of corruption and economic malpractice amid the leadership — replacing them with mourning for a man celebrated as a national hero.

A country fraught with grievances aimed directly at its senior leaders had seemingly been united in anger at the United States.

“The killing of Suleimani represents a watershed, not only in terms of directing attention away from domestic problems, but also rallying Iranians around their flag,” said Fawaz A. Gerges, a professor of international relations at the London School of Economics.

Mr. Trump had supplied the Iranian leadership “time and space to change the conversation,” he added. Iranians were no longer consumed with the “misguided and failed economic policies of the Iranian regime,” but rather “the arrogant aggression of the United States against the Iranian nation.”

But then came the government’s admission that it was responsible for bringing down the Ukrainian passenger jet. Now, Iran’s leaders again find themselves on the wrong end of angry street demonstrations.

For now, the regime is seeking to quash the demonstrations with riot police and admonitions to the protesters to go home. But if public rage continues, hard-liners may resort to challenging American interests in the hopes that confrontation will force Mr. Trump to negotiate a deal toward eliminating the sanctions.

Iran may threaten the passage of ships carrying oil through the Strait of Hormuz, the passageway for more than one-fifth of the world’s consumption of liquid petroleum. Disruption there would restrict the global supply oil, raising the price of the vital commodity. That could sow alarm in world markets while limiting global economic growth, potentially jeopardizing Mr. Trump’s re-election bid, as the logic goes.

Iran previously had a different pathway toward gaining relief from the sanctions: Under a 2015 deal forged by President Barack Obama, the sanctions were removed in exchange for Iran’s verified promise to dismantle large sections of its nuclear program.

But when Mr. Trump took office, he renounced that deal and resumed sanctions.

The Iranian leadership has courted European support for a resumption of the nuclear deal, seeking to exploit divergence between Europe and the United States. The Europeans have been unhappy about Mr. Trump’s renewed sanctions, which have dashed the hopes of German, French and Italian companies that had looked to Iran for expanded business opportunities.

Whatever comes next, Iran’s leadership is painfully aware that getting out from under the American sanctions is the only route to lifting its economy, say experts.

The nuclear deal was intended to give Iran’s leaders an incentive to diminish hostility as a means of seeking liberation from the sanctions. Mr. Trump’s abandonment of the deal effectively left them with only one means of pursuing that goal — confrontation.

“They see escalation as the only way to the negotiating table,” said Ms. Vakil. “They can’t capitulate and come to the negotiating table. They can’t compromise, because that would show weakness. By demonstrating that they can escalate, that they are fearless, they are trying to build leverage.”