Shi'ite pilgrims gather during the religious festival of Ashura in the holy city of Kerbala

More than 30 pilgrims were killed and dozens injured Tuesday in a stampede at a major shrine in the Iraqi city of Karbala on the Shiite holy day of Ashura.

It is Iraq's deadliest stampede in recent history during Ashura, whose commemorative marches had previously been targeted by Sunni extremist groups.

Hundreds of thousands of Shiite pilgrims from around the world swarmed Karbala, around 100 kilometres (60 miles) south of Iraq's capital Baghdad, to commemorate the death of the Prophet Mohammed's grandson, Hussein.

The packed processions of black-clad worshippers made their way to his gold-domed shrine, carrying flags and crying out, "We sacrifice ourselves for you, Oh Hussein!"

As the massive crowds pressed forward, a stampede broke out that left at least 31 people dead and another 100 wounded, according to Iraq's health ministry.

Ministry spokesman Saif al-Badr said the death toll could rise as 10 of the wounded were in critical condition.

Outside the Al-Hussein Medical City in Karbala, paramedics wheeled wounded people into the emergency room throughout the afternoon.

"The pilgrims started falling down all of a sudden," said a young man in a wheelchair who had been bruised around the eye and temple.

"They piled up one on top of the other. There was a stampede and people were suffocating," he said.

Authorities at the Imam Hussein shrine said the nationalities of the victims were not yet confirmed.

On Tuesday evening, Health Minister Alaa al-Din Alwan arrived in Karbala as messages began pouring in, with President Barham Saleh expressing his "deep condolences" to the victims' families.

Day of mourning

Hussein was killed in the year 680 by the forces of the Caliph Yazid, a major event which helped solidify the divide between what would become Islam's Sunni and Shiite branches.

Iraq is majority Shiite, but under ex-dictator Saddam Hussein's Sunni-dominated regime, the vast majority of Ashura commemorations were banned.

Now the day is a national holiday, and devout Shiite pilgrims travel from neighbouring Iran and Gulf countries, as well as Pakistan and India, to mark it in Iraq.

Streets across the country were shuttered Tuesday to allow for funeral-style processions and elaborate re-enactments of the Battle of Karbala.

Mourners swung large black flags with "Hussein" written in red, wailing loudly and singing religious anthems of praise.

Some whipped their backs and chests, a traditional way to demonstrate their sorrow and suffering.

Others -- even young boys -- cut incisions into their foreheads with scalpels or large swords, leaving streams of blood cascading down their faces.

After reaching the Imam Hussein shrine, some pilgrims set fire to a tent to symbolise the burning of Hussein's camp by Yazid's forces.

Similar ceremonies took place in Baghdad, in the southern city of Basra and in Iraq's second holy city Najaf, where the Prophet Mohammed's son-in-law Ali is buried.

After Saddam's ouster in 2003 by the US-led invasion, Iraq was rocked by years of sectarian violence, which made such processions deadly.

In 2005, at least 965 pilgrims heading to the Imam Kadhim shrine in Baghdad during a different holiday died after rumours of a suicide bomber in the crowd sparked a mass stampede.

And in 2013, nearly 40 Shiite pilgrims were killed across various Iraq cities in a series of attacks on Ashura.

The following year, the Islamic State group swept across a third of Iraq and carried out mass attacks against civilian populations, including Shiites.

Iraq declared victory against IS nearly two years ago, but the group still carries out hit-and-run attacks in remote parts of the country.