WHEN the Iraqi Prime Minister Haider Al Abadi introduced his first package of administrative and fiscal reforms in August—including the removal of his predecessor, Nouri Al Maliki as vice president—he was betting that few would dare to oppose him. It was a high-stakes gamble: he enjoyed the support of top Shiite clergymen, as well as thousands of Iraqi demonstrators angry about corruption in the government and a lack of basic services. So what could possibly go wrong?

Three months later, it’s clear that Al Abadi has lost his bet. On Nov. 2, Iraq’s parliament has kept him in check by unanimously approving an immediately effective counter-resolution, one that requires Al Abadi to get parliament’s permission before introducing wide-ranging reforms. It’s no joke; a senior Iraqi Shiite lawmaker, who asked to remain anonymous, described the move as “pinching the ear” of the prime minister, as one would do to a wayward child. In the eyes of Al Abadi’s ruling State of Law coalition and its partners, the prime minister has overstepped the mark. Their counter resolution “aims to rein Al Abadi in, and bring him back to the barn of the political blocs,” the lawmaker said.

But it’s really had a secondary effect: the move has also challenged the influential Shiite religious leaders of the holy city of Najaf, collectively known as the Marjaiyah, who’ve thrown their weight behind Al Abadi’s initial efforts to stamp out corruption. In creating a crisis for the prime minister, lawmakers have risked creating another for themselves, especially as Iraq’s religious leaders have made their unhappiness with parliament’s actions broadly known.

At Friday’s sermon on Nov. 6, an aide speaking on behalf of Grand Ayatollah Ali Al Sistani, the most revered Shiite cleric in Iraq and the head of Najaf’s clergymen, accused lawmakers of trying to “circumvent the reforms” under the pretext of protecting the constitution. He called on the legislative, executive and judicial branches to work together to achieve meaningful change; a charged moment for Iraqi politics.

It was Al Sistani who had thrown his moral weight behind mass protests that started in late July, ultimately compelling Al Abadi to push through reform measures. At the time, Iraq was suffering from a heat wave that pushed up temperatures to 50 degrees Celsius, exacerbated by widespread power outages. The government had declared a four-day public holiday and advised people to remain at home.

But instead of staying put indoors, thousands of Iraqis in Baghdad and the Shiite-dominated provinces in the south took to the streets in protest of the severe lack of electricity and drinking water.

On Aug. 7, crowds of demonstrators across the country swelled to the tens of thousands. Come that Friday’s sermon, Al Sistani’s representative had announced the cleric’s full support for the “eligible demands” of the demonstrators. He went further, urging Al Abadi to be bold and “hit the corrupt officials with an iron fist,” calling for the replacement of rotten government officials and for the political blocs that protect them to be denounced.

He also demanded that the prime minister tackle the financial and administrative corruption that the Marjaiyah and many Iraqi lawmakers believe caused Mosul, the second-largest Iraqi city, and vast swathes of the nearby provinces to fall into the hands of Daesh militants after the dramatic collapse of the Iraqi army in the summer of 2014.

Two days later, Al Abadi sent his first package of reforms to the parliament after its approval by his cabinet. The proposed reforms included cutting the cabinet by one third, reducing monthly salaries and the privileges of top officials and lawmakers, and eliminating the posts of the three vice presidents and three deputy prime ministers. Under pressure from Najaf’s clergymen and massive demonstrations, the parliament then approved the reforms without delay, even as some lawmakers and government officials warned that eliminating the vice presidential posts, despite them being ceremonial, was in fact, unconstitutional.

Shortly after the vote, Yazin Misha’an, a Sunni political leader, said in an interview, “Al Abadi enjoys the full support of the greatest two powers in the country, the demonstrators and Marjaiyah. Who would say no to his reforms and face the wrath of Najaf and the street?”

Today, the reform measures appear to have been ineffective. The three vice presidents have clung on to their posts, and only several weak ministers and dozens of officials and military commanders with no political backing have been dismissed. Damningly, prominent politicians, top senior officials and military commanders who were publicly accused of wrongdoing still remain in power.

