Iran warned Friday a "harsh retaliation is waiting" for the United States after top Iranian General Qasem Soleimani was killed by the Pentagon in an airstrike.

Iran's Supreme Leader Ayatollah Ali Khamenei vowed vengeance.

Khamenei said in a statement published by Iranian state media that the "cruelest people on earth" assassinated the "honorable" commander who "courageously fought for years against the evils and bandits of the world."

Khamenei called for three days of mourning.

"His departure to God does not end his path or his mission," the statement said, published by Fars News Agency. "But a forceful revenge awaits the criminals who have his blood and the blood of the other martyrs last night on their hands."

Soleimani was killed at Baghdad airport early Friday alongside members of Iran-backed militias operating in Iraq. The airstrike was ordered by President Donald Trump. Soleimani was killed while a convoy he was traveling in was leaving the airport. Iran funds and supports proxy militias across the Middle East.

New escalation:U.S. launched airstrike that killed Iran's Qasem Soleimani

The 62-year-old military commander played a key role in expanding Iran's influence and military reach in Iraq, Syria and Lebanon. His death marks a new, major escalation between Tehran and Washington following Trump's withdrawal from a nuclear accord between Iran and world powers. Soleimani had a hand in virtually every significant Iranian military and intelligence operation stretching back two decades, including a recent two-day siege against the U.S. Embassy in Baghdad that ended Wednesday. The assault led to the Pentagon rushing reinforcements to the diplomatic compound in Iraq.

Pro-Iran protesters want U.S. troops to leave the country.

Soleimani was widely viewed as one of Iran's most powerful men and, at home, a heroic national figure who was standing up to Trump's "maximum pressure" Iran strategy that includes stinging economic sanctions and confrontational rhetoric and military deployments. Soleimani headed Iran's U.S.-sanctioned, elite Quds Force, part of the nation's hard-line paramilitary Revolutionary Guard Corps.

Iran’s President Hassan Rouhani called Soleimani's killing a "heinous crime" and said "Iran will take revenge," while Ali Rabiei, a spokesman for Iran’s cabinet, said that Iran’s response would be severe, swift and decisive.

The Pentagon defended the targeting of Soleimani as a defensive action, saying that Soleimani had "orchestrated attacks on coalition bases in Iraq over the last several months - including the attack on December 27th - culminating in the death and wounding of additional American and Iraqi personnel."

The Trump administration considered him a terrorist and Secretary of State Mike Pompeo said Soleimani was killed because he was planning an "imminent attack."

He said the operation "saved American lives."

Key figure: What we know about the strike that killed Iran's Gen. Qasem Soleimani

Sina Toossi, a researcher at the National Iranian American Council, a Washington-D.C.-based group that seeks to promote links between Americans and Iranians, noted on Twitter that Khamenei's chairing Friday of an emergency meeting of the National Security Council for the first time was a "sign of how serious & authoritative #Iran’s response to Soleimani's assassination will be."

After the meeting, the National Security Council said it reached a decision on how to respond to the U.S. killing of Soleimani, but it didn't specify what the decision was.

Ayatollah Ahmad Khatami, an adviser to Iran’s supreme leader, appeared to threaten U.S. troops in the region. "This is the time to clear the region from these insidious beasts," he said while leading Friday prayers in Tehran, according to state media. The cleric added: "I am telling Americans, especially Trump, we will take a revenge that will change their daylight into a nighttime darkness."

Khamenei appointed Soleimani’s deputy, Maj. Gen. Esmail Ghaani as the new commander of the Revolutionary Guard’s Quds Force.

New Qusa Force chief Esmail Qaani: "We say to everyone be patient, you'll see the American corpses all over the Middle East."

It is unclear what Iran's response will be, but the State Department urged U.S. citizens to leave Iraq "immediately," citing "heightened tensions."

U.S. defense officials said 3,000 additional Amersoldiers would be sent to the Middle East following Soleimani’s killing, according to reports.

Opinion:Attack on U.S. Embassy in Iraq shows Trump is failing

