NAJAF, Iraq — Iran’s religious leaders have been moving to expand their influence over the Shiite Muslim establishment in neighboring Iraq in a gamble aimed at gaining sway over Iraq’s largest religious group.

The Iranian campaign is most apparent here in the holy city of Najaf, home to Iraq’s clerical hierarchy and a gateway to the wider Shiite population, which represents about two-thirds of all Iraqis. In Najaf’s dusty warrens, Iran has bankrolled schools and charities, built elaborate mosques and nurtured links with religious scholars in a bid to undermine the local clergy, who have long been fiercely independent.

Clerics tied to Iran are promoting its particular brand of state-sponsored Shiite theology in the city’s seminaries and have been maneuvering to install one of their own as Iraq’s “marja,” or supreme religious authority, Iraqi political operatives say. Posters of Sheikh Mahmoud Hashemi Shahroudi, a senior Iranian politician whom Tehran had backed for that powerful post before he died, are still plastered on Najaf’s walls.

[By granting rare audience, Iraq’s grand ayatollah sends message to Washington and Tehran]

“Iran wants to abduct Najaf and make it its own,” said Ghalib al-Shahbandar, an Iraqi analyst and former Islamist politician. “It wants its own marja in Iraq and to control his movements.”

But the Iranian theocracy’s advances in Najaf have run into resistance, irking this city’s turbaned luminaries, and could ultimately fuel resentment among Iraq’s Shiites. Many Iraqis are already fed up with what they see as outsize Iranian interference in Iraq.

The late Sheikh Mahmoud Hashemi Shahroudi is pictured in Najaf in February. Shahroudi, who died in December, was a senior representative of Iran in the city, and some saw him as Tehran’s preferred successor to the elderly leader of Iraq’s Shiites. Worshipers are seen at the door of the shrine of Imam Ali as they prepare to enter the sanctuary. The shrine houses the tomb of the 7th-century Muslim leader.

LEFT: The late Sheikh Mahmoud Hashemi Shahroudi is pictured in Najaf in February. Shahroudi, who died in December, was a senior representative of Iran in the city, and some saw him as Tehran’s preferred successor to the elderly leader of Iraq’s Shiites. RIGHT: Worshipers are seen at the door of the shrine of Imam Ali as they prepare to enter the sanctuary. The shrine houses the tomb of the 7th-century Muslim leader.

Iran’s initiative to expand its religious influence complements its increasing efforts to project political, military and economic power in Iraq, where Washington and Tehran are competing for clout.

Iran has become particularly powerful after Tehran-backed militias took a leading role in vanquishing the Islamic State, which had occupied a broad swath of northern Iraq, and Iranian proxy forces retain control over extensive Iraqi territory.

Allies of Iran, including former militiamen, have an influential role in Iraq’s parliament. Iranian officials routinely mediate disputes among political and military factions. Many local media outlets depend on Iranian largesse. Iranian imports — as varied as cosmetics, eggs and steel — are flooding local markets. And Iranian energy supplies help keep the lights on in Iraqi cities.

In Najaf, it’s almost impossible to miss Iran’s presence.

Hundreds of thousands of Iranians travel to Najaf each year to visit the gold-domed shrine of Imam Ali, the cousin and son-in-law of the prophet Muhammad revered by Shiite Muslims. Iran has funded and helped steward an ambitious project to expand the shrine, including the construction of a museum, library and study halls for religious pupils in a separate annex. Khatam al-Anbiya, an engineering firm owned by Iran’s Islamic Revolutionary Guard Corps, is involved in the project.

A worshiper kisses the door of the shrine of Imam Ali in the city of Najaf. The shrine stands at the center of religious life in the city and draws millions of Muslim pilgrims annually. (Emilienne Malfatto/For The Washington Post)

The Iranian tourists spend vast amounts of money in Najaf’s markets, and signs on shops and restaurants are often in Farsi. The shelves of local bookstores are heavy with Iranian religious texts and pamphlets. And Iran helps pay for amenities including medical clinics, among them Najaf’s Imam Ali hospital, and support services for pilgrims. An Iranian company even has a contract to pick up the trash.

Meanwhile, Iran also pays stipends to religious students through offices managed by Iranian clerics and their allies and, at times, has used those connections to recruit Iraqis to fight for pro-Iranian militias.

But the Iranians are not universally welcome in Najaf. There are concerns in particular about what some Iraqi clerics see as Tehran’s effort to position its own candidate to become the next supreme religious authority. The post is now occupied by Grand Ayatollah Ali Sistani, who has put a premium on Iraq’s independence and has stood up against Iranian interference.

Sistani, 88, was born in Iran but opposes the Shiite doctrine known as wilayat al-faqih, or “guardianship of the Islamic jurist,” that underpins Iran’s governance system. The doctrine, which is contested among Shiite scholars, calls for a supreme religious and political leader to arbitrate all matters of the state and has animated debates among seminary students in Najaf and Iran for decades. Sistani supports a more advisory role for clerics.

