A stampede broke out in the massive crowds attending the funeral of Qassem Soleimani, the Iranian military commander slain in a US drone strike, killing dozens of people and postponing the burial ceremony, Iranian state television reported Tuesday.

The chaos erupted in Soleimani’s hometown of Kerman, where tens of thousands of mourners packed the streets for the funeral procession of the slain Quds Force general.

It wasn’t clear what prompted the stampede, but video of the scene showed people lying in the street as others rushed to their aid.

Iranian state media reported that as many as 40 people were killed and more than 200 injured in the crush.

“Today because of the heavy congestion of the crowd unfortunately a number of our fellow citizens who were mourning were injured and a number were killed,” emergency medical services chief Pirhossein Kolivand told state television.

He did not say when Soleimani’s burial would take place.

Soleimani, who was killed in the attack last Thursday at Baghdad International Airport, has been hailed as a national hero since his remains were returned to Iran as massive crowds chanting “Death to America” greeted his casket over the past several days.

Iran’s Supreme Leader Ayatollah Ali Khamenei wept and prayed over Soleimani’s casket Monday in Tehran, calling him a “living martyr.”

Soleimani directed the various paramilitary groups Iran backs throughout the Middle East and was responsible for the deaths of hundreds of American soldiers in Iraq.

President Trump and the administration’s top military leaders said Soleimani had to be taken out because he was plotting against American troops and interests in the Middle East.

His death prompted calls in Iran for revenge.

Hossein Salami, who replaced Soleimani as head of Iran’s Islamic Revolutionary Guard, vowed retribution.

“We will take revenge. We will set ablaze where they like,” Salami told the throngs of black-clad mourners, who responded by crying out, “Death to Israel.”

Ali Shamkhani, secretary of Iran’s Supreme National Security Council, said Tehran has developed 13 sets of plans to retaliate for Soleimani’s death.

“If the US troops do not leave our region voluntarily and upright, we will do something to carry their bodies horizontally out,” Shamkhani said, according to the Tasnim news agency.

Also on Tuesday, Iran’s parliament approved $224 million in funding for the Quds Force and passed legislation declaring US military leaders “terrorists” who will be liable for sanctions imposed by Tehran.

The US in April designated the Revolutionary Guard a “terrorist organization.”

Trump has said the US military has targeted 52 locations in Iran for attack if Tehran retaliates against US interests in the region over Soleimani’s death.

With Post wires