A power struggle in Iraq between the Shiite cleric Moqtada al-Sadr and rivals aligned with Iran is testing Tehran's ability to stave off a conflict that could damage its interests and further destabilize the oil-rich country.
With Sadr supporters camped out in parliament and his opponents protesting in the streets, the tussle over a new government has put fresh strain on a political system that has been buffeted by crises since US-led forces toppled Saddam Hussein two decades ago.
It adds another destabilizing factor to a belt of fragile Arab states between Iran and the Mediterranean - Iraq, Syria and Lebanon - all of which fall within Iran's sphere of influence and have suffered major conflict or crisis over the last decade, including the battle with ISIS.
So far, neither side seems ready to give ground in the 10-month-old standoff, which began when Sadr emerged victorious from an October election and sought to form a government on his terms, only to be stymied by his foes.
For now, the sides - both heavily armed - appear to be avoiding violence, aware of the impact this would have on Iraq and the Shiite majority that was empowered by the political system the United States built after ousting Saddam.
But amid dramatic scenes in Baghdad, where Sadr supporters overran the fortified Green Zone that houses state buildings and embassies at the weekend, many Iraqis are concerned about possible violence.
In a sign of Iran's concern, head of the Revolutionary Guards’ Quds Force Brigadier General Esmail Ghaani, visited Baghdad in recent days in an effort to keep tensions from escalating, a Western diplomat said.
An Iraqi official in the Coordination Framework, an alliance of Iran-aligned factions, confirmed the visit but said Ghaani didn't appear to have succeeded, without giving details.
Iran's embassy in Baghdad didn't respond to a request for comment.
Ghaani has struggled to wield the influence of his predecessor, Qassem Soleimani, killed by a US attack in 2020.
"Iranian influence has had its ups and downs and has been waning to some extent," said Renad Mansour of Chatham House, a think tank. "This election and government formation process has exposed fragmentation ... among the political parties which makes it very complicated for Iran."
The crisis comes at a difficult moment for Iran elsewhere. The heavily armed Hezbollah and its allies lost a parliamentary majority in Lebanon in a May, though they still have big sway.
Sadr, heir to a prominent clerical dynasty who fought US forces after the invasion, has long opposed foreign influence.
He raised the stakes in June when he instructed his lawmakers to quit parliament, ceding dozens of seats to the Iran-aligned factions. Their subsequent moves towards forming a government without Sadr prompted the parliament takeover.
Sadr's recent call for unspecified changes to the constitution may indicate he wants to upend the entire system.
But some analysts question how much he really wants to change a system that has served him well: Sadr dominates much of the state which employs many of his followers.
"Sadr is no revolutionary. He wants the system to go on but with him in a more dominant position," said Toby Dodge, a London School of Economics professor.
Dodge described the standoff as "a squabble within an increasingly unpopular elite" in a country where poor governance and corruption has inflicted power and water cuts, poverty and unemployment on Iraqis, despite enormous oil wealth.
Those same conditions fueled mass protests across Baghdad and southern Iraq in 2019 in which security forces killed hundreds of protesters.
"There could be miscalculations and mistakes. But it seems to me that in every stage in this process, either one side or the other has taken steps to avoid violence," Dodge said.
A game changer?
The United States maintains around 2,000 troops in Iraq to fight ISIS remnants, far fewer than the 170,000 US troops there at the height of the occupation.
Once involved in backroom dealings over Iraqi government formations, US officials have largely stayed out of such contacts in recent years, according to Iraqi officials.
Vali Nasr, a Middle East expert at the Johns Hopkins School of Advanced International Studies in Washington, said Iraq did not appear to be a big US priority.
"It (Iraq) was not treated as a game-changer for the region, which it could end up being if Iraq loses the modicum of stability it had," he said.
"It is too soon to call this a loss for Iran, it may end up being a loss for everybody, and then the question becomes who picks up the pieces afterwards," he said.
The US State Department did not immediately respond to questions for this story.
The US embassy has urged calm and for Iraqi parties to avoid violence and work peacefully to resolve their differences.
Hamdi Malik of the Washington Institute think tank noted signs of restraint by both sides, but said conflict was a risk.
"Any civil war between Shiite groups will have a profound impact not only on ... people in Iraq, but the wider region and even other parts of the world, not least because of the possible disruption in oil supplies, as much of Iraq's oil wealth is located in predominantly Shiite parts of the country," he said.