The planes were already in the air and warships in position, preparing to carry out strikes on targets when, at the last moment, Donald Trump pulled back from starting a conflict with Iran with potentially devastating consequences.

These are the startling facts which have emerged as the tensions continue to ratchet up between Washington and Tehran, with the Trump administration’s continuing campaign to destroy the Iran nuclear deal, more attacks on oil tankers in the Gulf and an American drone being shot down by an Iranian missile.

The accusations and recriminations have been rising in tempo for some time, with attempts at mediation seemingly undermined and charges of agents provocateurs attempting to engineer clashes. There is now genuine apprehension that the war of words may spill over into something much more serious with highly damaging ramifications for the region and beyond.

What happened, reported first in the American media and then confirmed by officials in Washington and, finally, Mr Trump, reveals divisions and confusion in how decisions on peace and war are made in the Trump administration, one of the most dysfunctional in recent American history.

The president claimed on Friday afternoon that he called off the strikes because he was told there would likely be the loss of lives: “We were cocked & loaded to retaliate last night on 3 different sights when I asked, how many will die” he tweeted.

Tensions high as Trump approves new Iran sanctions: In pictures Show all 17 1 /17 Tensions high as Trump approves new Iran sanctions: In pictures Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, their surface-to-air missile is seen as it shoots down a US surveillance drone EPA Tensions high as Trump approves new Iran sanctions: In pictures This photo shows US RQ-4A Global Hawk unmanned surveillance drone. A drone of this model was shot down by Iran on Thursday 21 June AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures An oil tanker is on fire after it was subject to a suspected attacked at the Gulf of Oman on June 13. The US has blamed Iran for the attack Reuters Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, debris from the downed US drone is seen after it was recovered from Iranian waters AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures US President Trump holds up a signed executive order to increase sanctions on Iran on 24 June AP Tensions high as Trump approves new Iran sanctions: In pictures Iranian President Rouhani stated in a televised address that the White House is "afflicted by mental retardation" following the increase in sanctions on 25 June EPA Tensions high as Trump approves new Iran sanctions: In pictures An Iranian navy boat tackles the fire on the Norwegian owned Front Altair oil tanker after it was hit in a suspected attack AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, debris from the downed US drone is seen after it was recovered from Iranian waters AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures A screenshot from a video released by the US Department of Defense that the US claims to show Iranian removing an unexploded limpet mine form the hull of the Japan-owned ship that was attacked in the Gulf of Oman on June 13 Getty Tensions high as Trump approves new Iran sanctions: In pictures An item reportedly found on the Japan-owned oil tanker that was attacked on June 13 in the Gulf of Oman AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures A handout photograph from the US Department of Defense shows a composite material that the US claim was left behind on the hull of the Japan-owned oil tanker following the removal of an unexploded limpet mine Getty Tensions high as Trump approves new Iran sanctions: In pictures A view from the cabin of an Iranian navy boat as it tackles the fire on the Norwegian owned Front Altair oil tanker after it was hit in a suspected attack EPA Tensions high as Trump approves new Iran sanctions: In pictures Release by US government A picture released by U.S. Central Command shows damage to the hull of the oil tanker Kokuka Courageous. The picture suggests that the ship is 'likely' to have been hit by a mine as the US Secretary of State Mike Pompeo moves to blame Iran for the suspected attack Reuters Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures Release by US government A picture released by U.S. Central Command shows damage to the hull of the oil tanker Kokuka Courageous. The pictures suggests that the ship is 'likely' to have been hit by a mine as the US Secretary of State Mike Pompeo moves to blame Iran for the suspected attack EPA

“150 people sir, was the answer from a General, 10 minutes before the strike I stopped it”. Such a death toll, he continued was “not proportionate to shooting down an unmanned drone”.

The account was undermined by officials who had said that the raids had been planned for very early Friday morning to ensure minimal casualties, and also claimed there were other factors behind the mission being called off.