[Clues to the identity of Iran’s next supreme leader in the back alleys of a holy city]

Sheikh Jassim al-Mandalawi, left, and Sheikh Ibrahim al-Baghdadi sit in a hussainiya, or congregation hall, built by the late Sheikh Mahmoud Hashemi Shahroudi in Najaf. As Mandalawi recites prayers, he counts with the aid of a tasbih. Mandalawi was an associate in Iraq of the late Iranian official Sheikh Mahmoud Hashemi Shahroudi.

LEFT: Sheikh Jassim al-Mandalawi, left, and Sheikh Ibrahim al-Baghdadi sit in a hussainiya, or congregation hall, built by the late Sheikh Mahmoud Hashemi Shahroudi in Najaf. RIGHT: As Mandalawi recites prayers, he counts with the aid of a tasbih. Mandalawi was an associate in Iraq of the late Iranian official Sheikh Mahmoud Hashemi Shahroudi.

Sistani has been a dominating influence in Najaf and beyond. His edicts have inspired millions of Iraqis to embrace activities including voting in elections and taking up arms against Islamic State jihadists. He is praised by Iraq observers as having strengthened Najaf’s independence and helped quell some of the country’s worst sectarian violence. But the ayatollah is elderly, and it is unclear what will happen once he’s gone.

“If Sistani dies, there will be a huge struggle to replace him, including among clerics with ties to Iran,” said Emad al-Sharaa, a former clerical student who is now a researcher at the Institute for War and Peace Reporting in Iraq. “Iran has tried to influence Najaf by establishing relationships with senior clerics, and Najaf has been weakened as a result.”

But, he added, “Nobody can rule Najaf from outside Najaf.”

Iran has tried before. Earlier this decade, Iranian Supreme Leader Ayatollah Ali Khamenei dispatched Shahroudi, the former chief justice of the Islamic republic, to his birthplace of Najaf to open an office and build a network of followers. His associates say he traveled to Iraq, initially in 2012, with the aim of eventually becoming Iraq’s supreme religious authority, a venture that would have solidified Iran’s grip on Najaf.

When Shahroudi came to Iraq, “he was preparing himself to become the marja of Iraq after Sistani’s death,” said a close aide to Sistani, who spoke on the condition of anonymity to discuss the motivations of a senior Iranian politician.

“He had potential. He was born in Iraq but was working quietly, out of respect for Sistani,” said Sheikh Jassim al-Mandalawi, an associate of Shahroudi’s in Iraq.

The front of the shrine of Imam Ali. (Emilienne Malfatto/For The Washington Post)

But Shahroudi’s reception from top Iraqi clerics did not go as he’d hoped. “He was stunned by the poor welcome he received,” the aide said of Shahroudi. “That’s why he left Iraq.”

He returned to Iran, where he then held a pair of senior government positions before dying in December at age 70. Now, the looming, mosaicked congregation hall he commissioned in Najaf is empty and unfinished, save for a lonely caretaker.

But there are others who would like to see Iraq follow Iran’s lead.

[Iraq is pushing to build an isolation camp for 30,000 Iraqis who lived under ISIS in Syria]

Sheikh Aladdin al-Jazari, a burly, black-turbaned preacher, is a cleric with close ties to Iran and openly advocates for Iran’s theocratic form of government, which he says could replace Iraq’s current “corrupt, political state.”

“My ambition here in Iraq is to have a system that is based on religion. As a cleric, I believe that our religion is capable of running all parts of life and the state,” Jazari said in an interview at his dimly lit office in central Najaf.

Jazari serves as a senior religious official in Harakat al-Nujaba, an Iranian-backed militia that was designated by the U.S. government as a terrorist organization in March, and he is a key liaison to the office of Iran’s supreme leader.

“Some people think that there should be a fatwa calling for a revolution to overthrow the state,” Jazari said. “But others say that this fatwa would be suicide,” he said, in an apparent nod to the backlash it could provoke among many Iraqis.

Overt moves by Iran to control the direction of the religious establishment could stir Iraqi anger. Sistani’s followers warn that a pro-Iranian successor would weaken the independence of Iraq’s storied religious establishment and upend the country’s delicate balance of political and religious forces.

“Sistani had a major role in keeping the peace and promoting security and stability in Iraq,” said Sheikh Khaled al-Baghdadi, a Najaf-based cleric and close aide to Sistani. “That has been his goal since the beginning.”

Crowds stream into the shrine of Imam Ali in February. (Emilienne Malfatto/For The Washington Post)

At an office at his home in the city, Baghdadi, surrounded by religious texts, served sweet tea and local filo pastries smothered in honey. When asked about Iran’s attempts to promote its own allies in Najaf, Baghdadi clutched his belly and chuckled.

“They [the Iranians] don’t have authority here. No authority can impose their will on us,” he said.