BAGHDAD — A stampede killed dozens of pilgrims in Iraq’s holy city of Karbala on Tuesday as Shiite Muslims marked one of the most solemn events in their calendar.

At least 36 people were killed and more than 100 injured, some of them critically, in the Ashura commemorations, according to a spokesman for the Health Ministry.

Hundreds of thousands of Shiites had gathered in Karbala to mark the death of Imam Hussein, a grandson of the prophet Muhammad who was killed in battle in the 7th century, an event that cemented the schism between the Islamic faith’s Sunni and Shiite sects.

The stampede occurred toward the end of the procession, officials said, as tens of thousands of people rushed toward Hussein’s shrine. The charge, known as the Tweireej run, is named after the nearby village from where Hussein’s maternal cousins tried to mount a rescue — only to realize he had already been killed. 

A spokesman for the body in charge of the shrine said the stampede began after several pilgrims fainted as temperatures topped 100 degrees Fahrenheit. Unable to see what had happened up ahead, the waves of pilgrims kept running, before many of them slipped and stumbled in a deadly crush. “Aid workers immediately started to evacuate the injured, but due to the large number, it happened so fast and led to casualties,” Afdhal al-Shami said.

A photograph shared widely on social media, apparently from the scene, showed bodies slumped and strewn across a wooden walkway as other pilgrims gestured for help.

Hundreds of thousands of Shiite worshipers also gathered in Baghdad to mark Ashura amid a beefed-up security presence. While the Iraqi capital has been largely free of major attacks in recent years, sleeper cells of the Islamic State extremist group remain active nationwide, and Sunni militants have repeatedly targeted Shiite shrines and gatherings in recent decades.

In 2004, more than 140 worshipers were killed and hundreds injured in near-simultaneous attacks on shrines in Baghdad and Karbala during Ashura.

Loveluck reported from Beirut.