In the process of streamlining the government, Al Abadi has alienated his coalition’s partners in parliament, the Badr bloc included, with his removal of senior government positions ring-fenced under the country’s sectarian and political power-sharing model. Since the 2003 U.S. ouster of Saddam Hussein, central and local governments have been formed through political consensus, not at the ballot box. With the exception of the prime minister’s position, which is usually given to the biggest parliamentary bloc, all federal government posts are subject to a power-sharing arrangement. Under this deal, imposed by the Americans in 2005, all parliamentary blocs have a right to participate in government, and receive a share linked to their number of seats.

“When Al Abadi canceled several ministries and integrated others, he impacted the political power-sharing deal,” said the senior Shiite lawmaker, who cited the example of the Badr bloc, which lost most of the ministries under its control but was not compensated for the change.

Under the constitution, the president has a right to appoint one deputy if needed, but many government posts, like the vice presidents, were created in the past to guarantee wider participation and satisfy the biggest players. These positions are appointed by the various political blocs after a consensus is reached. Removing these ceremonial posts would have no impact on the running of the government, but it has upset three top political leaders and their allies: Al Maliki, the head of the Shiite State of Law coalition, who was appointed as vice president after he was forced out as prime minister last year; Osama Al Nujaifi, the Sunni vice president, and Ayad Allawi, the vice president who leads the secular group of parties.

Al Abadi’s cost-cutting measures were also widely seen as an attempt to get rid of Al Maliki, a fellow Dawa Party member and rival. The prime minister said that removing the posts of the three vice presidents would help pay the salaries of four million government employees, an increasingly difficult task for a government that has seen its revenues drop precariously along with oil prices. He has publicly blamed Al Maliki for wasting money over the past few years in an attempt to hold on to his position as prime minister.

Al Maliki argued that the prime minister had no right to remove his post without changing the constitution. Al Maliki, Al Nujaifi and Allawi sent a challenge to the Federal Supreme Court, the highest Iraqi court. But before the court could respond, parliamentary members, though not openly complaining about Al Abadi’s actions, had already come up with a way to strike back. “We just said that what was approved by legislation has to be removed by legislation,” said Hussam Al Aqabi, a lawmaker with the Sadrist bloc, one of the State of Law coalition’s rivals.

In passing the new resolution, parliament has annulled the sweeping mandate given to Al Abadi in August. Now he has to go back to the parliament to modify the law to allow him the right to remove vice presidents or to enact any other major reforms.

To make matters worse, Al Abadi faces a rebellion not just within the parliament but also within his own State of Law coalition. Despite the deep cracks that have appeared since Al Abadi replaced Al Maliki as prime minister, State of Law is still the biggest parliamentary bloc, which means it has oversight of the prime minister’s post. Five days before the vote on the new resolution, 45 of Al Maliki’s State of Law supporters signed a petition to dismiss Al Abadi, who they said was ignoring the political blocs’ roles and acting unilaterally. If the political blocs agreed to hold a no-confidence vote, it would need only 50 lawmakers to sign the request and send it to the parliament’s speaker for it to be tabled.

Given the widespread disgruntlement among lawmakers, it’s likely that a no-confidence motion would be approved if held today. But several lawmakers said Ali Al Adeeb, a prominent Dawa Party leader, had intervened at the last minute by assuring Al Abadi that he was still the bloc’s choice as prime minister and asking him to talk to his State of Law partners.

If Al Abadi is ultimately removed as the prime minister, lawmakers say he has only himself to blame for squandering a rare opportunity. One of Al Abadi’s Shiite partners, who declined to be named told Newsweek Middle East “Al Abadi did not take advantage of the Marjaiyah’s support because he had no clear vision about the required reforms and which laws he has to modify.”

Al Abadi’s gamble could still have traction, but that’s contingent on Najaf’s clerics refusing to abandon his anti-corruption agenda. “Everyone is waiting to see the Marjaiyah’s reaction, as well as the demonstrators’,” Hussam Al Eqabi, a Sadrist lawmaker who also a member of the parliamentary finance committee, said in an interview after the vote. The Marjaiyah have sent a clear message to Iraq’s power-brokers: Quit stalling on reforms. Given that religious leaders have the ability to rally Iraqi citizens en masse, lawmakers may not want to wait around to see how the demonstrations play out.