The US assassination of Iran's most high-profile military commander early Friday morning quickly inaugurated a new era of uncertainty throughout the troubled Middle East, with calls by Iran and its allies for retaliation and demands to expel American troops from the region.

Iran’s supreme leader has vowed to avenge the US's killing of Qassem Soleimani, head of the country’s clandestine overseas forces, in a major escalation of hostility between Washington and Tehran in the Middle East.

Ali Khamenei vowed a "harsh" response to the assassination of Soleimani, commander of an elite branch of the Revolutionary Guards called the Quds Force.

US officials said the killing, by what appeared to be an airstrike near Baghdad’s international airport, was ordered by president Donald Trump.

"Harsh vengeance awaits the criminals that got his and other martyrs' blood on their evil hands in last night's incident," said the supreme leader's statement, which celebrated Soleimani’s life.

Khamenei, who had a warm and personal relationship with Suleimani and often spoke of him in glowing terms, declared three days of mourning for the death and that of Abu Mahdi al-Muhandis, a leader of Iranian-backed militias in Iraq, who was accompanying the Iranian general at the time. He quickly appointed Brig Gen Esmaeil Qaani, Suleimani's second-in-command, as new leader of the Quds Force.

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

The Iranian president, Hassan Rouhani, also issued a statement promising action in response to the killing. "Without a doubt, the great Iranian nation and other free nations in the region will take revenge on criminal America for this ghastly crime," he said.

Meanwhile Iraqi leaders vehemently condemned the assassinations, with Prime Minister Adel Abdel Mahdi warning of a "devastating" war that could engulf the region, and a top militia commander, Hadi al-Ameri, calling for action to push US troops out of the country.

“I call on national forces to unify their ranks to expel foreign forces," said Mr Ameri, a onetime protege of the Iran's Revolutionary Guard, according to state television.

“US should either remove all its bases from the region or buy coffins for its troops. It’s up to them, we do not like bloodshed," IRGC Deputy Coordinator Mohammad Reza Naghdi, a mid-ranking commander known for his incendiary remarks, was quoted as saying by state media.

Moqtada al-Sadr, the firebrand Iraqi Shia cleric who led an uprising against US forces in Iraq 15 years ago, announced via Twitter that he was remobilising his infamous Mahdi Army, and called on US troops to leave the country. Still, Ayatollah Ali Sistani, Iraq's most senior Shia cleric, urged restrain after what he described through his representative as a "flagrant violation" by the US.

World leaders appeared taken back by the killing. The head of Russia's Duma said it "crossed the redline."

Charles Michel, president of the European Council, said "the cycle of violence, provocations and retaliations which we have witnessed In Iraq over the past few weeks has to stop."

"The risk is a generalised flare up of violence in the whole region and the rise of obscure forces of terrorism that thrive at times of religious and nationalist tensions," he said in a statement.

Mr Trump pulled the US out of the Iran nuclear deal in May 2018 (Getty)

Of immediate concern to western leaders are hundreds of US, UK and French troops in vulnerable bases throughout Iraq and Syria. The US embassy in Iraq has urged all Americans to leave the country, amid threats to US forces.

The Pentagon said it acted to take out Soleimani, Iran’s most powerful general in Iraq, “at the direction of the president". "The US military has taken decisive defensive action to protect US personnel abroad by killing Qassem Soleimani,” a statement said, calling it a way to deter “future Iranian attack plans.”

As news of the killing spread, Mr Trump tweeted an image of an American flag.

US officials have yet to disclose any evidence tying Suleimani to any attack plans in the past or future.

The death of the Iranian general will likely have major consequences throughout the Middle East. He has been described as the equivalent of the head of Iran’s Joint Special Operations Command.

Assassinating him in Iraq alongside Muhandis will likely provoke Iraqi Shia militias loyal to Iran. It also puts pressure on the fragile Baghdad government, which is in flux after the announced resignation of Mr Abdul Mahdi and pressed by patrons in both Washington and Tehran to do their bidding.

Mahdi was quick to condemn the killing, saying it would "spark a devastating war in Iraq" and describing it as a breach of the deal that permits US presence in the country. He further called on parliament to convene an extraordinary session.

"In carrying out an incident on Iraqi soil, the US has humiliated Iraqi political leaders at a time they need to be supporting weakened relationships in the country," Niamh McBurney, an analyst at the consulting firm Verisk Maplecroft, wrote in a note shared with The Independent.

