BAGHDAD — As Shiite militiamen began streaming toward Ramadi on Monday to try to reverse the loss of the city to the Islamic State, the defeat has given new momentum to Prime Minister Haider al-Abadi’s rivals within his own Shiite political bloc.
At the urging of American officials who sought to sideline the militias, Mr. Abadi had, in effect, gambled that the combination of United States airstrikes and local Sunni tribal fighters would be able to drive Islamic State fighters out of the city as fighting intensified in recent weeks. The hope was that a victory in Ramadi could also serve as a push for a broader offensive to retake the Sunni heartland of Anbar Province.
But as the setback brought the Shiite militias, and their Iranian backers, back into the picture in Anbar, intensified Shiite infighting appeared to leave the prime minister more vulnerable than ever. And it presented a new example of how developments on the Iraqi battlefield have sometimes instantly shifted political currents in the country.
“Abadi does not have a strong challenge from Iraq’s Sunnis or Iraqi Kurds,” said Ahmed Ali, an Iraqi analyst in Washington with the Education for Peace in Iraq Center. “It’s from the Shia side.”
Mr. Abadi’s rivals within Iraq’s Shiite political bloc have been accusing him for months of doing too much to work with Sunnis rather than empowering the militias and fellow Shiites.
He became prime minister last year with strong backing from the United States on the belief that he would be a more inclusive leader than his predecessor, Nuri Kamal al-Maliki, and would reach out to the country’s minority Sunni Arabs and Kurds. Mr. Abadi has done so, by pushing for the arming of local Sunni tribesmen and reaching a deal with the Kurds to share oil revenue.
But at every turn he has been thwarted by powerful Shiite leaders with links to Iran, including Mr. Maliki. Now, the latest setback in Ramadi has given Mr. Abadi’s rivals even more ammunition.
Some Shiite politicians, including Mr. Maliki, and powerful militia leaders linked to Iran, whose fighters are now preparing to fight in Anbar, have become increasingly critical of Mr. Abadi. Either they have spoken out themselves or news media outlets they control have taken aim at the prime minister through distorted coverage that has highlighted security failures in Anbar.
In one instance, the television news channel Afaq, which is run by allies of Mr. Maliki, gave running coverage to the supposed slaughter of 140 army soldiers last month at an outpost in Anbar, spurring public criticism of Mr. Abadi. Western diplomats and military officials say the story was untrue, and the Islamic State, notably, never claimed to have killed that many.
The effect, though, was to undermine Mr. Abadi’s rule, analysts said. There were calls for Mr. Abadi to resign.
Flashing uncharacteristic anger, Mr. Abadi appeared in front of Parliament and essentially dared his rivals to remove him from power.
“Iran is using Maliki against Abadi,” said a diplomat in Baghdad with close ties to the Iranians who spoke on the condition of anonymity to maintain relationships in the capital. “They don’t want Abadi to become pro-Western. The Iranians want Abadi weak.”
An official close to Mr. Abadi, who spoke anonymously to discuss private conversations, related a joke that has been told among the prime minister’s inner circle: “Even if two fish fight in the river, it is Maliki stirring them up.”
The official added, of Mr. Abadi, “He is obsessed with Maliki.”
The largely Shiite militias are grouped under an umbrella organization called the Popular Mobilization Forces and, on paper at least, are under Mr. Abadi’s command.
Some of the newer units, formed last year after Shiite clerics called on young men to take up arms and fight the Islamic State, also called ISIS or ISIL, do answer to the prime minister. Some of the most powerful groups, though, such as the Badr Organization, Asaib Ahl al-Haq and Kataib Hezbollah, may answer to Mr. Abadi in individual cases — they did not advance on Anbar until the prime minister gave orders, for example. But those militias were trained and supported directly by Iran, and the militias’ leaders have grown immensely in popularity with the Iraqi public as they have won significant battles against the Islamic State.
This has presented serious challenges to Mr. Abadi’s authority. For instance, in March, at the beginning of an operation to retake the city of Tikrit, north of Baghdad, the plans were drawn up by militia leaders, and then Mr. Abadi was told it would happen. Once those fighters failed to retake Tikrit decisively, Mr. Abadi asked them to withdraw and called for help from American airstrikes, reasserting his authority for the moment.
Now that the militias have been called upon to fight in Anbar, Mr. Abadi’s authority seems to be waning again, and the militias’ cachet has only grown. One of the most popular pictures circulating on social media in Iraq on Monday showed Hadi al-Ameri, the powerful head of the Badr militia, examining a map and seemingly plotting out a new campaign in Anbar.
Fanar Haddad, an Iraqi analyst, recently wrote in an online column that the militias have “provided a potent rallying point for a reinvigorated sense of Iraqi nationalism, albeit one with distinctly Shiite overtones.”
In an interview, Mr. Haddad said Mr. Abadi was limited in his ability to constrain the Popular Mobilization Forces — or Hashid in Arabic, as the militias are known here. “If you want to be part of Iraq’s evolving political game, you can’t go against the Hashid,” he said. “It’s just too popular.”
The militias’ growing popularity has coincided with an even more powerful approval of Iran’s role in Iraq, at least among Shiite Iraqis.
Once, even many Iraqi Shiites looked at Iran with some suspicion, partly because of the legacy of the long and bloody war that Iraq fought with Iran in the 1980s. A frequent gripe of the past was about low-quality Iranian goods, such as cheese and yogurt, clogging the shelves of grocery stories.
Now, though, in the words of Ali Kareem Salman, a 31-year-old government worker in the south, “Shiites think that Iran is the protector of the Shiite sect.”
Hanan Fatlawi, a Shiite lawmaker who is one of Mr. Abadi’s most vocal critics, said: “Previously, you could divide the Shia into two sides: those who hate Iran and those who love them. But after the entrance of ISIS, and with the situation we are in, many people are grateful to Iran. Their opinion changed.”
Of the militias, she said, “Without them, there would be no Baghdad.”
There is an essential paradox to Mr. Abadi’s leadership thus far. In nearly every way he has proved to be the inclusive leader mandated by the United States, reaching out to Sunnis and Kurds and seeking consensus. But within Iraq, he is increasingly viewed as weak and unable to effectively shift Iraq’s tragic trajectory.
“This term ‘inclusive personality,’ I only hear from foreigners,” Ms. Fatlawi said. “He was weak from the start.”