Latest developments:

Canadian and Iraqi foreign affairs ministers speak, agree de-escalation in tensions needed for peace, stability.

Iran's religious leader prays over casket of Gen. Qassem Soleimani and others killed in U.S. airstrike.

Leader of Hamas joins the massive crowd and tells mourners Soleimani is a martyr.

Slain general's daughter threatens attack on 'families of American soldiers.'

Soleimani's successor promises to 'get rid of America' from the Middle East.

Trump rejects pressure to withdraw troops from Iraq, saying U.S. won't leave without compensation for military investments.

NATO says it's prepared to resume suspended military training mission in Iraq 'when the situation permits.'

Weeping amid wails from a crowd of hundreds of thousands of mourners, Iran's supreme leader on Monday prayed over the casket of a top Iranian general killed in a U.S. airstrike in Baghdad, an attack that's drastically raised tensions between Tehran and Washington.

The targeted killing of Islamic Revolutionary Guard Gen. Qassem Soleimani already has seen his replacement vow to take revenge. Additionally, Tehran has abandoned the remaining limits of its 2015 nuclear deal with world powers in response to the slaying, while in Iraq, the parliament has called for the expulsion of all American troops from Iraqi soil.

The developments could bring Iran closer to building an atomic bomb, set off a proxy or military attack launched by Tehran against America and enable the Islamic State in Iraq and Syria (ISIS) to stage a comeback in Iraq, making the Middle East a far more dangerous and unstable place.

Adding to the tensions, U.S. President Donald Trump threatened to demand billions of dollars in compensation from Iraq or impose "sanctions like they've never seen before" if it goes through with expelling U.S. troops.

Members of the Revolutionary Guard surround the coffins of slain Iranian military commander Qassem Soleimani, Iraqi paramilitary chief Abu Mahdi al-Muhandis and others killed in a U.S. drone strike as mourners gather to pay homage in the capital Tehran on Monday. (Atta Kenare/AFP via Getty Images)

Trump said on Sunday, after the Iraqi parliament passed a resolution calling for the expulsion of foreign troops, the U.S. wouldn't leave without being paid for its military investments in Iraq over the years. He said if the troops do have to withdraw, he would hit Baghdad with economic penalties.

Canadian Foreign Affairs Minister François-Philippe Champagne spoke to his Iraqi counterpart Monday. Champagne told Mohammed Ali al-Hakim that Canada remains committed to a stable and united Iraq, and ensuring the enduring defeat of ISIS.​​​​​​ The two ministers agreed a de-escalation in tensions is necessary for peace and stability in the region.

Prime Minister Justin Trudeau later spoke to the NATO secretary general, reiterating the need for de-escalation. Trudeau and Jens Stoltenberg also agreed that the NATO training mission in Iraq — which Canada is part of — plays an important role in strengthening Iraqi security.

Soleimani's daughter, Zeinab, directly threatened an attack on the U.S. military in the Mideast while speaking to a crowd of hundreds of thousands in Tehran that stretched as far as the eye could see. Iranian state TV put the crowd size at "millions," though that number could not be verified.

"The families of the American soldiers in western Asia ... will spend their days waiting for the death of their children," she said to cheers.

Iran's Supreme Leader Ayatollah Ali Khamenei himself prayed over the caskets of Soleimani and others slain in the attack. Khamenei, who had a close relationship with Soleimani, wept at one point during the traditional Muslim prayers for the dead. The crowd wailed.

Protesters hold pictures of Soleimani during a demonstration outside the U.S. consulate in Istanbul on Sunday. (Yasin Akgul/AFP/Getty Images)

Soleimani's successor, Esmail Ghaani, stood near Khamenei's side, as did Iranian President Hassan Rouhani and other top leaders in the Islamic Republic. While Iran recently faced nationwide protests over government-set gasoline prices that reportedly killed over 300 people, Soleimani's mass processionals has seen politicians and leaders across the Islamic Republic's political spectrum take part, temporarily silencing that anger.

Hamas leader attends funeral

The leader of the Palestinian militant group Hamas travelled to Tehran for the funeral and addressed mourners, describing the slain general as "the martyr of Jerusalem." Ismail Haniyeh vowed that Palestinian militant groups, including his Islamic group that controls Gaza, will walk Soleimani's way "to confront the Zionist project and the American influence."

Esmail Ghaani, the newly appointed commander of the country's Quds Force, is seen in Tehran, Iran, in this undated picture. (Tasnim News Agency/Reuters)

Ghaani made his own threat in an interview with Iranian state television aired Monday. "God the almighty has promised to get his revenge, and God is the main avenger. Certainly actions will be taken," he said.

Ghaani, a longtime Soleimani deputy, is now his successor in the Revolutionary Guard's Quds Force, an expeditionary arm of the paramilitary organization answerable only to Khamenei. Ghaani has been sanctioned by the U.S. since 2012 for his work funding its operations around the world, including its work with proxies in Iraq, Lebanon and Yemen.

Those proxies likely will be involved in any operation targeting U.S. interests in the Mideast or elsewhere in the world.

