Iraqi factions threatening to oust US troops, officials denouncing American "violations" and fears of a new Gulf war: a US strike has catapulted Iraq back to the tumultuous aftermath of the 2003 invasion.

The precision drone strike outside Baghdad airport on Friday killed top Iranian commander Qasem Soleimani and his Iraqi right-hand-man, Abu Mahdi al-Muhandis.

Within hours, United Nations chief Antonio Guterres urged leaders to exercise restraint.

"The world cannot afford another war in the Gulf," he said.

The US attack was the most dramatic escalation yet in a feared proxy war between Iran and the US on Iraqi soil.

It also opened the door to fierce criticism of the US, harkening back to the years following the American-led invasion that toppled ex-dictator Saddam Hussein.

"The narrative of anti-Americanism is coming back," said Renad Mansour of the London-based Chatham House.

"America hasn't done something this aggressive in a while, so it has brought back memories of the American military occupation of Iraq, as well as the same language and discourse," he told AFP.

Iraq's premier, Adel Abdel Mahdi, condemned the strike as a violation of Iraqi sovereignty and of the US military's mandate in the country.

Iranians burn a US flag during a demonstration against American "crimes Iranians burn a US flag during a demonstration against American "crimes" Photo: AFP / ATTA KENARE

Around 5,200 American forces are deployed across Iraq to train and advise local troops targeting the remnants of the Islamic State group.

Pro-Iran factions had for months been urging parliament to revoke the bilateral agreement allowing US troops in Iraq, and Mansour said the strike could bolster their argument.

"They tried to use anti-Americanism before but no one really bought it. Now, it feels like they have more ammunition and justification to make anti-Americanism a bigger narrative," he told AFP.

Indeed, top officials in the Hashed al-Shaabi, a network of mostly pro-Iran groups incorporated into the state, swiftly began calling for the departure of US forces.

Leading Hashed member Hadi al-Ameri urged lawmakers "to take a bold decision to oust foreign troops from Iraq, because their presence has become a threat for Iraqis".

Firebrand cleric Moqtada Sadr swiftly reactivated his Mahdi Army, the notorious militia that fought US troops after the invasion but which was dissolved nearly a decade ago.

Qais al-Khazali, a US-sanctioned paramilitary leader, also called on his fighters to "be ready" following the strike.

And Kataeb Hezbollah, a hardline Hashed faction, predicted that the deadly raid would ring in "the beginning of the end for the US presence in Iraq and the region".

A mock US flag is laid on the ground for cars to drive over in the Iraqi capital Baghdad A mock US flag is laid on the ground for cars to drive over in the Iraqi capital Baghdad Photo: AFP / AHMAD AL-RUBAYE

Less than a week earlier, the US had killed 25 Kataeb Hezbollah fighters in retaliatory bombings for the death of an American contractor in northern Iraq.

In response, streams of Hashed supporters laid siege to the US embassy in Baghdad this week.

Even Iraqi figures known not to back the Hashed, including top Shiite cleric Grand Ayatollah Ali al-Sistani and President Barham Saleh, condemned the strike publicly.

"Some think today's hit clips Iran's wings in Iraq. The opposite is more likely," wrote Fanar Haddad of Singapore University's Middle East Centre.

"Iraqi political classes are likely to align more strongly with Iran due to compulsory solidarity and some indignation," he said.

The Iraqi premier said Muhandis -- who was deputy head of Hashed and therefore a government official -- would be mourned in an official funeral procession on Saturday.

Iraqi state television reported a further US strike in Baghdad on Saturday morning, targeting a convoy belonging to the Hashed al-Shaabi, but there was no immediate comment from Washington.

Analyst Nick Heras said targeting the Hashed could have "significant ramifications" for US-Iraqi ties.

"It means that the United States is engaged in a conflict with a component of the state-sanctioned Iraqi security forces," he warned.

Pro-Iran factions "now have a political and government wing, media outlets, money, relations, experience, arms, human resources and a supportive public", said specialist Hisham al-Hashemi.

As a result, Washington felt it was "no longer the most powerful actor in Iraq" and sought to regain leverage through the "adventurous policy" of the Soleimani strike, he said.

Ramzy Mardini of the US Institute of Peace said the crisis may have been caused by a "miscalculation" on both sides, with the US overestimating the threat to its embassy.

"Tehran did not appreciate that the threat of another Iranian hostage crisis would change the rules of American engagement," Mardini said, referring to the 1979 storming of the US embassy in Tehran.

The US action also frustrated traditional allies as it was launched with little coordination or advance warning, according to diplomatic sources in Baghdad.

Iraq's parliament will hold an emergency session Sunday, with lawmakers threatening to call for the ouster of US troops.

"Iraqis realise that the US isn't a long-term ally -- it neither cares nor matters," said Mansour.

They see a US administration without a cohesive objective while Iran's policy is more fixed.

"There used to be a debate about who has influence, the US or Iran? Now no one is even asking -- Iran has the clear advantage."