Iraq’s rival parties were negotiating the contours of a new government on Monday, after the previous cabinet was brought down by a two-month protest movement insisting on even more deep-rooted change.

After just over a year in power, premier Adel Abdel Mahdi formally resigned Sunday after a dramatic intervention by top Shiite cleric Grand Ayatollah Ali Sistani.

That followed a wave of violence that pushed the protest toll to over 420 dead — the vast majority of them demonstrators.

Parliament on Sunday formally tasked the president with naming a new candidate, but Iraq’s competing factions typically engage in drawn-out discussions before any official decisions are made.

Talks on a new premier began before Abdel Mahdi resigned, a senior political source and a government official told AFP.

“The meetings are ongoing now,” the political source added.

Such discussions produced Abdel Mahdi as a candidate in 2018, but consensus will be harder this time around.

“They understand it has to be a figure who is widely accepted by the diverse centres of power, not objected to by the marjaiyah (Shiite religious establishment), and not hated by the street,” said Harith Hasan, a fellow at the Carnegie Middle East Center.

The candidate would also have to be acceptable to Iraq’s two main allies, arch-rivals Washington and Tehran.

“The Iranians invested a lot in the political equation in the last few years and won’t be willing to give up easily,” said Hasan.

Tehran’s pointman on Iraq, Qassem Soleimani, who heads the Iranian Revolutionary Guard Corps’ foreign operations arm, arrived in Iraq last week for talks, official sources said.