Qasem Soleimani – a major-general in Iran’s Revolutionary Guard and the leader of its Quds Force, a unit responsible for external and clandestine operations – was once described by Ayatollah Ali Khamenei, the Islamic Republic’s supreme leader, as ‘a living martyr of the revolution’. The living martyr is now a dead martyr, killed in an American airstrike along with five other people at Baghdad airport. Khamenei, who promoted Soleimani posthumously to lieutenant-general, has tweeted that ‘harsh vengeance’ is forthcoming; Hassan Nasrallah, the secretary-general of Lebanese Hizbullah, has declared that it is the ‘responsibility and task of all resistance fighters worldwide’ to avenge their deaths.

There is no doubt that Iran and its proxies have the capacity to respond. In large part thanks to Soleimani’s work over the past two decades, the Islamic Republic has carved out a zone of regional influence that is both wide and deep. Its networks are especially powerful in Iraq, where Americans have been ordered by their government to leave as soon as possible. It was recent clashes between the US and pro-Iranian militias in Iraq – the US killed two dozen members of Iraqi Hizbullah after an American contractor was killed near Kirkuk, and the US Embassy was stormed by militia sympathisers – that led to Soleimani’s assassination.

Soleimani, born in rural eastern Iran in 1957, was a member of the revolutionary generation and a veteran of the Iran-Iraq War, in which nearly a million Iranians died. His belief that Iran had to be strong – and Iraq weak and divided – was shaped by his wartime experiences; so was his hostility to the United States, which backed Saddam’s forces while they used poison gas against Iranian troops. His first task in the war was to supply water to soldiers: ‘I entered the war on a fifteen-day mission, and ended up staying until the end.’ He came to see the battlefield as ‘mankind’s lost paradise – the paradise in which morality and human conduct are at their highest’, and demonstrated both ingenuity and ruthlessness in expanding Iranian influence throughout the Middle East and Afghanistan.

He acquired an abundance of enemies, many of whom are surely celebrating his violent end: Americans who fought in Iraq, where forces trained by Soleimani killed hundreds of US soldiers; the Israelis, who recognised him as a formidable asset to the Islamic Republic and Hizbullah; Syrian opponents of the Assad regime, which was saved by Soleimani’s intervention; the Saudis, who saw him as the fearsome architect of a ‘Shia crescent’ imperiling their interests in Yemen, Bahrain and Lebanon; the militants of the Islamic State, who despise the Shia as heretics. There are many in Iran, too, who won’t miss him. A tireless defender of the Islamic Republic and unswerving ally of Khamenei, he made no secret of his conviction that state repression was an appropriate and necessary response to street protests; in 1999 he signed a letter from a group of Revolutionary Guard leaders to President Mohammed Khatami, telling him that if he did not crush a student revolt by force, they would.

Yet Soleimani could also be a pragmatist. He worked with the Americans in Afghanistan and was nearly as skilful at brokering ceasefires in Iraq as he was in organising military operations and collecting intelligence. His major objective was to increase Iranian influence and to bolster Shia power in the region; his success won no little respect among Iranians, even among those who dislike the Islamic Republic for its authoritarianism. He was also admired by many Shia in southern Lebanon, in spite of some (very quietly voiced) criticism over the scale of Lebanese Shia casualties in Syria.

He was a senior political leader as well as a general, which made him an untouchable figure for the Americans: until Trump came to power, killing him was understood to be off the table. Late in 2017, a Kuwaiti paper reported that the Israelis had received a green light to assassinate Soleimani, but hardly anyone took the rumour seriously. For all his recklessness in dismantling the nuclear agreement with Iran (one of Obama’s signature policies), and despite his rhetoric, Trump seemed averse to actual military escalation. Last September he fired John Bolton, a longstanding proponent of war with Iran, from his position as national security adviser. A few days later the United States did not respond to a drone attack against Saudi Aramco, which appeared to have been the work of Iran, and left Trump’s friends in Riyadh feeling dangerously exposed.

What, then, was the tipping point? The storming of the American embassy in Baghdad, only a few months after the Aramco attack, was clearly important: other than personal criticism – or the prospect of impeachment, from which the confrontation provides a useful distraction – nothing enrages Trump so much as spectacles of American weakness. A sense of pique may also have contributed to the assassination order. Soleimani seemed to take pleasure in taunting the Americans. ‘There is not one night we sleep without thinking of you,’ he said in July 2018 on Iranian television. ‘Mr Gambler Trump, we are near you where you don’t expect.’ Trump may have wished to prove to Soleimani that he was near him when he didn’t expect. And Khamenei’s remark, after the storming of the embassy in Baghdad, that ‘you can’t do anything,’ may have been the last straw.

It’s hard to explain Trump’s decision other than as a response to insult, since such a dangerous escalation seems inconsistent with his aversion to foreign wars, and his (so far) unerring sensitivity to his right-wing isolationist base. As Robert Malley of the International Crisis Group remarked on Twitter, killing Soleimani is for all intents and purposes a declaration of war against Iran. It is, of course, possible that Trump is unaware of this, or that he imagines that Iran ‘can’t do anything’ in response and will simply absorb the blow – in which case he is hallucinating.

By killing Soleimani, Trump has not only supplied the Islamic Republic with a powerful casus belli, he has also reinforced its longstanding narrative of martyrdom at the hands of the Great Satan, and may well help to strengthen the supreme leader’s hand at the very moment that the regime is facing popular anti-Iranian protests in Iraq and Lebanon, and reeling from a series of revolts at home in which hundreds of Iranians were killed by security forces. Not for the first time, the American government has proved an objective ally of Iran’s hardliners. The man once known as the living martyr would be smiling.

This post was modified on 5 January. The earlier version repeated a report that Naim Qassem, the deputy secretary-general of Lebanese Hizbullah, might have been killed along with Soleimani. He was not.