Iran has been urged to avoid "further violence and provocations" by NATO's General Secretary, following emergency talks on the growing crisis in the Middle East.

Jens Stoltenberg said all members of the Atlantic alliance stood behind the United States in the Middle East, after a US drone strike killed Iranian military commander Qasem Soleimani last week.

Speaking after the meeting on Iran and Iraq, in which the US briefed its allies about the deadly drone strike, Mr Stoltenberg also called for a de-escalation of tension, echoing the statements of some European leaders

His comments come after US President Donald Trump repeated his insistence that Iran will not be allowed to obtain a nuclear weapon.

The tweet came a day after the Iranian government announced it was further winding down observance of parts of an international deal struck to ensure that the country does not secretly develop a nuclear weapon under cover of its civilian nuclear industry.

Mr Trump withdrew the United States from the 2015 deal negotiated under his predecessor Barack Obama.

He has already threatened "major retaliation" if Iran avenges the killing of its key military commander and he warned of massive economic sanctions against ally Iraq if the country expels US troops based there.

Mr Trump ordered a US drone to fire a missile at General Soleimani, one of the most influential people in Iran's government, when he was near the Iraqi capital's international airport.

In Tehran, mourners have packed the streets for ceremonies to pay homage to General Soleimani.

Clutching portraits of the late general, the crowd gathered at Tehran University before supreme leader Ayatollah Ali Khamenei presided over prayers for Gen Soleimani.

In freezing early morning temperatures, women in black walked alongside men holding up flags bearing the names of Shia imams as they walked down Tehran's Enghelab (Revolution) Street towards the university.

The procession was broadcast live on state television, with screens bearing a black ribbon across the top left hand corner in a rare tribute.

Ayatollah Khamenei appeared to cry as he prayed over the flag-draped coffins containing the remains of Gen Soleimani and five other "martyrs" killed in the strike.

Thousands of people attending the funeral of Qasem Soleimani
Iranian Supreme Leader Ayatollah Ali Khamenei and Iranian President Hassan Rouhani attend the funeral ceremony of Qasem Soleimani (Pic: Iranian Leader Press Office/Handout)

The supreme leader was flanked by Gen Soleimani's son, the slain general's replacement as Quds commander Esmail Qaani, President Hassan Rouhani, parliament speaker Ali Larijani and the Guards' top commander Major General Hossein Salami.

People prayed together with Ayatollah Khamenei whose voice cracked as he spoke. "We must give a crushing response," one of the mourners said.

"We must target whatever military base they have in the region. We must attack all that are in the range of our missiles."

Mourners in Tehran formed a sea of black along Enghelab Street dotted with red Shia flags and white signs.

One of the placards held aloft by a man read "#hard_revenge".

Mr Trump bluntly warned Iran against taking vengeance, repeating his insistence that US bombing targets could include Iran's cultural heritage sites.

Critics say that would qualify as a war crime under international law.

"If they do anything there will be major retaliation," Mr Trump told reporters on Air Force One, as he flew back to Washington - and a looming Senate impeachment trial - from holiday in Florida.

Mr Trump had already threatened bombing 52 unspecified targets in Iran if Tehran attacks US troops and interests in the region.

He was adamant that targets could include places of cultural significance in a country boasting an ancient heritage and two dozen UNESCO-listed sites.

"They're allowed to kill our people," a defiant Mr Trump said.

"They're allowed to torture and maim our people. They're allowed to use roadside bombs and blow up our people. And we're not allowed to touch their cultural site? It doesn't work that way."

Read more:
US and Iran must protect cultural sites - UNESCO
US-Iran tension: A dangerous turning point
The killing of Soleimani: What happens next?

The situation in neighbouring Iraq, a US ally, also deteriorated, with the future of some 5,200 American soldiers there in doubt.

Many Iraqis have expressed outrage over the killing of Gen Soleimani, who masterminded deep Iranian influence in the country.

A top Iraqi military figure Abu Mahdi al-Muhandis was killed in the same US strike.

Qasem Soleimani was the Iranian Revolutionary Guards Corps Lieutenant General and Commander of the Quds Force

In Baghdad, unidentified attackers launched a pair of rockets yesterday, hitting near the US embassy in the high-security Green Zone for the second night in a row. That was just hours after Iraq's foreign ministry summoned the American ambassador over the drone strike.

Iraq's parliament voted to request the government end an agreement with a US-led international coalition to fight the hardline Islamist group IS in the region.

If the government agreed, that would effectively require the departure of US soldiers supporting the local troops in the anti-IS fight.

Caretaker prime minister Adel Abdel Mahdi, who called the US drone strike a "political assassination", indicated he would back the troops' removal. He said the choices were immediate expulsion or withdrawal under a time-frame.

Mr Trump told reporters that a forced departure of US troops would prompt sanctions even worse than those already imposed, to devastating effect, on Iran's economy.

"If they do ask us to leave - if we don't do it in a very friendly basis - we will charge them sanctions like they've never seen before," Mr Trump said. 

"It'll make Iranian sanctions look somewhat tame."

Mr Trump said the main US base in Iraq was "very extraordinarily expensive ... we're not leaving unless they pay us back for it", he said.

General Soleimani was one of Iran's most popular public figures, seen as a hero of the 1980-88 Iran-Iraq war.

He was also the key figure behind Iran's effective network of proxy militias and alliances across a region where Iran is in often deadly rivalry with US allies Israel and Saudi Arabia.

Meanwhile, Taoiseach Leo Varadkar has said the Government was very concerned about any escalation of tensions in the Middle East. 

He said: "The last thing Iran or Iraq or any part of the Middle East needs now is another conflict.

"We know what the effects of the conflicts in Iraq and Syria have been, not just for that region but also for other parts of the world.

"It is very much our desire that the situation should be de-escalated and the structures of the EU and the UN are there as well to do that."