In the immediate aftermath of the massacre of 1,140 Israeli civilians by Hamas terrorists last October, US President Joe Biden went to Israel and gave Israeli Prime Minister Benjamin Netanyahu some good advice.

“While you feel rage (about the slaughter of Israeli civilians),” Biden said, “don’t be consumed by it. After 9/11, we were enraged in the United States. While we sought justice and got justice, we also made mistakes.”

Well, yes. Invading the wrong country (Iraq) will lose you marks in almost any military college. (Iraq had nothing to do with 9/11.)

‘Avenging’ the death of 3,000 innocent Americans on 9/11 by killing around 300,000 Iraqi civilians and wasting the lives of a further 4,500 American soldiers in that same wrong country is definitely a sub-optimal response.

But the biggest US mistake was to do exactly what the al-Qaeda terrorists wanted it to do. That generation of US generals wasn’t paying attention during the ‘terrorism’ module at Staff College. Al-Qaeda carried out the 9/11 attacks because it wanted the United States to invade Arab and Muslim countries, you pitiful excuses for generals.

Al-Qaeda were Islamist revolutionaries, and they couldn’t get the Arabs to support their goals. So sucker foreign infidels into invading the countries that al-Qaeda wants to rule, and maybe that will radicalise the locals enough to back an Islamist revolution. This is Terrorism 101, as taught in almost all the world’s military colleges.

Are these the mistakes that Joe Biden was warning ‘Bibi’ Netanyahu against last October? Was he explaining to Netanyahu that Hamas staged the October atrocities precisely because it wanted Israel to invade the Gaza Strip? That Hamas was losing credibility in the Arab world, and triggering an Israeli invasion was the best way to regain it?

Maybe, but it wouldn’t have helped, because the Israelis wanted revenge and that meant a lot of blood. Which is exactly the dilemma that Biden now faces in miniature.

Only three American soldiers were killed by the drone attack in Syria on Monday, but it was big in terms of its potential consequences. The people who launched the drone were almost certainly Iraqis, but it was Iran that gave them the drone and told them to launch it at an American target.

This arms-length relationship is meant to give Iran ‘plausible deniability’, but it really doesn’t. Iran probably didn’t pick the target, the day or the time for this attack, but there have been 160 Iran-sponsored drone attacks on American targets since October. Sooner or later they were going to kill some Americans.

What did the Iranians think was going to happen then? “The only answer to these attacks must be devastating military retaliation against Iran’s terrorist forces, both in Iran and across the Middle East,” said Senator Tom Cotton. “Anything less will confirm Joe Biden as a coward unworthy of being commander in chief.”

Senator Cotton is a Republican from Arkansas, so his response is to be expected, but still… Is going to war with a country of 89 million people (Iran) – a country that could cover the last steps to making nuclear weapons in a few months – a proportionate response to the killing of three American soldiers that may or may not have been directly ordered by Tehran?

Some of the men saying such things (they’re almost all male) are clever, cynical Republicans who know that military strikes on Iran would mire Biden in an unwinnable war and lose him the election.

Most, however, are just responding to their chimpanzee heritage as reimagined in a thousand movies from High Noon to Die Hard XVII. “A man’s gotta do what a man’s gotta do,” as John Wayne once put it.

It’s a safe assumption that neither Iran nor the United States wants all-out war with the other. It was therefore stupid of Biden to give Netanyahu a blank cheque in Gaza, just as it was foolish of the clerical regime in Tehran to hand out state-of-the-art drone weapons to a variety of angry people it does not control.

But here we all are, probably not in that street in Sarajevo in 1914 but quite possibly on the USS Maddox in the Gulf of Tonkin in 1964, at the start of US involvement in the Vietnam War. Which is definitely not where we want to be.

It’s Biden’s move, but he should actually make two moves. Retaliate as little as possible against Iranian proxies somewhere (because a man’s gotta do etc), but not against Iran itself.

At the same time, compel Israel to end the killing in Gaza, because that’s what is giving Iran the leverage to mobilise all these Arab volunteers against America and for the Palestinian cause. Besides, 27,000 dead Palestinians is enough revenge.

Gwynne Dyer’s latest book is The Shortest History of War