BAGHDAD (Reuters) - Iran has stepped in to prevent the ouster of Iraqi Prime Minister Abdel Abdul Mahdi by two of Iraq’s most influential figures amid weeks of anti-government demonstrations, sources close to both men told Reuters.

Iraqi demonstrators attend an anti-government protest in Baghdad, Iraq October 31, 2019. REUTERS/Thaier Al-Sudani

Populist Shi’ite cleric Moqtada al-Sadr demanded this week that Abdul Mahdi call an early election to quell the biggest mass protests in Iraq since the U.S.-led invasion that toppled Saddam Hussein in 2003. The demonstrations are fueled by anger at corruption and widespread economic hardship.

Sadr had urged his main political rival Hadi al-Amiri, whose alliance of Iran-backed militias is the second-biggest political force in parliament, to help push out Abdul Mahdi.

But in a secret meeting in Baghdad on Wednesday, Qassem Soleimani, head of the Iranian Revolutionary Guards’ elite Quds Force, intervened. Soleimani asked Amiri and his militia leaders to keep supporting Abdul Mahdi, according to five sources with knowledge of the meeting.

Spokesmen for Amiri and Sadr could not be reached for comment. An Iranian security official confirmed Soleimani was at Wednesday’s meeting, saying he was there to “give advice”.

“(Iraq’s) security is important for us and we have helped them in the past. The head of our Quds Force travels to Iraq and other regional countries regularly, particularly when our allies ask for our help,” the Iranian official said, asking not to be named.

Soleimani, whose Quds force coordinates Tehran-backed militias in Iraq, Syria and Lebanon, is a frequent visitor to Iraq. However, his direct intervention is the latest sign of Iran’s increasing influence in Iraq and across the region.

Iraqi security officials told Reuters earlier this month that Iran-backed militias deployed snipers on Baghdad rooftops to try to help put down the protests.

If Iraq falls further into crisis, Iran risks losing the influence it has steadily been amassing in the country since the U.S.-led invasion and which it sees as a counter to American influence in the region.

FATE UNCLEAR

Despite the maneuvering behind closed doors, Abdul Mahdi’s fate remains unclear. He took office a year ago as a compromise candidate between Amiri and Sadr but faces a wave of protests that has swelled in recent days.

In the 16 years since the fall of Saddam, a Sunni Muslim, Shi’ite Iran has emerged as a key power broker in Iraqi politics, with greater influence than the United States in the Shi’ite majority country.

But that proxy power battle has rankled ordinary Iraqis who criticize a political elite they say is subservient to one or the other of Baghdad’s two allies and pays more attention to those alliances than to Iraqis’ basic economic needs.

Despite their country’s vast oil wealth, many Iraqis live in poverty or have limited access to clean water, electricity, basic health care and education. Most of the protesters are young people who above all want jobs.

The protests have broken nearly two years of relative stability in Iraq. They have spread from Baghdad across the mainly Shi’ite south and met with a security crackdown that killed over 250 people.

Until earlier this week, it appeared that Amiri - who is one of Tehran’s key allies in Iraq and the leader of the Badr Organization of militia - was willing to support Abdul Mahdi’s departure.

Late on Tuesday night, Amiri issued a public statement agreeing to “work together” with Sadr after the cleric called on him to help oust the prime minister.

Wednesday’s meeting seemingly changed the course of events.

A Shi’ite militia commander loyal to Amiri - one of the five sources Reuters spoke to about the meeting - said there was agreement that Abdul Mahdi needed to be given time to enact reforms to calm the streets.

Many of the militia leaders raised fears at the meeting that ousting Abdul Mahdi could weaken the Popular Mobilization Forces, according to another source familiar with the meeting.

The PMF is an umbrella of mostly Shi’ite paramilitary groups backed by Iran who are influential in Iraq’s parliament and have allies in government. They formally report to the prime minister but have their own command structure outside the military.

Following the meeting with Soleimani, Amiri changed tune with Sadr. He told Sadr that getting rid of Abdul Mahdi would cause more chaos and threaten stability, a politician close to Sadr said.

In response, Sadr said publicly that without a resignation there would be more bloodshed and that he would not work with Amiri again.

“I will never enter into alliances with you after today,” he said in a statement.