Iraqi Shiite men take part in the religious ceremony of Ashura in the holy city of Karbala in southern Iraq.

Nov. 4, 2014 Iraqi Shiite men take part in the religious ceremony of Ashura in the holy city of Karbala in southern Iraq. Alaa Al-Shemaree/European Pressphoto Agency

Iraqi security forces and Shiite militiamen joined forces against feared Islamic State attacks on Tuesday as huge processions of Shiite pilgrims took part in a major religious commemoration centered on the shrine city of Karbala.

The events marking the Shiite observance, known as Ashura, are a major security challenge in Shiite-dominated Iraq and places with minority Shiite populations such as Saudi Arabia, where five people were killed outside a Shiite religious hall on Monday.

The extensive protection for Ashura events in Iraq reflects the increased ability of Islamic State militants to strike Shiite targets — including a recent series of suicide bombings and rocket attacks in Baghdad.

It also is an unsettling reminder of the deepening sectarian unrest across Iraq in the wake of the Islamic State’s dramatic gains earlier this year. Scenes of security forces on high alert stirred memories of the nonstop bloodshed between Sunni and Shiite factions in the years after the U.S.-led invasion in 2003.

The Sunni-led Islamic State, which now holds significant portions of Iraq, views Shiites as heretics. In response to the group’s attacks, well-armed Shiite militias — many with ties to Shiite power Iran — have turned their weapons on it.

Shiite Muslims on Tuesday observed Ashura - the day that commemorates the slaying of the Prophet Mohammad’s grandson, Imam Hussein, at the battle of Karbala - in Bangladesh and Iraq. (Reuters)

The militias also patrolled procession routes as hundreds of thousands of Shiite pilgrims descended on Karbala — about 65 miles south of Baghdad — to mark the death of Imam Hussein, the grandson of prophet Muhammad and revered by Shiites as his rightful successor. Sunnis acknowledge a different line of leaders after the prophet’s death in the 7th century.

Iraqi troops and police were on high alert in Baghdad and Karbala. According to Iraq’s Defense Ministry, “tens of thousands” of security forces were deployed to protect worshipers from possible Islamic State attacks.

Troops were required to secure the road spanning from Baghdad to Karbala that is taken by pilgrims. There, observers chant, pray or self-flagellate with knives or chains to emulate Hussein’s pain the night he was slain during the Battle of Karbala.

Late last month, security forces backed by Shiite militias recaptured the town of Jurf al-Sakhar from Islamic State militants in a bid to clear the route for Karbala pilgrims. The area’s location — edged between Anbar province, an extremist stronghold, and the largely Shiite provinces in the south — would have threatened the religious procession, security officials said.

“There are many checkpoints, and security is good. They are very alert,” Haider Ali, 24, said from Karbala by phone. He said Shiite militias also were helping secure the ceremony.

Rights groups have accused the militias of carrying out violence against Iraq’s Sunni population.

On Tuesday, the Islamic State asserted responsibility for a suicide bombing and multiple rocket attacks on Shiite neighborhoods of Baghdad the previous night.

In a statement circulated online and translated by the Site Intelligence Group, which tracks extremist Web sites, the militants said they had “ruined” the government’s security plan by carrying out the attacks.

In Saudi Arabia, sporadic violence has flared in Shiite areas in the east amid protests for greater recognition and rights. Last month, a Saudi court sentenced a Shiite cleric to death for his role in protests against the Sunni monarchy.

Gunmen fatally shot five people outside a Shiite religious hall on Monday in eastern Saudi Arabia, a major oil-producing region.

The state-run Saudi Press Agency reported Tuesday that two suspected militants and two security officers were killed in a shootout near the capital, Riyadh, linked to the investigation into the earlier slayings. At least 15 people were taken into custody nationwide, it said.

The agency quoted an Interior Ministry official as calling the attack on Shiites a “terrorist crime.”

Mustafa Salim contributed to this report.