KARBALA, Iraq — The annual ceremony commemorating a founding figure of Shiite Islam is one of the most important religious celebrations in the Shiite world, drawing millions of pilgrims to the holy city of Karbala, Iraq.
This year, the Arbaeen ceremony was also a political skirmish — the latest test of Iran’s power in Iraq and of Iraq’s increasing desire for independence from its powerful neighbor.
Iran, the largest Shiite Muslim country in the world and a regional powerhouse in the Middle East, saw the pilgrimage that ended Saturday as an opportunity to assert its role in Iraq and send a message about its regional reach.
“Arbaeen is a display of power for Iran and a showcase of unity among Shiites in the region,” said Hossein Sulaimani, the editor in chief of Mashregh, a newspaper affiliated with the Iranian Revolutionary Guards.
Iran contributed tents, bathrooms and hospitals along the pilgrimage route, supplementing those erected by Iraq, to aid the estimated 15 million pilgrims, nearly one in four of them from Iran. It released inspirational videos claiming credit for saving Shiite shrines from destruction by the Islamic State.
But when Iran said it would send tens of thousands of police officers into Iraq to provide security for the event, Iraq drew the line.
Iraqi authorities welcomed the aid to the pilgrims but blocked the police force, which would have been seen as a humiliating display of Iranian authority.
“Our forces which defeated Daesh are capable of securing the pilgrimage and we don’t need any foreign forces to enter Iraq to police it,” Lt. Gen. Saad Maan, the Iraqi Interior Ministry spokesman, said last week, using an Arabic acronym for the Islamic State.
The rejection of Iranian security was a small but clear effort to limit Iran’s footprint in Iraq.
Since American-led military forces overthrew the Iraqi dictator Saddam Hussein in 2003, empowering Iraq’s Shiite majority, a crucial question for Iraq and the region was the extent to which it would fall under the sway of Iran, the Shiite theocracy to the east.
Iran gradually expanded its influence in Iraq through a web of political parties, Shiite clerics and militias, and it invested heavily in Shiite religious cities like Najaf, Karbala and Samarra.
When the Islamic State seized a third of the country in 2014, Iran rushed to Iraq’s aid, backing militias that, with the help of Kurdish and American forces, drove the jihadist group out.
Iran sees Iraq as its literal gateway to regional influence — the first stop on a land bridge to its proxies in Syria and Lebanon. More recently, Iraq has been critical to Iran’s survival of painful American economic sanctions, thanks to an American waiver allowing it to buy oil and gas from Iran. Iraq is also a major customer for Iranian goods that are not under sanction, including food and construction materials.
But as Iran’s influence increased and America’s ebbed, Iraq has increasingly chafed at Iran’s presence and its efforts to insert sympathetic politicians into Iraq’s government.
The biggest winner in Iraq’s last election was the party backed by Moqtada al-Sadr, a nationalist cleric who opposes both American and Iranian involvement in Iraq, but the kingmaker was a bloc representing Iraqi militia groups with links to Iran. It was Maj. Gen. Qassim Suleimani, the commander of the elite Quds Force of the Iranian Revolutionary Guards, who brokered the agreement that put the current prime minister, president and Parliament speaker in office.
And four years after the battle against the Islamic State officially ended, the Iranian-backed militias remain. With more than 125,000 armed men, they are now technically part of the government security forces but in reality they have become a force unto themselves.
When protests erupted across Iraq this month against corruption and unemployment, Iranian officials were caught off guard. Some of the demonstrators blamed Iran and its outsize influence for Iraq’s economic troubles. Protesters in Shiite strongholds typically loyal to Iran burned the Iranian flag and chanted for the Islamic Republic to stop meddling in the country’s affairs.
At a meeting in the foreign ministry in Tehran this month, several diplomats wondered if Iran had misread Iraq all these years, mistakenly seeing its alliance with politicians as tantamount to public support, according to one person who attended the meeting.
Iranian officials saw the approaching Arbaeen festival as a way to burnish Iran’s image.
The holiday marks the 40th day after the death of Imam Hussein, the grandson of the Prophet Muhammad, who was killed in a battle for the leadership of Islam. His descendants became Shiite Muslims, while the forces that defeated him evolved into the Sunnis, establishing the two main sects of Islam today.
Tradition demands that Shiites walk to Karbala in a re-enactment of the journey taken by Imam Hussein’s family when they brought his head to the city for burial. Some walk for weeks from as far away as Basra, Iraq, about 300 miles.
The festival has experienced a resurgence since the overthrow of Saddam Hussein, a Sunni Muslim who banned its celebration fearing it would rally the country’s Shiites. For years after his ouster, Al Qaeda and its successor, the Islamic State, attacked the Karbala walkers, killing thousands.
Since then, the pilgrimage has grown from a few thousand brave souls to an estimated 15 million, making it one of the largest annual pilgrimages in the Muslim world.
Iraqis were proud of the accomplishment and this year should have been their moment to celebrate their ability to organize and protect the ceremony. But Iran, which not only built way stations along the route but has spent millions over the last five years renovating Shiite shrines in the Iraqi cities of Karbala and Najaf, also took credit.
Pilgrims walking to Karbala this past weekend were confronted with both narratives.
A large billboard depicted the Iranian-backed militias as modern-day comrades of Imam Hussein: a militia fighter standing next to Imam Hussein faces a crowd of modern-day warriors carrying Islamic flags, while Imam Hussein faces warriors in ancient garb.
The Iranian Revolutionary Guards commander, General Suleimani, released a video on Friday showing him walking through the battlefields of Mosul, peering through binoculars as explosions go off, a pointed reminder of Iran’s role in the fight against the Islamic State there. Then, as the video shifts to an aerial view of the golden dome and two pillars of the Karbala shrine, he intones: “If they had gotten to our shrines, they would have completely destroyed them.”
The video ends with Arbaeen crowds marching to Karbala.
Just down the road from the militia billboard was a display of large posters of Iraqi protesters killed in the last two weeks when they marched peacefully against corruption in the Iraqi government, an indirect rebuke to Iran.
Those photos stood outside tents belonging to the followers of Mr. al-Sadr. Despite his campaign against Iranian influence, the tents welcomed Iranian pilgrims, who totaled some 3.5 million this year.
“As long as the Iranians are here as a guest, as a visitor, we welcome them,” said Abu Karar, 50, a retiree who had set up one of the photos. “They are the guests of Imam Hussein. Even if the enemy comes for Imam Hussein, we will welcome him.”
Likewise, Iraqi pilgrims sometimes availed themselves of the 22 guesthouses, 250 restrooms, four field hospitals and 14 emergency centers that Iran built along the route to Karbala in Iraq, according to an Iranian Revolutionary Guard spokesman, Gen. Ramezan Sharif.
The Iraqis also provided free food and accommodations for millions of pilgrims, cooking giant vats of rice and lentils, chick peas and broad beans, making millions of cups of sugared tea and ladling out countless glasses of fresh yogurt.
General Sharif told Iranian media that the Guards’ construction entity, Khatam al Anbiya, had paved and repaired roads leading to Karbala’s shrines.
And while uniformed Iranian police were barred from Iraq, Iranian intelligence operatives and undercover forces did come. The Iranians, citing recent unrest, also pushed to have a large number of the Iraqi militias included in the festival security forces.
Of the 60,000 security officers dedicated to the festival, some 15,000 were militia members, according to Maj. Gen. Qais Khalaf al-Mohammedawi, the festival’s security coordinator. He did not provide a breakdown of how many of them came from militias tied to Iran.
The antagonism notwithstanding, the effort was ultimately symbiotic. Security was coordinated in a joint Iraqi-Iranian operations center, cooperation that benefited pilgrims from all countries.
For many of the worshipers, politics seemed a long way off.
“Everyone is very welcoming, very friendly, we love to come here,” said Ruhollah Hadadi, 38, an Iranian pilgrim who works in public relations in Tehran. “Some people said Baghdad is unsafe, but we are walking everywhere, the security people are very friendly.”
“Arbaeen is utopia,” he added. “Arbaeen is for all.”
Alissa J. Rubin reported from Karbala, and Farnaz Fassihi from New York. Falih Hassan contributed reporting from Karbala.