America's military strategy in Iraq was thrown into confusion Monday as the Pentagon admitted a letter from a general informing the Iraqi government of an imminent US troop pullout was sent by "mistake."

The latest developments came as a sea of black-clad mourners in Tehran paid homage to Qasem Soleimani, the head of the Iranian Revolutionary Guards' Quds Force who was killed in a US strike in Iraq on Friday.

"We respect your sovereign decision to order our departure," said the letter, whose authenticity was confirmed to AFP by both Iraqi and US defence officials.

Seely said the US-led coalition would "be repositioning forces."

"In order to conduct this task, Coalition Forces are required to take certain measures to ensure that the movement out of Iraq is conducted in a safe and efficient manner," said the letter.

It said helicopters would be travelling in and around Baghdad's Green Zone where the US embassy is located as part of the preparations.

Iranians filled second city Mashhad on Sunday to pay homage to Soleimani Iranians filled second city Mashhad on Sunday to pay homage to Soleimani Photo: IRAN'S FARS NEWS AGENCY / MEHDI JAHANGHIRI

AFP could hear helicopters flying low over Baghdad throughout the night on Monday.

But Pentagon Joint Chiefs Chairman Mark Milley said on Monday the letter was a mere "draft" and "should not have been sent."

"It was a mistake, an honest mistake, a draft unsigned letter, because we are moving forces around," Milley told reporters in Washington.

Map of Iran and Iraq showing latest developments in military escalation in which Iranian General Qasem Soleimani was killed in a US strike on the orders of Donald Trump Map of Iran and Iraq showing latest developments in military escalation in which Iranian General Qasem Soleimani was killed in a US strike on the orders of Donald Trump Photo: AFP / Gal ROMA

US Defence Secretary Mark Esper said the letter was "inconsistent" with Washington's position and denied there had been a decision to leave Iraq.

The US drone strike that killed Soleimani, as well as Iraqi military commanders, has sparked fury in both Iran and Iraq, with Tehran vowing revenge.

Iraqi lawmakers on Sunday urged the government to oust all foreign troops from Iraqi soil.

Soleimani was described as the second most powerful man in Iran Soleimani was described as the second most powerful man in Iran Photo: AFP / SABAH ARAR

Some 5,200 US soldiers are stationed across Iraqi bases to support local troops preventing a resurgence of the Islamic State group.

They make up the bulk of a broader coalition, invited by the Iraqi government in 2014 to help combat the jihadists.

IMAGES Mourners pack the streets of Tehran for ceremonies to pay homage to top Iranian military commander Qasem Soleimani, after he was killed in a US strike in Baghdad. IMAGES Mourners pack the streets of Tehran for ceremonies to pay homage to top Iranian military commander Qasem Soleimani, after he was killed in a US strike in Baghdad. Photo: AFPTV / Majid SOURATI

On Monday, Iran's supreme leader Ayatollah Ali Khamenei fought back tears as mourners flooded the streets around Tehran University to honour Soleimani.

The targeted killing of the 62-year-old Soleimani saw Iran step back even further from the already tattered 2015 nuclear accord with world powers.

In an escalating war of words that has heightened international concern and rattled financial markets, Trump threatened yet more "major retaliation" if Tehran hits back, including strikes on Iranian cultural sites.

Writing in all-caps on Monday, Trump tweeted: "IRAN WILL NEVER HAVE A NUCLEAR WEAPON!"

Iran's supreme leader Ayatollah Ali Khamenei presided over prayers for the slain general Iran's supreme leader Ayatollah Ali Khamenei presided over prayers for the slain general Photo: IRAN PRESS / Israr AHMED KHAN

Iraq requested in a letter to the UN -- seen by AFP -- that the Security Council condemn the US drone strike, so that "the law of the jungle" was not allowed to prevail.

The operation represented "a dangerous escalation that could lead to a devastating war in Iraq, the region and the world," wrote the Iraqi ambassador to the UN, Mohammed Hussein Bahr-Aluloom.

NATO chief Jens Stoltenberg warned Iran must avoid "further violence and provocations" after the alliance held emergency talks in Brussels.

"At our meeting today, allies called for restraint and de-escalation. A new conflict would be in no-one's interest," he said.

Saudi Arabia -- an oil-rich US ally seen as vulnerable to Iranian counter strikes -- also appealed for calm.

The European Union, whose foreign ministers will hold emergency talks Friday, said it was in Iran and Iraq's interest to "take the path of sobriety and not the path of escalation."

EU diplomatic chief Josep Borrell said he "deeply regrets" Iran's latest step back from the nuclear deal.

The agreement had offered Tehran sanctions relief in return for curbs to prevent it acquiring nuclear weapons -- but Trump's withdrawal in 2018 dramatically weakened the deal.

Despite its latest step, Iran insisted it would continue to cooperate with the UN agency overseeing its atomic programme.

The raw emotions sparked by the killing of Soleimani were on full display in Tehran, where state television said "several million" black-clad mourners filled the streets.

"The last time I remember such a crowd was at Ayatollah Khomeini's funeral 30 years ago," said Iranian journalist Maziar Khosravi.

As they marched down a main artery of Tehran, the mourners chanted "Death to America" and "Death to Israel".

Soleimani, a beloved hero of the 1980s war with Iraq, will be laid to rest in his hometown Kerman on Tuesday.

Trump on Saturday issued a US strike list of 52 targets in the Islamic republic.

"Those who refer to the number 52 should also remember the number 290. #IR655 Never threaten the Iranian nation," Rouhani tweeted, referring to 290 lives lost in July 1988 when a US warship shot down an Iran Air plane in the Gulf.

Trump said his figure of 52 targets represented the number of Americans held hostage at the US embassy in Tehran for more than a year starting in late 1979.

Amid the tensions in the oil-rich region, crude prices surged and most equities tumbled while safe-haven gold hit a more than six-year high.