U.S. embassy warns of 'heightened risk'

Already, the U.S. Embassy in Saudi Arabia warned Americans "of the heightened risk of missile and drone attacks." In Lebanon, the leader of the Iranian-backed militant group Hezbollah said Soleimani's killing made U.S. military bases, warships and service members across the region fair game for attacks. A former Iranian Revolutionary Guard leader suggested the Israeli city of Haifa and others could be targeted should the U.S. attack Iran.

NATO Secretary General Jens Stoltenberg on Monday called for "restraint and de-escalation" of tensions, after holding an urgent meeting of the military alliance in Brussels.

A day after last Friday's drone attack, the North Atlantic Treaty Organization suspended its Canadian-led military mission to train Iraqi forces. According to a source at Canada's Department of National Defence headquarters, there are probably about 500 Canadian military personnel in the country, which accounts for most of the Canadians now in Iraq in an official capacity.

NATO hoping Iraq training mission will resume

"We are keeping the situation [with the mission] under close review and we remain in close contact with the Iraqi authorities," Stoltenberg said. "NATO is prepared to continue the training and capacity building when the situation permits."

However, Ghaani, speaking at the massive gathering in Tehran, promised to fulfil his goal to "get rid of America from the region," as it continues down "Soleimani's path as firmly as before."

The head of the Guard's aerospace program, Gen. Amir Ali Hajizadeh, suggested Iran's response wouldn't stop with a single attack.

Smoke billows from burning tires as angry Iraqi demonstrators block a road in the central shrine city of Najaf on Sunday to protest turning the country into an arena for US-Iran conflicts. (Haidar Hamdani/AFP/Getty Images)

"Firing a couple of missiles, hitting a base or even killing Trump is not valuable enough to compensate for martyr Soleimani's blood," Hajizadeh said on state TV. "The only thing that can compensate for his blood is the complete removal of America from the region and taking away their evil from the oppressed people of the region."

On the nuclear deal, Iranian state television cited Sunday a statement by President Rouhani's administration saying the country would not observe the nuclear deal's restrictions on fuel enrichment, on the size of its enriched uranium stockpile and on its research and development activities.

"The Islamic Republic of Iran no longer faces any limitations in operations," a state TV broadcaster said.

German Chancellor Angela Merkel, French President Emmanuel Macron and British Prime Minister Boris Johnson specifically urged Iran to "withdraw all measures" not in line with the 2015 agreement that was intended to stop Tehran from pursuing its atomic weapons program.

Iran insisted that it remains open to negotiations with European partners over its nuclear program. And it did not back off from earlier promises that it wouldn't seek a nuclear weapon.

However, the announcement represents the clearest nuclear proliferation threat yet made by Iran since Trump unilaterally withdrew from the accord in 2018 and reimposed sanctions. It further raises regional tensions, as Iran's longtime foe Israel has promised never to allow Iran to produce an atomic bomb.

Iran did not elaborate on what levels it would immediately reach in its program. Tehran has already broken some of the deal's limits as part of a step-by-step pressure campaign to get sanctions relief. It already has increased its production, begun enriching uranium to five per cent and restarted enrichment at an underground facility.

While it does not possess uranium enriched to weapons-grade levels of 90 per cent, any push forward narrows the estimated one-year "breakout time" needed for it to have enough material to build a nuclear weapon if it chose to do so.

The International Atomic Energy Agency, the United Nations watchdog observing Iran's program, did not respond to a request for comment. However, Iran said that its co-operation with the IAEA "will continue as before."

Iranians march on Sunday in the streets of the northwestern city of Ahvaz to pay homage to Soleimani. More processions were set for Monday. (Hossein Mersadi/AFP/Getty Images)

Foreign Ministry spokesperson Abbas Mousavi earlier told journalists that Soleimani's killing would prompt Iranian officials to take a bigger step away from the nuclear deal.

"In the world of politics, all developments are interconnected," Mousavi said.

Soleimani's killing has escalated the crisis between Tehran and Washington after months of back-and-forth attacks and threats that have put the wider Middle East on edge. Iran has promised "harsh revenge" for the U.S. attack, while Trump has vowed on Twitter that the U.S. will strike back at 52 targets "VERY FAST AND VERY HARD. "

He doubled down on that threat Sunday, dismissing warnings that targeting cultural sites could be a war crime under international law.

"They're allowed to kill our people. 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 sites? It doesn't work that way," Trump told reporters.

On Sunday, hundreds of thousands of mourners accompanied the coffin carrying Soleimani's remains in the Iranian cities of Ahvaz and Mashhad. A similar procession was expected in Qom and Tehran on Monday.

The processions mark the first time Iran honoured a single man with a multi-city ceremony. Not even Ayatollah Ruhollah Khomeini, who founded the Islamic Republic, received such a processional with his death in 1989. Soleimani on Monday will lie in state at Tehran's famed Musalla mosque as the revolutionary leader did before him.

He will be buried in his hometown of Kerman.

Unprecedented surge of mourners gather as Iran's supreme leader weeps over dead general 1:00