Protesters in Iraq have won their first big success by forcing the resignation of the Iraqi prime minister, Adel Abdul-Mahdi, after the killing of 45 unarmed protesters by the Iraqi security forces in a single day. As the news spread, the crack of celebratory fireworks replaced that of gunshots in Baghdad's Tahrir Square, which has been the centre of demonstrations since they began two months ago.

The impending departure of Mahdi is a symbolic victory for the protests, but too many people have been killed for it to quell what is close to a mass uprising by the majority Shia community. He had proved an ineffectual leader and the entire ruling elite in Iraq is probably too corrupt and too determined to hang on to power to make the radical reforms demanded by the protesters.

The announcement that the prime minister was stepping down came after 36 hours in which the security forces had switched from killing individual demonstrators to massacres on a larger scale – with as many as 50 people shot dead on a bridge in the southern city of Nasiriya – bringing the number killed to 408, as well as thousands more wounded, since 1 October.

Compare this horrific casualty list over eight weeks with that in Hong Kong, where just one protester has been killed and one has died accidentally since protests started six months ago. Compare also the vast and sympathetic publicity given to the Hong Kong protests with the limited interest in the savage and unprecedented government clampdown in Iraq.

Probably the world has got used to Iraqis being murdered in large numbers, whether it is by Isis, Saddam Hussein or the US air force, so it is no longer considered news.

But history is made by unreported massacres. “It plants hatred in the heart,” a Palestinian once said of a mass killing by Israeli troops decades ago in Gaza in which his uncle had been killed.

The violence is seen as only affecting Iraqis, but it has the potential to reshape the politics of the Middle East. Since the Iranian revolution in 1979, one of the most powerful political and military forces in the region has been the increasing strength of Shia communities under Iranian leadership. Over the last 40 years, this coalition has outfought and outmanoeuvred enemies such as the US, Israel and Saudi Arabia in Lebanon, Syria, Yemen and, above all, in Iraq.

The importance of the Iraq-Iran alliance is so great because two-thirds of Iraq's 38 million population are Shia and it has a 900-mile-long border with Iran. Since the fall of Saddam Hussein in 2003, Iraq has had a Shia-dominated government that usually acted in unison with Iran. Iraqi Shia differ in many respects from their Iranian co-religionists, but they have seen them until recently as an essential ally in the struggle with Isis. The holiest Shia shrines are in the Iraqi cities of Najaf and Karbala, to which millions of Iranian pilgrims flood every year.

But in the last two months, this victorious, Iranian-led Shia coalition has been fractured as pro-Iranian sections of the Iraqi security services and paramilitary groups repeatedly shot down Shias protesting about the lack of jobs, inadequate social services and pervasive corruption on the part of Iraq’s ruling elite. These protests were initially on a small scale and only gained momentum because of the government’s overreaction to what was at first a very minor threat.

Iraq protests: Death toll soars as live rounds and tear gasfire Show all 17 1 /17 Iraq protests: Death toll soars as live rounds and tear gasfire Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi protesters take cover behind a barricade on Al-Jumhuriya Bridge during an anti-government demonstration in the Iraqi capital Baghdad on 25 October, 2019. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Protesters push down concrete walls during a protest over corruption, lack of jobs, and poor services, in Baghdad. Reuters Iraq protests: Death toll soars as live rounds and tear gasfire Anti-government protesters try to break into the provincial council building during a demonstration in Basra. AP Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi women protesters march with national flags during an anti-government demonstration in the central holy shrine city of Najaf. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire An Iraqi protester uses a mobile phone to take a selfie photo with an army soldier standing atop a humvee during a demonstration outside the local government headquarters in the southern city of Basra. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi protesters gather during an anti-government demonstration at the burning local government headquarters in Nasiriyah, the capital of Iraq's southern province of Dhi Qar. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi protesters wave a national flag as they stand atop the gatehouse to the local government headquarters in the southern city of Basra. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire An Iraqi protester throws back a tear gas canister fired by security forces amid clashes during an anti-government demonstration in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi protesters carry away an injured protester following clashes during an anti-government demonstration in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi security forces stand guard on Al-Jumhuriya Bridge during an anti-government demonstration in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Anti-government protesters gather in Tahrir Square during a demonstration in central Baghdad. AP Iraq protests: Death toll soars as live rounds and tear gasfire The burning local government headquarters in Nasiriyah, the capital of Iraq's southern province of Dhi Qar. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Protesters take cover behind a concrete barricade during a demonstration in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi paramedics help injured protesters in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Iraqi protesters gather in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire An Iraqi protester takes cover between concrete barricades in Baghdad. AFP/Getty Iraq protests: Death toll soars as live rounds and tear gasfire Protesters take cover from teargas canisters fired by security forces in Baghdad. AFP/Getty

From the first, there was little effort to conceal the role of Iran in masterminding the repression. Reports surfaced at an early stage that General Qassem Soleimani, the head of the Quds Force – the foreign arm of the Revolutionary Guards in Iran – had decided that the protests were part of a foreign plot and the best way to deal with them was with “a whiff of grapeshot”.

Many generals in history have thought the same thing and, through violent but failed repression, have turned limited expressions of discontent into open revolts. In the Iraqi case, the protesters became virulently anti-Iranian.

The outcome of the counterproductive and futile attempts by pro-Iranian forces in Iraq to crush the protests may be the beginnings of a sea change in the politics of the Middle East. The previously triumphant alliance of the Iranian and Iraqi Shia – a coalition that had seen off the US and its allies – may be irretrievably broken. The Iranians and their Iraqi allies have done more to break the link between the two countries in the last eight weeks than Washington and Riyadh succeeded in doing in years of trying.

Why did Iran overreact? President Trump’s policy of “maximum pressure” on Iran has not proved very successful, but it has made the Iranian leadership, always paranoid and prone to conspiracy theories, nervous and likely to exaggerate anything that looks like a threat. Paradoxically, this feeling of vulnerability on the part of Iran is linked to a sense of hubris born out of its repeated victories in proxy wars in the region.

But these successes produced a new weakness in the Iranian-led Shia coalition: it acquired an interest in Lebanon, Iraq and Syria in maintaining the political status quo, however unjust, corrupt and incompetent it might be. In Iraq, for instance, the predominantly Shia ruling class might once have been heroic opponents of Saddam Hussein, but they have long since transmuted into a dysfunctional kleptocracy that is hostile to reform.

Shia leaders rebuffed critics of their failings by appealing to communal solidarity against existential threats from al-Qaeda-type groups, but that excuse lost traction in the last few years as Isis was defeated. In Iraq, the discontent goes particularly deep because much of the Shia population – the Sunni and Kurds have kept out of it – wonders why they are without jobs, water and electricity in a country that earns $7bn a month from oil exports.