
Millions of Shi'ite Muslim pilgrims defied the threat of ISIS attacks and thronged the Iraqi shrine city of Karbala for the climax of annual Arbaeen mourning rituals.

Some had walked for more than 12 days, from Iraq's far south or across the border from Iran, while others were bused in or crammed into lorries for the journey.

Defence Minister Khaled al-Obeidi said a total of 17million will have gone through Karbala for Arbaeen this year, including more than four million foreigners from 60 countries.

A sea of devotees descended on the city's shrine of Imam Hussein, beating their heads and chests to show remorse for not saving him from the armies of the caliph Yazid that beheaded him in 680 AD.

While many chanted in unison, rapt in a collective religious trance, others were keenly aware of the symbolic power Arbaeen could have in the war against the Islamic State group.

Scroll down for video

Shi'ite Muslim pilgrims reach out to touch the tomb of the Prophet Mohammad's grandson, Imam al-Abbas, to mark the festival of Arbaeen in the Iraqi holy city of Kerbala, southwest of Baghdad in defiance of threats of terror attacks by the Islamic State

Some pilgrims walked for more than 12 days from Iraq's far south or across the border from Iran, to visit the city's shrine of Imam Hussein

A sea of devotees descended on the city's shrine of Imam Hussein, beating their heads and chests to show remorse for not saving him from the armies of the caliph Yazid that beheaded him in 680 AD

While many chanted in unison, rapt in a collective religious trance, others were keenly aware of the symbolic power Arbaeen could have in the war against the Islamic State group

A mortar attack that killed one person on Friday highlighted the security concerns surrounding what is believed to be one of the largest religious gatherings in the world.

But the pilgrims were undeterred.

'Forget mortars, even if it rains jihadists on Karbala, we will not be prevented from visiting the Imam Hussein shrine,' said Kadhem Hussein, a 25-year-old who had walked from Nasiriyah, some 300 kilometres (180 miles) away.

The Islamic State - led by Sunni extremists - considers Shi'ites to be heretics and has made targeting the community one of its main objectives.

The head of Karbala operations command, brigadier General Qais Khalaf Rahim, said the number of security personnel in Karbala was boosted by 15,000 to 40,000 following the mortar attack.

'The efforts of these jihadists are vain because we have all come to Karbala ready to sacrifice, wishing to become martyrs,' said Abdel Hussein Salem, who volunteered to serve food to pilgrims in the city.

Leaders in Iraq's Shi'ite-dominated government and clerics have been keen to cast the pilgrimage as an act of resistance against the jihadists who seized swathes of the country in June.

The shrine to Imam Hussein in the holy city of Karbala, south of Baghdad, was illuminated tonight on the final day of mourning

Millions lined the streets as the shrine was lit in amber hues which glowed across the city of Karbala on the final day of Arbaeen

An aerial view of the shrine to Imam Hussein, the grandson of the Prophet Mohammed who died in martyrdom, in Karbala this evening

Security in the holy Iraqi city was heightened amid threats from ISIS militants who view Shi'ites as heretic in their interpretation of Islam faith

Many of the million or so Iranians who flocked to Iraq said they were performing the pilgrimage on the order of their nation's supreme leader, Ayatollah Ali Khamenei.

Turnout estimates were hard to verify independently, but all officials seemed to agree this Arbaeen was the largest they had ever seen. Some southern towns and cities looked emptied of their population.

Rahim said new access roads had to be opened to handle the flow of pilgrims converging on Karbala, a medium-sized city around 70 kilometres (45 miles) south of Baghdad.

Even Grand Ayatollah Ali al-Sistani, the most revered Shi'ite cleric in Iraq, acknowledged Friday that Karbala 'is not, in its current state, able to accommodate such huge numbers of visitors'.

Aerial views of the city showed rivers of black-clad faithful, many wearing coloured headbands and waving flags, as far as the eye could see.

Men perched on walls, roofs and window sills attempted to direct the flow of weeping and chanting visitors in order to avoid stampedes.

In the holy city of Karbala, south of Baghdad, an estimated 17million Shi'ite Muslims have gathered over the last 40 days. Above, the shrine to Imam Hussein to which worshippers have flocked

An aerial view of the shrine to Imam Huseein in Karbala shows millions of Shi'ite Muslims flooding the streets surrounding the mosque

Ali Sabri, an Iranian from Tabriz, running a large 'mawkab' - one of the 7,000 spots serving food and beverages to the pilgrims in Karbala - shipped in a bread-making machine that can churn out 90,000 flatbreads in eight hours.

'I will present this machine as a gift to the shrine authorities after the pilgrimage,' he said.

As night fell on Karbala, tens of thousands of the faithful knelt in perfect rows for a mass flood-lit prayer outside the shrine, with its glittering golden dome and two minarets.

The security deployment has been massive, amid fears ISIS and its seemingly endless supply of suicide bombers could seek to cause maximum casualties by attacking large crowds.

Access to central Baghdad has been very restricted for days, to minimise the risk of major attacks and avoid a complete logjam.

Millions of people have travelled to the Iraqi city where concerns over threats from IS militants led officials to heighten security

Shi'ite Muslims carry different flags representing the countries from which they have travelled to Karbala in Iraq for Arbaeen

Inside a mosque in Karbala Shi'ite Muslim men wear green turbans and remove their shirts for the festival held every year

Groups of worshippers raise in salute of Imam Hussein yesterday ahead of the religious festival's climax in Karbala today

Muslims raise their hands in praise of the Prophet Mohammed's grandson outside the shrine which bears his name in Karbala

Iraqi officials have stressed how crucial a recent military victory against the jihadists in the Jurf al-Sakhr area has been in making the pilgrimage possible.

The continued presence there of ISIS fighters would have endangered the pilgrims walking through an area that has been dubbed the 'triangle of death'.

Few incidents have been reported, however.

Besides Friday's deadly mortar fire near Karbala, which fell short of the area where pilgrims were congregating, four people were killed in crowd management-related incidents.

Three other people were killed earlier this week by a bomb blast targeting pilgrims in Baghdad.

Meanwhile, hundreds of Pakistani Muslims drew blood as they whipped themselves with chains in Rawalpindi for the religious ceremony.

In Iran, at the shrine to Imam Abdulazim in Shahr-e-Ray, hundreds gather in worship for the Prophet Mohammed's grandson

A young man joins worshippers outside the shrine of the Shi'ite Saint Immam Abdulazim in Shahr-e-Ray, south of Tehran in Iran

Elsewhere in Iran young men gather inside a mosque to show their respect of the martyred religious figure as the festival came to a climax

In Karbala, men covered in dirt and dust sing in ritual at the end of 40 days of mourning for Imam Hussein

Mourners in Iran mourners gather with commemorative ribbons around their necks and waving flags above their heads in worship

Hundreds of Shi'ite Muslims gathered in Rawalpindi in Pakistan where mourners struck themselves with chains to commemorate the death of the Prophet Mohammed's grandson in a holy festival known as Arbaeen

Two men sling metal chains around their torsos and backs in an act of religious respect at the ceremony in Rawalpindi, Pakistan, today

Men and young children watch on as two mourners flagellate as part of the religious festival today considered one of the most important in the Muslim calendar

A man grimaces as he hits himself in the back with blades attached to chains in the festival in Rawalpindi, Pakistan

Mourners gather in group worship to commemorate the death of the Prophet Mohammed's grandson in the festival of Arbaeen