"It will strengthen groups who want US troops to withdraw from Iraq fully."

Soleimani, 62, had previously been in the sights of US and Israeli forces throughout the Middle East, but in each instance leaders had refrained from killing him for lack of a plan to deal with possible unintended consequences, Western intelligence and security officials have said. It remains unclear how long the US had been planning to assassinate Soleimani, who makes little effort to hide his movements.

The US claimed without providing evidence that Soleimani, who was an architect of Tehran's regional military operations, had “orchestrated” attacks on coalition bases in Iraq over the past few months and approved the attacks on the US embassy in Baghdad earlier this week. But experts in Iran and abroad have said Soleimani had become more of a political figurehead in recent years, posing for photos on social media and making public speeches, as younger officers took on nitty-gritty and operational tasks.

A trove of leaked documents from Iran’s intelligence ministry obtained by The Intercept suggested many Iranian security were tired of his ways, and that he was more of an inspirational celebrity in Iraqi Shia and Iranian pro-government circles than a mastermind in charge of day-to-day planning. He failed to see the rise of Isis in 2014, and scrambled to protect the government of Baghdad afterward.

But Soleimani also continued to play a key role in negiotating with Iraqi government officials, especially brokering deals between Shia factions.

Soleimani, a veteran of the Iran-Iraq war, had a storied career. He was Iran's most recognisable and feared field commander and rose to prominence in the wake of the 2003 US-led invasion of Iraq. He was responsible for fighters in Syria shoring up support for President Bashar Assad against the rebels and Isis. He also played a role in propping up Shia militias that launched deadly attacks on US troops in Iraq.

Tensions between Iran and the US spiked after Mr Trump tore up the 2015 nuclear deal forged by President Barack Obama and other world leaders. The US has launched a campaign of “maximum pressure” meant to destroy the Iranian economy and bring Tehran back to the negotiating table to discuss a new deal. Iran has refused to budge, instead allegedly launching attacks on US allies in the region.

Those attacks could now escalate. Though Soleimani was considered a terrorist menace by the US, he is considered heroic by some of America’s adversaries in the region, including Lebanon’s Hezbollah, Iraqi militias, and possibly elements within Yemen’s Houthis. Soleimani was also close to Iran’s supreme leader, frequently appearing at his side during public events and religious ceremonies.

Iran’s foreign minister Mohammad Javad Zarif warned that Washington "bears responsibility for all consequences of its rogue adventurism".

"The US act of international terrorism, targeting and assassinating General Soleimani—THE most effective force fighting Daesh (ISIS), Al Nusrah, Al Qaeda et al—is extremely dangerous and a foolish escalation,” he said on Twitter.

It remains unclear how Iran will respond. In Mr Trump, Iran faces an unpredictable adversary, who wavers between calls for talks and violent bluster. But Iran too has shown it is willing to respond to escalation with its own escalations.

“While America dominates the world in terms of conventional military force, Iran’s advantage is in the asymmetric sphere, so rocket attacks, bombings, assassinations and even attacks like the missile assault on Saudi oil facilities in September 2019,” Middle East Institute scholar Charles Lister wrote.

Still Ms McBurney said "the risk of direct military confrontation is still remote."

Though Iranian state television showed images of angry supporters mourning and beating their chests, Iran remains badly divided, and many Iranians are quietly hailing the assassination of a man seen as a pillar of regime hardliners, and a possible successor to Mr Rouhani.

Iranian Revolutionary Guard spokesman cries over Qassem Soleimani's death on state TV

Muhandis was deputy commander of Iran-backed militias in Iraq known as the Popular Mobilisation Forces (PMF). Iraqi officials reported five others were also killed, including the PMF's airport protocol officer, Mohammed Rida. ​

Among Iraqi supporters of the paramilitary forces, there was widespread anger.

“The American and Israeli enemy is responsible for killing the mujahideen Abu Mahdi al-Muhandis and Qassem Soleimani,” said Ahmed ​al-Assadi, a spokesman for the militias, which are an official part of the Iraqi security forces.

Local militia commander Abu Muntathar al-Hussaini told Reuters that Soleimani and Al-Muhandis were riding in the same vehicle when it was "struck by two successive guided missiles launched from an American helicopter".

They were apparently on their way from the arrivals hall on the road that leads out of Baghdad Airport.

He said the second vehicle was carrying bodyguards from the PMF and was hit by one rocket.

"The American criminals had detailed information on the convoy's movements," the local commander said.