Dramatic images of the flaming wreckage left by US airstrikes that killed Iranian commander Qassem Soleimani have been published by the Iraqi military.

The Pentagon said on Friday that Donald Trump ordered the surprise attack on two vehicles close to Baghdad International Airport, marking a serious provocation in already tense relations between US, Iran and their allies.

Soleimani, the hugely influential Revolutionary Guard Quds Force commander said to have played a role in almost every aspect of Iranian military expansion across the Middle East, was reported dead alongside Abu Mahdi al-Muhandis, a leader of the Popular Mobilisation Forces (PMF) – an Iranian-backed Iraqi militia.

Iraqi paramilitary groups said three rockets landed near the air cargo terminal, killing five members of the PMF and two “guests”, injuring several others.

Iraq’s parliamentary speaker Mohammed al-Halboosi condemned the attack as “a flagrant violation of sovereignty, and a violation of international conventions”, but joined international calls for all parties to “exercise restraint”.

Images released by an official Iraqi press office show a burning vehicle at Baghdad International Airport (Iraqi Security Media Cell via AP)

Failure to do so, Mr al-Halboosi said, risked turning Iraq into a “battlefield”.

Mr Trump initially responded publicly to the attack by posting an uncaptioned image of the US flag on Twitter, later writing that Soleimani “should have been taken out many years ago”.

“[He] killed or badly wounded thousands of Americans over an extended period of time, and was plotting to kill many more... but got caught,” Mr Trump said.

“He was directly and indirectly responsible for the death of millions of people, including the recent large number of protesters killed in Iran itself," but it’s unclear who the “millions” of dead Trump is referring to are, writes our Middle East correspondent Richard Hall.

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 (AP)

The pro-Iranian PMF have been accused of playing a central role in the civilian fatalities that have exacerbated Iraq’s deadly protests, while Iraqi government officials strongly deny any internal responsibility for unprecedented “shoot to kill” orders.

The fresh escalation on Friday came days after the US launched airstrikes in Syria and Iraq on members of an Iranian-backed militia, as retaliation for the death of a US military contractor.

Hundreds of Iraqi demonstrators stormed the US embassy in response, while US forces – deployed to train the Iraqi military and conduct anti-Isis operations – fired tear gas at the enraged civilians.