An air strike has hit two cars carrying Iran-backed militia north of Baghdad, a day after a US attack killed top Iranian general Qassem Soleimani, an Iraqi official says.

Key points: The US assassinated Qassem Soleimani, the head of Iran's elite Quds Force, on Friday

The US assassinated Qassem Soleimani, the head of Iran's elite Quds Force, on Friday Almost exactly 24 hours after General Soleimani was killed, another air strike has killed five Iran-backed militia members in Iraq

Almost exactly 24 hours after General Soleimani was killed, another air strike has killed five Iran-backed militia members in Iraq No-one has claimed responsibility for the second air strike but an anonymous US official said it was not them

The official said five members of the militia were killed in the latest strike.

On Friday, the Pentagon confirmed the killing in Baghdad of General Soleimani, the head of Iran's elite Quds Force and the architect of Tehran's proxy wars in the Middle East.

Iran promised to seek revenge in the wake of the targeted killing.

The death of Soleimani marks a major escalation in the standoff between Washington and Iran, which has careened from one crisis to another since President Donald Trump withdrew from the 2015 nuclear deal and imposed crippling sanctions.

The air strike, almost exactly 24 hours after the one that targeted General Soleimani, killed five members of an Iran-backed militia north of Baghdad, an Iraqi security official said, speaking on condition of anonymity because he was not authorised to talk to reporters.

The Iran-backed Popular Mobilization Forces confirmed the strike, saying it hit one of its medical convoys near the stadium in Taji, north of Baghdad.

The group said none of its top leaders were killed.

A US official said the attack was not an American military attack. The official spoke on condition of anonymity.

The targeted strike against General Soleimani and any retaliation by Iran could ignite a conflict that engulfs the whole region, endangering US troops in Iraq, Syria and beyond.

Over the last two decades, General Soleimani had assembled a network of heavily armed allies stretching all the way to southern Lebanon, on Israel's doorstep.

"We take comfort in knowing that his reign of terror is over," Mr Trump said of General Soleimani.

Still, the United States said it was sending nearly 3,000 more Army troops to the Middle East, reflecting concern about potential Iranian retaliation for the killing.

The US also urged American citizens to leave Iraq "immediately" following the early morning air strike at Baghdad's international airport that Iran's state TV said killed General Soleimani and nine others.

The State Department said the embassy in Baghdad, which was attacked by Iran-backed militiamen and their supporters earlier this week, has been closed and all consular services have been suspended.

Around 5,200 American troops are based in Iraq to train Iraqi forces and help in the fight against Islamic State group militants.

Defence officials who discussed the new troop movements spoke on condition of anonymity to discuss a decision not yet announced by the Pentagon.

A Pentagon official who was not authorised to be identified said the US also had placed an Army brigade on alert to fly into Lebanon to protect the US embassy.

US embassies also issued a security alert for Americans in Bahrain, Kuwait and Nigeria.

The US announcement about sending more troops came as Mr Trump said General Soleimani's killing was not an effort to begin a conflict with Iran.

"We took action last night to stop a war. We did not take action to start a war," Mr Trump said, adding that he does not seek regime change in Iran.

Iran's vows 'harsh retaliation'

Iranian demonstrators attend a protest against the assassination of the Iranian Major-General Qassem Soleimani. ( Reuters: West Asia News Agency/ Nazanin Tabatabaee )

Iran's Supreme Leader Ayatollah Ali Khamenei vowed "harsh retaliation" after the air strike, calling General Soleimani the "international face of resistance".

Mr Khamenei declared three days of public mourning and appointed Major General Esmail Ghaani, General Soleimani's deputy, to replace him as head of the Quds Force.

Iranian President Hassan Rouhani called the killing a "heinous crime" and said his country would "take revenge".

Iran twice summoned a Swiss envoy, the first time delivering a letter to pass onto Washington.

Iranian Foreign Minister Mohammad Javad Zarif called the US attack a "cowardly terrorist action" and said Iran has the right to respond "in any method and any time".

Thousands of worshipers in Tehran took to the streets after Friday prayers to condemn the killing, waving posters of General Soleimani and chanting "Death to deceitful America".

Iranian demonstrators chanted "Death to deceitful America". ( Reuters: West Asia News Agency/ Nazanin Tabatabaee )

However, the attack could act as a deterrent for Iran and its allies to delay or restrain any potential response.

Mr Trump said possible targets had been identified and the US was prepared.

Oil prices surged on news of the air strike and markets were mixed.

The killing promised to further strain relations with Iraq's government, which is allied with both Washington and Tehran and has been deeply worried about becoming a battleground in their rivalry.

Iraqi politicians close to Iran called for the country to order US forces out.

The Defence Department said it killed the 62-year-old General because he "was actively developing plans to attack American diplomats and service members in Iraq and throughout the region".

It also accused General Soleimani of approving orchestrated violent protests at the US embassy in Baghdad.

AP