The shooting down of the $130m RQ-4A Global Hawk high-altitude, long endurance unmanned aircraft system (HALE) had come after two sets of attacks on tankers in waterways key to transporting the world’s oil.

The US, Saudi Arabia and, latterly, the UK claimed that Iran was responsible. The UAE, which said it had carried out an investigation into the attacks, blamed a “state actor” without naming the state. Germany, France and Japan, where one of the tankers was registered, wanted to see more evidence before apportioning blame.

The US produced photographs purporting to show sailors from the maritime arm of the Iranian Revolutionary Guards Corps (IRGC) removing an unexploded mine, and announced the dispatch of 1,000 more troops to the region.

Tehran vehemently denied any involvement and charged that malignant neighbourhood rivals, Saudi Arabia, the UAE and Israel, abetted by hawks in the Trump administration led by John Bolton, the national security advisor, were trying to drag the US into a war with Iran.

There was no dispute over the shooting down of the drone. The US and Iran concurred that this had been done by an Iranian surface-to-air missile, a Khordad-3 medium-range air defence model, said the Defence Ministry in Tehran.

What is fiercely disputed, and a key point of contention, is the location of the Hale when it was brought down. Tehran insisted that it was in Iranian airspace: Javad Zarif, the foreign minister, tweeted: “at 00:14 US drone took off from UAE in stealth mode & violated Iranian airspace. It was targeted at 04:05 at the coordinates (25 59’43” N 57 02’25”E) near Kouh-e-Mobarak.”

The Americans produced their own coordinates, maintaining that the drone had been flying in international airspace, around nine nautical miles southwest of the location given by the Iranians.

Mr Trump told the media before a meeting with Canadian premier Justin Trudeau in the White House on Thursday afternoon, that “this drone was international waters (sic) clearly. We have it all documented. It’s documented scientifically, not just words.”

Asked what would unfold next, the president responded: “Let’s see what happens.”

What happened next, according to reports, was that senior White House officials like Mr Bolton and Mike Pompeo, the secretary of state – both hardliners on Iran – and Gina Haspel, the CIA director, who is not known to be so, favoured a military response.

Lindsey Graham: Iran needs to get ready for 'severe pain'

But others in the Pentagon warned that the strikes might lead to a chain reaction which would be difficult to contain, and make targets of American forces in neighbouring countries. Congressional Democrat leaders, like Nancy Pelosi, briefed on the mission, strongly urged caution.

In the end, Mr Trump decided to call off the mission. This may reinforce the view that he is not a “war president” and his natural inclination is isolationist rather than interventionist.

The president’s previous foray into ordering combat, the launch of missiles following a chemical attack by the Assad regime on the town of Khan Shaykhun, had been carefully choreographed, with the targeted airbase evacuated by the Syrian military after the Russians were told of the attack in advance.

There are reports that Mr Trump had warned the Iranians that he would order an attack. But Hamid Baeidinejad, the Iranian ambassador to the UK and one of the country’s most senior diplomats, speaking to journalists on Thursday seemed unaware of imminent danger, saying that he took on board Mr Trump’s repeated assurances that he did not want a war.

Both sides in the current crisis are projecting toughness. Major General Hossein Salami, the head of the IRGC, declared that “the only way for our enemies to be safe is to respect our sovereignty, national security and national interest of the great Iranian nation”.

Mr Trump’s statements and actions after the shooting down of the drone had, not unusually for him, been contradictory.

After warning that Iran had “made a very big mistake”, the president said it could have been down to human error, saying: “I find it hard to believe it was intentional.” He subsequently ordered air strikes and then later aborted them.

To the hardliners in Iran, who are not averse to a confrontation, this may well look like uncertainty, a lack of any plan and lack of resolve in Washington, and it may tempt them to further brinkmanship. This in turn strengthens the hand of Mr Bolton and other hawks in the White House, giving them scope to press for another military operation.

Observing what is taking place, the senior Democrat in the Senate, Chuck Schumer, commented: “The president may not intend to go to war here, but we’re worried that he and the administration may bumble into a war.”