When the president was asked why he needed allies such as the UK to get involved, he told the BBC: “I didn’t need them at all but they should’ve been there. I didn’t need them, obviously.”

“We’ve wiped Iran’s military out, he added. “I didn’t need anybody.”

“I wanted to see whether or not they would be involved,” Trump said, describing his calls for support from allies as “more of a test”.

“I make my decisions based on what’s in the British national interest and not what other people say or do,” Sir Keir said when asked by the BBC about the president’s comments on Thursday.

“That is why I took the decision that we would not be dragged into the war in Iran,” he said. “I’m not going to be diverted or deflected from that by what anybody else says.”

Trump was also asked whether his threat, made earlier this month, that “a whole civilisation will die tonight” unless Iran agreed to a deal was about nuclear weapons. The comment was widely condemned, including by the Pope, the head of the UN and Sir Keir.

“The other side is dying to make a deal,” Trump said. “So whatever I’m saying or whatever I’m doing, it seems to be working very well.”