Donald Trump has said the US air force was “cocked and loaded” to attack three Iranian targets on Friday morning, but he called off the strike with 10 minutes to spare after being told that the airstrike might kill as many as 150 people.

Trump said in a series of morning tweets that he decided late on Thursday that the death toll was not a proportionate response to the Iranian shooting down of a US spy drone off the Iranian coast 24 hours earlier.

The tweets revealed how close the world may have come to a Middle East conflagration, and raised questions over why the commander-in-chief was told so late in the planning of a military operation about the predicted loss of life involved. It would be routine for a president to be informed of the likely civilian casualties when the options are first presented.

Trump tweeted: “We were cocked & loaded to retaliate last night on 3 different sights when I asked, ‘How many will die?’ ‘150 people, sir’, was the answer from a General. 10 minutes before the strike I stopped it, not … proportionate to shooting down an unmanned drone.

“I am in no hurry, our Military is rebuilt, new, and ready to go, by far the best in the world. Sanctions are biting & more added last night. Iran can NEVER have Nuclear Weapons, not against the USA, and not against the WORLD!”

In an interview with NBC, released Friday, Trump elaborated on his decision. “I thought about it for a second and I said, you know what, they shot down an unmanned drone … and here we are sitting with a 150 dead people that would have taken place probably within a half an hour after I said go ahead,” Trump said. “And I didn’t like it … I didn’t think it was proportionate.”

Contrary to Trump’s claim, no new sanctions were imposed on Iran on Thursday night. The New York Times, which first reported the aborted attack, said that the US secretary of state, Mike Pompeo, while arguing for a limited airstrike, also sought to assure Trump that sanctions were having their desired long-term effect of weakening the Iranian state.

Reuters news agency reported that Trump had sent a message via the Omani government warning Iran that an attack was imminent and calling for dialogue.

“In his message, Trump said he was against any war with Iran and wanted to talk to Tehran about various issues … He gave a short period of time to get our response but Iran’s immediate response was that it is up to supreme leader [Ayatollah Ali] Khamenei to decide about this issue,” Reuters quoted an unnamed Iranian official as saying.

The spokesman for the national security council in Tehran denied receiving any message from Trump.

Republican hardliners bitterly criticised Trump for aborting the strike. Liz Cheney, a Republican congresswoman (and daughter of former vice-president Dick Cheney) told a rightwing radio talk show: “We simply can’t allow America’s adversaries to think that they can shoot down a US military drone with impunity.”

Others, including former foreign policy officials, suggested the decision could provide breathing room for a rethink of policy. “If we can clarify objectives, how would strikes fit into the strategy?” asked Brett McGurk, a former special envoy for the counter-Isis campaign. “Are they more or less likely to bring Iran to the table? Are we prepared to further escalate if initial strikes lead to more provocations from Iran?”

“Trump’s ordered pause should be used to ask these and other hard questions about the strategy, its aims, and the mounting risks should the policy remain unchanged. Last night is the first time Trump took Iran policy off autopilot, and that’s good,” McGurk said on Twitter.

The UN called for calm as Washington asked the security council for a closed-door session to discuss the crisis on Monday. The UN secretary general, António Guterres, said “I have only one strong recommendation: nerves of steel,” according to UN spokeswoman in Geneva, Alessandra Vellucci.

On the same day he ordered the airstrikes, Trump appeared conflicted about the wisdom of entering a conflict, telling reporters: “I said I want to get out of these endless wars. I campaigned on that: I want to get out.”

US diplomats insisted Trump was known to favour talks but was also a believer in sending mixed messages to keep his adversaries guessing about his next move. UK diplomats are privately pressing the US to attempt more consistent diplomatic messaging.

Some of Trump’s officials, notably the national security adviser, John Bolton, and Pompeo, are thought to favour an attack, while the voices of caution came mostly from the top levels of the military.

Late on Friday, Trump announced that he intends to nominate Mark Esper, an army veteran who served in the first Iraq war, to lead the Pentagon. Trump had already named Esper, his current army secretary, to lead the defense department on an acting basis, starting Sunday. Trump has not had a permanent defense secretary for six months.

One of the targets of the planned strikes was the S-125 Neva/Pechora surface-to-air missile system, Newsweek quoted a Pentagon official as saying. It reported that the US believed the system was behind the drone attack.

The UK military was informed of the planned strike, and was told in the early hours that the assault was being called off. The attack could have placed UK maritime assets in the region under threat.

The UK, along with France and Germany, are due to issue a demarche, or formal diplomatic position, to Tehran in the next 24 hours warning of severe consequences if it goes ahead with its plan to pull out of aspects of the Iran deal, known as the Joint Comprehensive Plan of Action.

Iran has said it will exceed the 300kg stockpile limit on 27 June and then on 7 July start to enrich uranium above 3.7 % levels, the proportion required for civilian nuclear fuel.

The demarche, intended to encourage Tehran to stay inside the JCPOA, comes with the implication that the EU will join the US in imposing sanctions if the International Atomic Energy Authority finds Iran in breach. The EU has risked a diplomatic rift with Washington for a year by sticking with the deal.

Ministers from the UK, the US, Saudi Arabia and the United Arab Emirates are also likely to issue a sharp warning to Iran not to use the civil war in Yemen, and its alliance with the Houthi rebels there, as a means of threatening the oil installations of Saudi Arabia, America’s chief ally in the Gulf.

Washington insisted it would have been justified in striking the three chosen sites since the US drone was knocked down by an Iranian missile battery whilst in international airspace. Tehran sent detailed coordinates to the UN security council to claim that the craft was in Iranian airspace.

Play Video 0:46 Trump suggests a 'loose and stupid' Iranian officer shot down US drone – video

Gen Amir Ali Hajizadeh, the head of the Revolutionary Guard’s aerospace division, also told reporters on Friday that a US spy plane with around 35 crew members was flying close to the downed navy Global Hawk drone, but that Iran chose not to target the manned aircraft. Separately, he told Iranian state TV that Iran sent messages to the operators of the giant unmanned drone several times before downing it with a missile.

But, alongside the claims of self-restraint, the tension between Washington and Tehran continued. The US special envoy on Iran, Brian Hook, speaking in Riyadh, said, “Our diplomacy does not give Iran the right to respond with military force, Iran needs to meet our diplomacy with diplomacy and not military force.”

Foreign ministry spokesman Seyyed Abbas Mousavi tweeted back: “Do you name the years of war and economic terrorism imposed on the Iranian people, not to mention the violation of the treaties and resolutions as diplomacy? The Iranian nation responds diplomacy with diplomacy, respect with respect and war with a harsh defence.”

The crisis also started to affect civilian aircraft, as the Federal Aviation Administration barred American-registered aircraft from flying over parts of the Persian Gulf and the Gulf of Oman. International airlines, meanwhile, have now rerouted flights to avoid Iranian airspace.

Agencies contributed reporting