Meanwhile, officials from China to Russia criticized the Pentagon's actions.

Konstantin Kosachev, the head of the foreign affairs committee in Russia's parliament, called the U.S. airstrike "a mistake." He wrote in a social media post that "Iran may accelerate making a nuclear weapon now, even if it didn’t plan on doing it before," a reference to Tehran's insistence it is interested in nuclear activities for civilian purposes only, something Washington does not believe and is also one of the reasons Trump withdrew from the landmark 2015 nuclear accord negotiated by former President Barack Obama. The agreement saw Iran agree to limit its enrichment of uranium in exchange for the lifting of sanctions on its lucrative oil industry.

Geng Shuang, a spokesman for China's foreign ministry, said Beijing was "highly concerned" about Soleimani's killing and called for "calm and restraint."

Britain's Foreign Secretary Dominic Raab said "conflict is in none of our interests."

The European Union said "further escalation must be avoided at all costs."

Israel, Iran's archenemy, said it was raising its military preparedness levels.

Germany ordered all its soldiers in Iraq not to leave their bases.

A United Nations official said Soleimani's killing was illegal.

"Lawful justifications for such killings are very narrowly defined," said Agnes Callamard, the U.N.'s Special Rapporteur on extra-judicial executions, in a tweet.

In the U.S., there was approval and condemnation for Trump's move.

Kayleigh McEnany, press secretary for Trump's 2020 re-election campaign, claimed in an interview on Fox News that Soleimani's killing represented the "greatest foreign policy accomplishment of the decade, if not our lifetime."

Pompeo:Qasem Soleimani killing was in response to 'imminent attack'

And Trump's former hawkish national security adviser John Bolton tweeted his "congratulations to all involved in eliminating" Iran's top general. Bolton said that he hoped "this is the first step to regime change in Tehran."

Democratic presidential candidate Elizabeth Warren said "Soleimani was a murderer, responsible for the deaths of thousands, including hundreds of Americans. But this reckless move escalates the situation with Iran and increases the likelihood of more deaths and new Middle East conflict."

Sen. Ben Cardin, a Maryland Democrat, said, "Trump’s decision to kill Qassem Soleimani in Baghdad is a provocative act taken without congressional consultation or authorization, the potential consequences of which are unknown."

Trump himself has said very little about the U.S. action, only tweeting Friday that "Iran never won a war, but never lost a negotiation!" and that "Soleimani was both hated and feared within the country. They are not nearly as saddened as the leaders will let the outside world believe. He should have been taken out many years ago!"

Animosity between Iran and the U.S. stretches back more than half a century to at least 1953, when the CIA helped oust Iran's democratically elected leader, Mohammad Mosaddegh, who wanted to retain control over Iran's oil reserves, and installed as his replacement the pro-western Shah Mohammad Reza Pahlavi.

Pahlavi proved to be a reliable U.S. ally who helped counter the influence of the Soviet Union but he was toppled in 1979 as part of Iran's Islamic Revolution, a period that led to a hostage crisis at the U.S.'s then Embassy in Tehran.

Relations never recovered and the Middle East region has, at various points, seen the slow build-up of U.S. military troops and bases from Bahrain to Syria as part of American wars and anti-terrorism operations in Iraq, Afghanistan and beyond.

Iran, which can't match Washington's military might, has sought to counter the U.S. presence by developing a secretive ballistic missile program operated by the Revolutionary Guard's Quds Force and by backing regional militant allies or proxies to launch attacks on U.S. interests and allies. These allies include Iraqi militiamen, Lebanon's Hezbollah and Yemen’s Houthi rebels.

In the latest attacks that the Trump administration blames on Iran or its proxies, oil facilities in Saudi Arabia were hit by a missile-and-drone strike in September, temporarily halving the kingdom's oil production. Iran also shot down a U.S. surveillance drone in the Strait of Hormuz, a key passageway for oil, and laid mines targeting oil tankers. At the time, Trump pulled back from retaliating for the attacks. Oil prices surged more than 4% Friday on concerns Iran may respond to Soleimani's killing by disrupting global supplies.