The mobbing of a US embassy has historically served as an emblem of America in decline, so the scenes around the embattled mission in Baghdad are a fitting end to the decade.

Tuesday’s events are not quite as decisive as the 1975 helicopter evacuation of the embassy in Saigon, or the seizure of the Tehran embassy four years later. Iraqi forces did turn up eventually to protect the Baghdad mission. It turned out the ambassador was on holiday anyway, so he did not have to endure the humiliation of a rooftop escape. But the demonstration of US weakness, after spending $2tn in Iraq, was plain for all to see.

The rioters, organised by the Iranian proxy militia Kata’ib Hezbollah (KH), brushed past Iraqi checkpoints, and there were members of parliament from the government bloc among them. Security forces who have had no compunction about firing tear gas canisters into the skulls of anti-Iranian protesters on Tahrir Square, stood by and watched molotov cocktails thrown at the US embassy. In its public pronouncements, the Iraqis put more blame on Washington than Tehran.

For Iran, the embassy riot was the latest move in a deliberate strategy, to raise the costs of the US presence in Iraq and drive a wedge between the Iraqi government and Washington.

The competition between the US and Iran for influence in Iraq would have escalated anyway as the threat from Isis declined. But the US effort to destroy Iran economically through its campaign of maximum pressure has meant the Iranians have nothing to lose.

“The Iranians have been very, very methodical over the past six months about their responses to the maximum pressure campaign. And unfortunately, it is not really met any counter-response,” said Barbara Leaf, former US ambassador to the United Arab Emirates. “The question is: while Iran has a very methodical approach to upping the ante, do they at some point trip across a red line that they don’t even know exists?”

It was inevitable that the repeated attacks by KH on Iraqi bases hosting US troops would eventually lead to American casualties, as happened on Friday near Kirkuk, triggering US retaliatory airstrikes on KH camps in Iraq as well as Syria.

Ariane Tabatabai, a political analyst at the Rand Corporation, said: “The US was sort of stuck between a rock and a hard place, because on the one hand, if it did not respond to this latest attack, considering that a US citizen was killed, it would have sent a pretty strong signal that the red line that it had laid out about US casualties didn’t mean anything.”

By highlighting the Iraqi government’s impotence on its own territory, the retaliation diverted public dissatisfaction with the heavy-handed Iranian presence in Iraq, to the desire to be rid of the imperious Americans. The US comes out of this tit-for-tat round weaker and with fewer options.

It is not clear whether the US has a plan for what happens now. The campaign of maximum pressure was supposed to force Iran to accept a worse deal than the 2015 multilateral nuclear agreement on which Donald Trump walked out in 2018. The oil and banking embargo on Iran have been highly effective in damaging the Iranian economy, but have failed to make Iran bow to US demands for Tehran to give up its military stake in Middle East conflicts and its enrichment of uranium.

Instead, Iran has hit back against tanker traffic in the Persian Gulf, and Saudi oil facilities, while ratcheting up pressure on the US military presence in Iraq.

US officials have talked in recent days about “restoring deterrence” against such moves with air strikes against KH targets, and have warned they are ready to escalate by taking the fight into Iranian territory.

US deterrence however is undermined by having given Iran so little to lose, and by the vacillation of the president, who is entering an election year claiming he has extricated the country from costly foreign wars, while simultaneously wanting to appear tough in the standoff with Iran.

“To those many millions of people in Iraq who want freedom and who don’t want to be dominated and controlled by Iran, this is your time!” Trump tweeted on Tuesday, but he sent the tweet while on his way to his golf course in Palm Beach.

He was convinced that maximum pressure would bring Iran to the negotiating table as a supplicant, but instead it has added to the chaos.

No one – almost certainly not even Trump – knows how he is going to respond.