Iran and its allies continued to threaten revenge yesterday as a rocket exploded near the US embassy in Baghdad following the killing of an Iranian leader by American forces.

Iran’s ambassador to the United Nations has warned the US “has started a military war by an act of terror” with the killing of Iranian commander Qassem Soleimani, as Donald Trump claimed he ordered the Quds Force general’s death to prevent war rather than provoke it.

The country’s UN diplomat declared Iran “has to act, and we will act”, while UN secretary general Antonio Guterres joined global calls for de-escalation as he cautioned the “world cannot afford” another Gulf War.

Meanwhile, US secretary of state Mike Pompeo criticised allies, including the UK, for not backing the airstrike. But former UK foreign secretary Jeremy Hunt criticised the action, calling it “extreme”.

Nato has suspended ongoing efforts to fight Isis in Iraq amid demands by Iran and its allies for revenge against the US.

Thousands of supporters of Soleimani and Iraqi Shia militia leader Abu Mahdi al-Mohandes gathered in Tehran, Baghdad and other cities to mourn the two men, who were killed in a US airstrike outside the Iraqi capital on Friday and whose funerals took place in Baghdad yesterday.

Yesterday Iran’s supreme leader Ayatollah Ali Khamenei declared three days of mourning, a move followed by the Iraqi prime minister Adel Abdul Mahdi, who declared three days of national mourning in Iraq.

A witness in Tehran described shops putting up portraits of Soleimani and funereal banners being hung in the city’s neighbourhoods.

“He’s seen as a guy who has fought terrorists and brought security for Iranians at home,” said Abas Aslani, a researcher at the Centre for Middle East Strategic Studies in Tehran, in a phone call from the Iranian capital.

Several Iranian officials reiterated longstanding warnings on Saturday that Tehran could target US ships in the Strait of Hormuz, the narrow waterway through which a significant chunk of the world’s energy reserves travel, with one noting that Iran’s missiles could reach Israel.

US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Show all 35 1 /35 US airstrike kills Iran's Qassem Soleimani: Fallout in pictures US airstrike kills Iran's Qassem Soleimani: Fallout in pictures This photo released by the Iraqi Prime Minister Press Office shows a burning vehicle at the Baghdad International Airport following an airstrike in Baghdad, Iraq, early Friday 3 January AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures The wreckage of the car in which general Soleimani was travelling when a targeted US airstrike struck outside Baghdad International Airport on 3 January Ahmad Al Mukhtar via Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Demonstrators burn the US and British flags during a protest in Tehran after general Soleimani was killed in a targeted airstrike by American forces Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A burning vehicle at the Baghdad International Airport following an airstrike. The Pentagon said Thursday that the US military has killed general Qassem Soleimani, the head of Iran's elite Quds Force, at the direction of Donald Trump AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters burn Israeli and US flags as thousands of Iranians take to the streets to mourn the death of general Soleimani at the hands of America EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Supporters of Donald Trump pray at an 'Evangelicals for Trump' campaign event held on the day following the killing of general Soleimani. At the event, the president praised the "flawless strike that eliminated the terrorist ringleader" AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A huge procession of mourners gather in Baghdad for the funeral of general Soleimani on 4 January AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Thousands of Iranians take to the streets to mourn the death of Soleimani during an anti-US demonstration to condemn the killing of Soleimani, after Friday prayers in Tehran, Iran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iraqis perform a mourning prayer for slain major general Qasem Soleimani of the Iranian Revolutionary Guards at the Great Mosque of Kufa AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A billboard reading 'Death to America and Israel', installed by Iran-backed shiite armed groups at a street in Jadriyah district in Baghdad, Iraq EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A handout picture provided by the office of Iran's supreme leader Ayatollah Ali Khamenei shows him visiting the family of Soleiman KHAMENEI.IR/AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Thousands of Iranians take to the streets in Tehran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Pakistani Shiite Muslims burn a mock of a US flag as they hold pictures of General Qasem Soleimani during a protest against the USA, outside the US Consulate in Lahore, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iran's Ambassador to Lebanon Mohammed Jalal Feiruznia, looks to a portrait of Soleimani, as he receives condolences at the Iranian embassy, in Beirut, Lebanon AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures People make their way on the street while a screen on the wall of a cinema shows a portrait Soleimani in Tehran AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Aziz Asmar, one of two Syrian painters who completed a mural following the killing of Iranian Revolutionary Guards commander Qasem Soleimani poses next to his creation in the rebel-held Syrian town of Dana in the northwestern province of Idlib AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A demonstration in Tehran AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures An anti-US demonstration to condemn the killing of Soleimani, after Friday prayers in Tehran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Mujtaba al-Husseini, the representative of Iran's supreme leader Ayatollah Ali Khamenei, delivers a speech in the holy shrine city of Najaf AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Pakistani Shiite Muslims burn a mock of a US and Israeli flags as they hold pictures of General Qasem Soleimani during a protest against the USA, outside the US Consulate in Lahore, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters demonstrate in Tehran AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Pakistani Shi'ite Muslims hold pictures of General Qasem Soleimani during a protest against the USA, in Peshawar, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters, holding a photograph of the leader of the People's Mujahedin of Iran Massoud Rajavi, outside Downing Street in London PA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters burn a US flag in Tehran AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A Syrian man offers sweets to children to mark the killing AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian worshippers attend a mourning prayer for Soleimani in Iran's capital Tehran AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Kashmiri Shiite Muslims shout anti American and anti Israel slogans during a protest AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian worshipers chant slogans during Friday prayers Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A protest against the USA, in Islamabad, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranians burn a US flag in Tehran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Supporters of the National Council of Resistance of Iran in Germany (NWRI) protest outside Iran's embassy in Berlin, Germany Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Supporters of the National Council of Resistance of Iran in Germany (NWRI) protest outside Iran's embassy in Berlin Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian worshippers in Tehran AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Vehicles of the United Nations Interim Forces in Lebanon (UNIFIL) patrol a road in the southern Lebanese town of Kfar Kila near the border with Israel. Following morning's killing of Major General Qasem Soleimani, Lebanon's Iran-backed Hezbollah movement called for the missile strike by Israel's closest ally, to be avenged AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian women take to the streets in Tehran EPA

