It was Jim Mattis who saved the day. The US defence secretary, Pentagon chief and retired Marine general has a reputation for toughness. His former nickname was “Mad Dog”. When push came to shove over Syria last week, it was Mattis – not the state department or Congress – who stood up to a Donald Trump baying for blood.

Mattis told Trump, in effect, that the third world war was not going to start on his watch.

Speaking as the airstrikes got under way early on Saturday, Mattis sounded more presidential than the president. The Assad regime, he said, had “again defied the norms of civilised people … by using chemical weapons to murder women, children and other innocents. We and our allies find these atrocities inexcusable.”

Unlike Trump, who used a televised address to castigate Russia and its president, Vladimir Putin, in highly personal and emotive terms, Mattis kept his eye on the ball. The US was attacking Syria’s chemical weapons capabilities, he said. That, nothing more or less, was what the air strikes were about.

Play Video 2:49 'A strong deterrent': Trump announces strikes on Syria – video

Mattis also had a more reassuring message for Moscow. “I want to emphasise that these strikes are directed at the Syrian regime … We have gone to great lengths to avoid civilian and foreign casualties.” In other words, Russian troops and assets on the ground were not a target. Plus the strikes were a “one-off”, he added. No more would follow.

Mattis’s success at reining in Trump came despite the loss of key allies in what had half-jokingly become known in Washington as “the committee to save the country” – HR McMaster, John Bolton’s more pragmatic predecessor as national security adviser, and Rex Tillerson, the moderate secretary of state, who were both recently fired by Trump.

And despite the past week’s growing air of crisis around the world, Mattis also had to contend with a furiously angry president whose attention was focused elsewhere – on his intensifying feud with Robert Mueller, the special prosecutor investigating Trump campaign links to Russia, and on James Comey, the sacked FBI director who Trump calls a “slime ball” and whose new book likens the president to a mafia capo.

Mattis’s military diplomacy does not mean the twin crises over Syria and Russia are over. Far from it. Trump got his military strike. But he once again failed to enunciate a broader strategy in Syria. His TV speech suggested he still believes the fight against Islamic State has been won (it has not), and that he still intends to withdraw the 2,000 US troops currently helping the Syrian Kurds.

Despite their angry protestations Moscow and Tehran will be content with this outcome

In other words, Assad and his Russian and Iranian backers can expect to continue to have a free hand – as long as they do not use chemical weapons.

Israel and the Gulf Arabs led by Saudi Arabia will be dismayed. They had hoped to induce the US to take a more active role in rolling back Iran’s expanding military presence in Syria. Israel may now take matters into its own hands.

Play Video 2:05 What you need to know about the Syria strikes – video report

Dismayed, too, will be those in the west and in Syria’s opposition who hoped sustained military intervention would finally halt the pitiless slaughter of civilians.

Despite their angry protestations, Moscow and Tehran will be content with this outcome. It could have been a whole lot worse.

Putin’s propaganda and disinformation machines will continue to deny responsibility for Douma, preposterously blaming it on a British government determined to avenge the Salisbury nerve gas attack. Russia will cynically use the UN to claim the US and its allies are aggressors, in breach of international law.

But there will be no direct Russian military retaliation. There is no need. Putin has got away with it, again.