BEIRUT — A stampede at the funeral for slain Iranian general Qasem Soleimani killed 56 people on Tuesday and injured more than 200, the Iranian news agency reported, delaying the massive procession for several hours before he was buried in his home city of Kerman.

Soleimani’s coffin was transported atop a blue float draped with oversize flower wreaths and photographs, and hugged by many in the black-clad crowd on the route. Hundreds of thousands marched alongside, waving Iranian flags and black mourning banners in memory of the powerful Quds Force commander killed in a U.S. drone strike in Baghdad last week. The most prevalent flag bore language calling for revenge.

Vengeance was the theme of the day.

“We will take revenge, a revenge that will be tough, strong, decisive and finishing and will make them regret,” said Maj. Gen. Hossein Salami in a speech during the funeral at a graveyard near the teal-domed Saheb Zaman mosque. A picture with Soleimani’s face towered over his shoulder.

“We will set fire to the place they love, and they know where that is,” he said, implying U.S. ally Israel. The crowd chanted “Death to Israel!” as he spoke.

In neighboring Iraq, top government officials continued to press for the removal of U.S. troops from their country — a dramatic step that, at least in part, would be seen as payback by Iranians.

Iraqi Prime Minister Adel Abdul Mahdi told his cabinet on Tuesday that the withdrawal of foreign troops was now the only way to de-escalate tensions, which have been worsening since the Friday attack that killed Soleimani and Abu Mahdi al-Muhandis, a powerful Iraqi militia leader, and eight other people.

Iraqi lawmakers passed a nonbinding resolution on Sunday to end the foreign troop presence in Iraq. But Abdul Mahdi, who resigned in November and has been serving in a caretaker role, is not legally authorized to sign the measure.

Senior Iraqi officials said Tuesday that their government has interpreted a letter delivered Monday by the U.S. military in Baghdad advising of a “repositioning” of U.S. forces as a signal that the United States intends to withdraw from Iraq. U.S. defense officials in Washington, who say an unsigned version of the letter was sent in error, have strenuously denied that any decision has been made to pull out the troops.

Germany, meanwhile, has temporarily moved all its military personnel from non-Kurdish Iraqi territory to either Jordan or Kuwait, a German military spokesman said Tuesday. Canada will temporarily move some of its military personnel to Kuwait in the coming days, said the country’s chief of the defense staff.

These announcements came after the NATO mission and U.S.-led international coalition temporarily suspended their missions in Iraq. NATO also announced that it had begun moving troops out of Baghdad’s Green Zone to other locations in Iraq and the broader region. The U.S. Department of Transportation also issued an alert advising U.S. commercial ships to “exercise caution” when passing through waters near Iran.

British Foreign Secretary Dominic Raab warned that the Islamic State would have the most to gain if a U.S.-Iran war breaks out, saying that the militants “would be the only winners.”

For many Iranians, as well as Iranian-allied forces in the region, Soleimani embodied resistance to unwanted American interference in the Middle East. His funeral procession was a three-day affair, starting in Baghdad on Saturday and continuing to the Iraqi Shiite shrine cities of Karbala and Najaf in Iraq, and then the Iranian cities of Ahvaz, Mashhad, Tehran and Qom on Sunday. A Lebanese ceremony was also held in his honor in Beirut on Sunday, organized by the Iranian-allied Hezbollah militant and political group.

In Tehran, a 45-year-old housewife said she attended the ceremony to pay respect to someone she believes had sacrificed himself and his family.

“Everyone is talking about revenge,” said Narges, who spoke on the condition that her full name not be used so she could discuss freely her views of the commander. “But it is important to have a more measured reaction — something that is equal to what they [the Americans] did.”

Since the drone strike, promises of vengeance have abounded. Ali Shamkhani, head of Iran’s National Security Council, said Iran had drawn up 13 scenarios for retaliation. The most modest, he said, would be a “historical nightmare” for the United States. He counted off the number of U.S. bases close to Iran.

“We’re aware of their military personnel and equipment, and we’re tracking their smallest development,” he said.

The United States has 5,000 American troops stationed in Iraq to help fight the Islamic State, alongside international troops who serve with the U.S.-led coalition to defeat the Islamist militant group.

The chorus of calls for expulsion prompted President Trump to threaten Iraq with economic penalties. Senior administration officials have begun drafting sanctions, according to three people briefed on the planning.

Cunningham reported from Istanbul. Louisa Loveluck and Mustafa Salim in Baghdad, Paul Schemm in Dubai and Rick Noack in Berlin contributed to this report.