“Iraq is at the muzzle of the gun,” says Ali Allawi, Iraqi historian and former minister, speaking of the increased turmoil expected to follow the US withdrawal from the Iran nuclear agreement.

It is not only Iraq which is in danger: an escalating confrontation between the US and Iran will affect the whole region, but its greatest impact will be in Syria and Iraq where wars have long been raging and Washington and Tehran are old rivals.

The US will rely at first on the reimposition of economic sanctions on Iran to force it to comply with US demands and hopefully bring about regime change in Tehran. But, if this does not work – and it will almost certainly fail – then there will be a growing risk of military action either carried out directly by the US or through “green-lighting” Israeli airstrikes.

Iran is for the moment reacting cautiously to Trump’s denunciation of the 2015 accord, portraying itself as the victim of arbitrary action and seeking to spur the EU states into taking practical steps to resist imposing draconian sanctions along the lines of those that were imposed before 2015. Even if this does not happen, it will be important for Iran that the Europeans should only grudgingly cooperate with the US in enforcing sanctions, particularly on Iranian oil exports.

A problem for the US is that Trump has made the Iranian nuclear deal negotiated by Barack Obama the issue on which he will test the limits of US power which he had pledged to expand. But the agreement is internationally popular and is seen to be working effectively in denying Iran the ability to develop a nuclear device. The US is therefore becoming self-isolated, with full support only from Israel and Saudi Arabia, in the first weeks of a crisis that could go on for years.

Already Trump’s determination to sink the deal forever has involved marginalising and humiliating France, Germany and UK. They had pleaded for it to be preserved but made more palatable to the US by separate agreements on ballistic missiles and other issues. Trump seems to have enjoyed the procession of European leaders from Emmanuel Macron to Boris Johnson asking for compromise, only to go away empty-handed.

If the European leaders now go along with sanctioning Iran, there will be even less reason for Trump to take their views seriously in future. They have already seen their attempt to appease him on climate change fail to produce anything, so they either have to accept that they have less influence and a reduced role in the world or make a serious attempt to preserve the nuclear accord.

But even if they do so, the US will be able to put intense economic pressure on Iran and its trading partners. Banks and companies are terrified of incurring the ire of the US Treasury and facing massive fines for even an unintentional breach of sanctions. Even if EU governments want their companies to go on investing in Iran, they may consider the risk too great.

Sanctions are a powerful but blunt instrument, take a long time to work and usually do not produce the political dividends expected by those who impose them. The Iranian rial may fall and hyperinflation return to 40 per cent, but this will most likely not be enough if Iran returns to enriching uranium. It has already said that it is not going to keep abiding by its part of the nuclear agreement if it is not getting any of the economic benefits promised.

What will the US do then? This is the crucial question for the Middle East and the rest of the world. Trump has just torpedoed any diplomatic solution to what he sees as the threat of Iran developing a nuclear bomb. The only alternative is a military response, but this would have to be more than a few days of intense airstrikes. Anything less than total war would not win for Trump the kind of results he says he wants.

Iran may be weak economically, but politically and militarily it is in a strong position in Iraq, Syria and Lebanon, the countries likely to provide the main arena for the coming crisis. In all three places it is Iran’s fellow Shia who are in control and see the US as an ally of the Sunni states in what is in large part a sectarian Shia-Sunni conflict.

Has the Trump administration thought any of this through? The crisis is beginning to feel very much like that in the buildup to the invasion of Iraq in 2003. Some of the same figures, such as the national security adviser John Bolton, are the very same neoconservatives who believed that invading and occupying Iraq would be an easy business. They sound as if they are bringing the same blend of arrogance and ignorance to their coming confrontation with Iran.