Boris Johnson faces, in the stand-off between Washington and Tehran, an early test of his ability to handle the often exceedingly difficult situations in foreign affairs which confront a British Prime Minister.

His critics expect him to fail this test. They took a dismissive view of his performance as Foreign Secretary, and were unwilling to see that any holder of that post who is not invited to work in harness with the Prime Minister is doomed to irrelevance.

These adversaries enjoy ransacking Johnson’s back catalogue in order to discover evidence of past opinions which in their view render him unfit for high office.

They delight in highlighting any expressions which burst the bounds of what can be said in polite society.

Such opponents do Johnson a favour. For by promoting the idea that he is a crass and tasteless fool, they set low expectations which he exceeded in the Brexit negotiations, and in the general election, and which he has so far exceeded in the present crisis.

He has the further advantage of having spent two years as Foreign Secretary: not long enough to acquire a mastery of problems so intricate they repay a lifetime’s study, but better than arriving in Number Ten with no previous experience of foreign policy as conducted by the government machine.

He adds to this several decades of work as a correspondent and commentator who, while not a member of the official machine, was a close and astute observer of it.

Johnson understands that on the great questions of the day, it is essential to remain willing, when circumstances change, to change one’s view.

If one looks through his back catalogue without simply concentrating on his many moments of political incorrectness, one finds evidence of this realism. When asked at the end of 2006 to explain why he had “recanted” his support for the Iraq War of 2003, Johnson replied:

“It is the sheer number of casualties, the chaos, that persuades me that we did the wrong thing. I voted for this bloody disaster not because I believed Blair, but because I thought it would be a good thing to get rid of Saddam. And it was a good thing. It is just that the price has been way too high.”

In December 2006, he put a question to the then Foreign Secretary, Margaret Beckett:

“What can the Foreign Secretary say to disprove the withering verdict of the US State Department official, Kendall Myers, that Washington has systematically ignored British advice over Iraq? Can she give a single concrete example of any piece of advice given by her or the Prime Minister that was accepted by Washington and without which the catastrophe in Iraq would have been even worse?”

Beckett was unable to offer a single concrete example of British advice being acted upon in Washington. Nor in all likelihood could Johnson or Dominic Raab do so now.

The Prime Minister will not wish to say anything which could be construed as an attack on Donald Trump, with whom he hopes in the near future to conclude a free-trade deal.

But he has taken the opportunity to show a degree of solidarity with Britain’s European allies, issuing a statement on Sunday night with Angela Merkel and Emmanuel Macron in which the three of them spoke of “an urgent need for de-escalation”.

And yesterday he spoke to Abdul Mehdi, the Prime Minister of Iraq. According to Downing Street, Johnson “underlined the UK’s unwavering commitment to Iraq’s stability and sovereignty and emphasised the importance of the continued fight against the shared threat from Daesh.”

For a supporter of Brexit to defend Iraq’s sovereignty is entirely natural. The Prime Minister’s spokesman added that “there are international conventions in place which prevent the destruction of cultural heritage” – a point which President Trump, with his threat to attack Iranian cultural sites, appeared to have overlooked.

Johnson has aligned himself, in the early stages of this crisis, with those who deprecate barbarism and want to see Daesh’s defeat confirmed. This moderation will surprise his critics, but should not surprise any fair-minded person who has studied his record.