Atop the dome of the mosque at Jamkaran, a major pilgrimage destination outside the Iranian seminary and shrine city of Qom, a red flag signalling an impending battle was unfurled.

“The Americans really did not realise what a grave error they have committed,” Iran’s president Hassan Rouhani said during a meeting with the family of Soleimani.

“They will feel the impact of such a criminal act not only today but for years to come.”

The fallout of the Soleimani killing had the world and much of the region on edge with concerns about an Iranian response, as well as a potential US counter-response that could lead to a widespread armed conflict.

Soleimani was despised by many Iranians as a pillar of the hardline establishment, and he was hated by Syrians and other Arabs for his role in helping Bashar al-Assad violently suppress a popular uprising against his dictatorship.

But he remains a hero to Iranian regime supporters and some Iraqis for his role in organising the battle against Isis in 2014.

Supporters of the Hashed al-Shaabi paramilitary force and Iraq’s Hezbollah brigades attend the funeral (AFP)

Western officials worry that the Iranian state or its surrogates could carry out attacks to avenge his killing.

“The Americans did something that was unthinkable,” said Mr Aslani. “The repercussions and consequences will be unthinkable as well. It can work both ways.”

The Nato pullback from Iraq is a blow to efforts to keep Isis from regrouping. Hundreds of western soldiers from a broad coalition of countries are in Iraq training local armed forces to take on jihadis in the country’s northern mountains and western desert. Denmark and Sweden had already announced they were withdrawing military personnel.

Iranians tear up a US flag during a demonstration in Tehran (AFP)

“Nato’s mission is continuing, but training activities are currently suspended,” said Nato spokesman Dylan White.

Attempts at defusing the crisis continued. The foreign minister of Qatar, which maintains cordial relations with Iran and hosts a US military base, flew to Tehran on Saturday to confer with Javad Zarif, the Iranian foreign minister in a likely attempt to defuse tensions.

Revolutionary Guard deputy commander Ali Fadavi claimed in a television interview on Friday that the US had passed on a message urging Iranians not to escalate.

“They resorted to diplomacy among other things on Friday morning and even said that if you want revenge, do it proportionately to what we did,” he said. “But they are in no position to determine anything.”

Iran gave few clues about its intentions, but the spokesman for its army insisted on Saturday it would not give a “hasty” response.

Support free-thinking journalism and attend Independent events

One Revolutionary commander, a little-known figure in Iran’s security establishment, said in an interview that dozens of US targets are within range of Iranian firepower.

“Thirty-five vital American positions in the region are within the reach of the Islamic Republic, and Tel Aviv – the US’s heart and life – is also within our reach,” said Gholam Ali Abu-Hamzeh, the Revolutionary Guard commander for Soleimani’s hometown province of Kerman, according to the Tasnim News Agency.

Iran has for years had missiles with ranges up to 1,200 miles that could reach Israel and the Arabian peninsula, where many US troops are based, and it has fired rockets that struck eastern Syria following an Isis attack in 2017.

But most experts say that Iran’s relatively weak naval and air forces would be no match for Israeli air power or US battleships at sea, even though Iran could wreak havoc with guerilla tactics that could send oil prices skyrocketing.