Baghdad, Jan 4 (AFP) Tens of thousands of Iraqis mourned a top Iranian commander and others killed in a US drone attack, before near-simultaneous mortar and rocket attacks targeted American troops late Saturday.

The killing of Iran's Major General Qasem Soleimani on Friday was the most dramatic escalation yet in spiralling tensions between Iran and the US, which pledged to send thousands more troops to the region, amid fears of a regional proxy war between the foes.

In the first hints of a possible retaliatory response, mortar rounds hit an area near the US embassy in Baghdad on Saturday, security sources told AFP.

Moments later, two rockets slammed into an Iraqi base where American troops are deployed, security sources said.

The Iraqi military confirmed the missile attacks in Baghdad and on Balad base and said there were no casualties.

US troops and diplomats had been bracing themselves for more rocket attacks following the precision drone strike that killed Iran's military mastermind Soleimani.

On Saturday, Iraqi political leaders and clerics attended the mass ceremony to honour 62-year-old Soleimani and the other nine victims of the hit on Baghdad airport.

Trump had said Soleimani was planning an "imminent" attack on US diplomats and the roughly 5,200 American troops deployed in Baghdad.

A furious Iran has vowed revenge for the killing of Soleimani, the chief architect of its military operations across the Middle East.

"The response for a military action is a military action," Iranian ambassador to the United Nations Majid Takht Ravanchi told CNN, calling the strike an "act of war".

"By whom, by when, where? That is for the future to witness." World powers quickly called for a de-escalation, and Qatari Foreign Minister Mohammed bin Abdulrahman Al-Thani was in Tehran on Saturday for talks with his Iranian counterpart Mohammad Javad Zarif.

The pair discussed Soleimani's killing, with Zarif insisting Iran did "not want tension in the region".

Zarif had earlier rebuffed a diplomatic effort by the United States, who sent a letter to Iranian officials through a Swiss envoy, as Tehran and Washington have not had direct diplomatic ties for decades.

Iran's Revolutionary Guards said Washington had used "diplomatic measures" to urge Tehran to respond "in proportion" to the strike -- a message Zarif slammed as "foolish".

Switzerland confirmed Saturday its charge d'affaires had delivered a message from the US to Iran.

The US strike killed a total of five Iranian Guards and five members of Iraq's Hashed al-Shaabi paramilitary network, whose members have close ties to Tehran.

Among the dead was Hashed's deputy head Abu Mahdi al-Muhandis, a top adviser and personal friend to Soleimani.

Mass ceremonies started in Baghdad on Saturday for them, with Iraq's caretaker premier Adel Abdel Mahdi and top pro-Iran figures in large crowds accompanying the coffins.

Tens of thousands of mourners across the country waved white Hashed flags and massive portraits of Iranian and Iraqi leaders, furiously calling for "revenge" and "Death to America!"

The remains were moved from Baghdad to the shrine city of Karbala and would ultimately end up in Najaf, where the Iraqis will be buried.

The Guards' remains would be flown to Iran, which has declared three days of mourning and religious rituals.

As head of the Guards' foreign operations arm, the Quds Force, Soleimani was a powerful figure domestically and oversaw Iran's wide-ranging interventions in regional power struggles.

He had long been considered a lethal foe by Washington, with Trump saying he should have been killed "many years ago".

Iran's supreme leader Ayatollah Ali Khamenei promised "severe revenge" for Soleimani's death and Tehran named Soleimani's deputy, Esmail Qaani, to succeed him.

Iraqis worry the US strike could unleash tit-for-tat strikes between the Hashed and the US.

Early on Saturday, the Hashed claimed a new strike had hit their convoy north of Baghdad, with Iraqi state media blaming the US.

But the US-led coalition denied involvement, telling AFP: "There was no American or coalition strike." About 5,200 US troops are stationed across Iraq to help fight IS.

They have faced a spate of rocket attacks that the US has blamed on pro-Iran factions and which last month killed an American contractor.

Following tensions, NATO said it was suspending its training activities in Iraq and a US defence official told AFP that American-led coalition forces would "limit" operations.

"Our first priority is protecting coalition personnel," the official said, saying surveillance had shifted from IS to watching for incoming rocket attacks.

Iraq's pro-Iran factions have seized on Soleimani's death to push parliament, which convenes Sunday, to revoke the security agreement allowing US forces on Iraqi soil.

While praying over Muhandis's remains in Baghdad, top Hashed official Hadi al-Ameri pledged to avenge him by ousting US troops.

"Be reassured that the price of your pure blood will be the departure of American troops from Iraq, forever," he said. (AFP)

(This is an unedited and auto-generated story from Syndicated News feed, LatestLY Staff may not have modified or edited the content body)