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

Iranian Supreme Leader Ayatollah Ali Khamenei prayed over the caskets of Iranian Revolutionary Guard Gen. Qassem 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.

Soleimani's replacement has already vowed to take revenge. In addition, Tehran has abandoned the remaining limits of its 2015 nuclear deal with world powers in response to the slaying. And in Iraq, the parliament has called for the expulsion of all American troops from Iraqi soil.

Iran's Supreme Leader Ayatollah Ali Khamenei and Iranian President Hassan Rouhani pray in Tehran on January 6, 2020 near the coffin of Iranian Major-General Qassem Soleimani, head of the elite Quds Force, who was killed in a U.S. air strike at Baghdad airport. OFFICIAL PRESIDENT'S WEBSITE via Reuters

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

Get Breaking News Delivered to Your Inbox

Adding to the tensions, President 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.

Soleimani's daughter, Zeinab, directly threatened an attack on the U.S. military in the Mideast while speaking to the crowd 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.

Iranian people attend a funeral procession in Tehran, Iran on January 6, 2020 for Iranian Major-General Qassem Soleimani, head of the elite Quds Force, and Iraqi militia commander Abu Mahdi al-Muhandis, who were killed in a U.S. air strike at Baghdad airport WANA NEWS AGENCY via Reuters

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

State TV showed the procession live and had a black ribbon across the top left corner of the screen in a rare tribute, Agence France Presse noted.

Mourners chanted "Death to America" and "Death to Israel," AFP reported.

A NATO official told AFP its ambassadors would hold an extraordinary meeting at the alliance's Brussels headquarters Monday to discuss mounting Middle East tensions.

Ghaani made his own threat in an interview with Iranian state television that 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, has now taken over as head of 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 Quds operations around the world, including their 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.

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.

And Ghaani said, "We promise to continue down martyr Soleimani's path as firmly as before with help of God, and in return for his martyrdom we aim to get rid of America from the region."

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

"Firing a couple of missiles, hitting a base or even killing (Donald) 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."

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

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 didn't 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 Mr. Trump unilaterally withdrew from the accord in 2018 and reimposed sanctions last year. It further raises regional tensions, as Iran's longtime foe Israel has promised never to allow Iran to produce an atomic bomb.

Iran didn't elaborate on the 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.

The International Atomic Energy Agency, the United Nations watchdog observing Iran's program, didn't respond to a request for comment. However, Iran said its cooperation with the IAEA "will continue as before."

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" while Mr. Trump has vowed on Twitter that the U.S. would strike back at 52 targets "VERY FAST AND VERY HARD" should Iran attack American interests.

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," Mr. 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.

Mourners wearing black beat their chests and carried posters with Soleimani's portrait. Demonstrators also unfurled red Shiite flags, which traditionally symbolize both the spilled blood of someone unjustly killed and a call for vengeance.

The processions mark the first time Iran honored 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.