The United States killed Iran's most powerful general in an air strike at Baghdad's international airport on Friday, on the direct orders of President Donald Trump.

Key points: The Pentagon says the strike was carried out to deter future attacks

The Pentagon says the strike was carried out to deter future attacks A former Iran Revolutionary Guard chief has vowed "vigorous revenge on America"

A former Iran Revolutionary Guard chief has vowed "vigorous revenge on America" The attack takes the US confrontation with Iran to a dangerous new level

The Pentagon confirmed the death of Qassem Soleimani, the head of Iran's elite Quds Force and the architect of Tehran's proxy wars in the Middle East.

Major-General Soleimani and Iraqi militia commander Abu Mahdi al-Muhandis were killed in the strike on their convoy near the Baghdad airport, an Iraqi militia spokesman told Reuters.

"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 Iraq's Popular Mobilisation Forces umbrella grouping of Iran-backed militias.

Three missiles hit the Baghdad airport, killing five members of Iraqi paramilitary groups and two "guests", Iraqi paramilitary groups said. The rockets landed near the air cargo terminal, burning two vehicles.

"This strike was aimed at deterring future Iranian attack plans," the Pentagon said in a statement.

It said the military took "decisive defensive action to protect US personnel abroad by killing Qassem Soleimani" and that it considered the Quds Force to be a foreign terrorist organisation.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 23 seconds 23 s Video posted to Twitter by Ehab Al Obaidy appears to show the fiery aftermath of US air strikes near Baghdad's international airport (Photo: AP)

"General Soleimani was actively developing plans to attack American diplomats and service members in Iraq and throughout the region," it said.

"General Soleimani and his Quds Force were responsible for the deaths of hundreds of American and coalition service members and the wounding of thousands more.

Explaining the strike in self-defence terms was also echoed by US Secretary of State Mike Pompeo, who said Soleimani was planning an "imminent attack".

"He was actively plotting in the region to take actions — a big action as he described it — that would have put dozens if not hundreds of American lives at risk. We know it was imminent," Mr Pompeo told CNN.

Loading

He added that the United States has fortified its assets in the region and is prepared for any possible retaliation, including a cyber attack.

The US maintains that Soleimani was responsible for multiple attacks on coalition bases in Iraq over the last several months, including one on December 27 in which a US civilian contractor and Iraqi personnel were killed during a rocket attack on a military base in northern Iraq.

The US military retaliated by carrying out air strikes against Iranian-linked militia fighters in Iraq and Syria.

This in turn led to hundreds of pro-Iranian protesters and militia attempting to storm the US embassy in Baghdad on New Year's Eve.

Mr Trump tweeted a photo of the American flag without explanation just moments before the US claimed responsibility for the air strike.

"Iran never won a war, but never lost a negotiation!" Mr Trump later tweeted.

'This is bigger than taking out bin Laden'

The Pentagon said Qassem Soleimani had approved attacks on US assets. ( AP: Ebrahim Noroozi, file )

A former commander of Iran's Revolutionary Guards, Mohsen Rezaei, vowed "vigorous revenge" against America for the killing of General Soleimani, describing him as a "martyr".

"Martyr Lieutenant General Qassem Soleimani joined his martyred brothers, but we will take vigorous revenge on America," Mr Rezaei said in a post on Twitter.

Iranian Foreign Minister Mohammad Javad Zarif said the assassination would strengthen resistance against the US and Israel in the region and the world, Iranian state television reported.

"The brutality and stupidity of American terrorist forces in assassinating Commander Soleimani … will undoubtedly make the tree of resistance in the region and the world more prosperous," Mr Zarif said in a statement.

Loading

Academic Ranj Alaaldin, author of Sacred Warriors, a recent book on Shiite militias and the future of Iraq, said on Twitter that the significance of the hit could not be overstated.

"Make no mistake — this is bigger than taking out Osama bin Laden," he wrote.

General Soleimani, who was responsible for coordinating foreign military actions, survived several assassination attempts against him by Western, Israeli and Arab agencies over the past two decades.

Tensions remain between US President Donald Trump and Iranian President Hassan Rouhani. ( AP/Reuters )

Earlier this week, top Iraqi militia commander al-Muhandis, also known as Jamal Jaafar Ibrahimi, warned of a strong reaction against US forces following air strikes.

"The blood of the martyrs will not be in vain and our response will be very tough on the American forces in Iraq," he said.

Trump 'tossed a stick of dynamite into a tinderbox'

Democratic presidential candidate Joe Biden said Mr Trump has "tossed a stick of dynamite into a tinderbox". ( AP: Frank Franklin II )

House Speaker Nancy Pelosi said the Trump administration conducted the airstrike without consulting Congress or having any authorisation to use military force against Iran.

She said the move "risks provoking further dangerous escalation of violence."

Democratic presidential candidate Joe Biden said Mr Trump had "tossed a stick of dynamite into a tinderbox".

The former vice-president joined other Democratic White House hopefuls in criticising Mr Trump's order, saying it could leave the US "on the brink of a major conflict across the Middle East."

Democrats also acknowledged the threat formerly posed by General Soleimani, with Senator Elizabeth Warren calling him "a murderer, responsible for the deaths of thousands, including hundreds of Americans."

However she added, Mr Trump's "reckless move escalates the situation with Iran and increases the likelihood of more deaths and new Middle East conflict."

Western citizens urged to leave Iraq 'immediately'

Protests against the US have erupted across Iraq over the past week. ( Reuters: Khalid al-Mousily )

The US is now urging citizens to leave Iraq "immediately", citing "heightened tensions in Iraq and the region".

"Due to Iranian-backed militia attacks at the US Embassy compound, all consular operations are suspended. US citizens should not approach the Embassy," the US State Department said in a statement.

The Australian Department of Foreign Affairs and Trade (DFAT) has issued similar advice, urging Australians in the country to "leave Iraq as soon as possible" if it is safe to do so.

It noted that "the security situation could worsen with little warning", and has warned of a "very high risk of violence, armed conflict, kidnapping, and terrorist attack".

The BBC also reports that Dutch nationals have been advised to leave Baghdad.

The ABC has approached Australian Foreign Minister Marise Payne for comment.

ABC/wires