ISTANBUL — Tens of thousands of Iranians demonstrated Friday in the capital, Tehran, and other cities in support of a senior Revolutionary Guard Corps commander killed in a U.S. drone strike in Iraq, even as many privately expressed worry about the escalating conflict with the United States.

Maj. Gen. Qasem Soleimani, commander of the Revolutionary Guard’s elite Quds Force and Iran’s most powerful military leader, was targeted early Friday as he traveled in a two-car convoy with senior Iraqi militia leaders and other Iranian commanders near the Baghdad airport.

U.S. officials had accused Soleimani of orchestrating rocket attacks on U.S. bases in Iraq, including a strike last month that killed a U.S. contractor and wounded several American troops.

Iranian officials, including the country’s supreme leader, Ayatollah Ali Khamenei, vowed Friday to avenge the killing, calling it a “grave miscalculation” and a “heinous crime.”

Iran’s Supreme National Security Council issued a statement threatening retaliation for the strike, saying it had made “appropriate decisions” that would hold the United States responsible for “all of the consequences of this strategic mistake.”

“Severe revenge awaits the criminals who smeared their dirty hands with the pure blood of Gen. Soleimani,” the statement said. “These cowardly acts will boost the will of the Islamic Republic to be more active in its resistance and to bring a swift defeat” to the enemy.

Earlier Friday, President Hassan Rouhani said the targeted killing of Soleimani “doubled the resolve of the great Iranian nation . . . to stand up against the United States.”

“Iran will take revenge for this heinous crime,” Rouhani said.

The government announced a day of public mourning. In Kerman in southeastern Iran, where Soleimani was born, a massive procession of black-clad mourners filled the streets and chanted religious slogans, footage broadcast on Iranian news channels showed.

In Tehran, demonstrators who rallied after Friday prayers called on the Quds Force to take revenge.

“Soleimani’s blood spilled, the nation’s outrage against the enemy sparked!” the protesters chanted in a video broadcast by the state-run Islamic Republic News Agency.

A senior Shiite cleric who leads Friday prayers in Tehran, Ahmad Khatami, said Soleimani’s killing was “a cause for Muslims to be more united than ever.”

A Revolutionary Guard spokesman, Ramadan Sharif, said the force would be “starting a new chapter” after the deadly U.S. strike.

As he spoke to a reporter from Iranian state television, Sharif broke down in tears.

“The momentary happiness experienced by the Americans will soon turn into mourning,” he said.

Across Iran, people also expressed worry over the potential fallout from the strike, which threatened to plunge Tehran and the United States into a full-blown conflict. Tensions between the two nations have soared since President Trump withdrew from a 2015 deal Iran struck with world powers that curbed Tehran’s nuclear activities in exchange for sanctions relief.

“My family is concerned and sad,” said Maryam, 35, a resident of Tehran. “Soleimani had many fans in Iran, not only among the supporters of the Islamic Republic.” Like other Iranians contacted Friday, she spoke on the condition that her full name not be used so she could talk freely about the death of a senior military commander.

“There were people who were attracted to his charisma and considered him to be more clean than other Iranian officials,” she said. “There are rallies in different cities now . . . and I think that there will be more.”

Khamenei visited Soleimani’s home Friday in Kerman, meeting with the commander’s grieving family members.

In a televised interview, the commander’s son, Hossein, said his father had “always been seeking martyrdom.”

“It’s like I’m pursuing it all the time,” the son quoted Soleimani as saying.

In a statement Friday, Khamenei announced the appointment of Brig. Gen. Ismail Qaani as the new Quds Force commander, saying the organization’s strategy will remain the same.

Qaani is a veteran of the Iran-Iraq war in the 1980s and rose to become the Quds Force deputy commander. The U.S.Treasury Department’s Office of Foreign Assets Control imposed sanctions on Qaani in 2012 for what it said was his role in distributing weapons and funding to Iranian allies in the region.

“He’s intimately familiar with the Force’s mission and operations. He’ll be able to pick up where Soleimani left off,” Ariane Tabatabai, a political scientist and Iran expert at the Rand Corp. in Washington, said on Twitter.

Afshon Ostovar — author of “Vanguard of the Imam: Religion, Politics, and Iran’s Revolutionary Guards” — said Qaani “will hit the ground running.”

The Revolutionary Guard, he said on Twitter, “is part of a broader system. It relies much less on individuals than many analysts believe.”

“Soleimani’s death will have an impact,” he said, “but there will be no dis­cern­ible change to Iran’s regional network or operations.”

Soleimani, 62, oversaw the proliferation of allied proxy forces across the Middle East, including in Iraq, Lebanon, Syria and Yemen. He often was seen on the battlefield in Iraq and Syria as he directed Iranian-backed Shiite militias in their fight against the Islamic State, and his military success against the Sunni militants initially made him widely popular inside Iran.

The United States “is eliminating people who have been very important and popular figures in the fight against fundamentalism and terrorism in the region,” Iranian Foreign Minister Mohammad Javad Zarif said in a television interview late Friday.

Zarif said the deadly strike “violated Iraq’s sovereignty, violated international law and incited Muslims” against the United States.

“Even if the Islamic Republic does not take direct action, they [the United States] have already put themselves in deep trouble with this act,” he said.

In recent years, however, as Iran’s economy faltered under U.S. sanctions, Iranians began openly criticizing Tehran’s costly military adventures abroad. In Iraq, majority-Shiite protesters angry with the government also turned their fury toward Iran, which holds powerful sway over Iraqi politicians and militia leaders.

“Everyone is worried. The people I spoke with weren’t sad but shocked,” said Nazli, 40, from the northern Iranian city of Rasht. “On social media, some people I thought didn’t support the regime are now expressing sorrow for his death.”

Iranian news outlets reported Friday that Soleimani’s body would be carried in a procession to the two holy Shiite cities of Karbala and Najaf in Iraq before being returned to Iran for burial.

“There are three groups of people in Iran now: those who are happy, those who are worried about security and the economy . . . and those who are sad,” said Davoud, a resident of the city of Mashhad.

He said some residents are scrambling to buy U.S. dollars and gold to stave off further economic repercussions. Iran’s economy has been battered by a near-total U.S. embargo that has targeted everything from oil exports to banking transactions and the Iranian aviation and automotive sectors.

In November, protests gripped Iranian cities after a government decision to reduce fuel subsidies for consumers. Authorities cracked down hard on demonstrators, killing at least 200 people, according to rights group Amnesty International.

Davoud said that before the unrest, Iranians probably would have turned out in much larger numbers to support the government in the event of a U.S. strike.

“But now, they don’t have the support of the people to be able to mobilize them,” he said of Iran’s leaders