FOR TWO months Iraq has been buffeted by big protests. Tens of thousands of people, angry over corruption, poor governance and a lack of jobs, have taken to the streets in Baghdad and the Shia south. The government has promised reforms. The security forces have fired liberally on the demonstrators. Neither tactic has worked. Things came to a head on November 29th, when the country’s senior Shia cleric, Grand Ayatollah Ali al-Sistani, called for a change of government. In response, Adel Abdul-Mahdi, Iraq’s prime minister, said he would step down.

His promise to resign comes after days of escalating violence that saw dozens of protesters killed. It began on November 27th in the southern city of Najaf, where protesters set fire to the Iranian consulate and, a day later, are said to have attacked one of the city’s most significant Shia shrines. Police and local militias drove the protesters back with bullets. In Nasiriyah, also in the south, the interior ministry’s quick-reaction forces fired on protesters holding a sit-in, killing at least 25 and wounding 160, according to the government. At least 400 protesters have been killed since the unrest began in early October.

Both the protesters and the ruling elite know that Mr Abdul-Mahdi’s departure is not the endgame. Rather, it is likely to mark the start of a new struggle over what comes next for the government. Many of the protesters (most of whom are Shia) want to bring down the entire political system, which shares power between Sunnis, Shias and Kurds (with some guaranteed roles for other minorities). The state is rife with corruption. Sectarian parties plunder official resources to build up militias and buy support, while providing little for the people. The Shia factions that comprise the largest blocs in parliament co-ordinate closely with Iran.

Those factions must select a successor to Mr Abdul-Mahdi (who may be kept on temporarily as a caretaker). But they disagree on how to deal with the unrest. Some Shia politicians favour more shooting. Hadi al-Amari and Qais Khazali head one of the largest Shia blocs, called Fatah, as well as powerful militias. They work with Qassem Suleimani, the commander of the Quds Force, the foreign legion of Iran’s Islamic Revolutionary Guard Corps. All want to spread Shia influence across the region—and think the protesters are getting in the way. Having thrown a bone to the protesters with Mr Abdul-Mahdi’s resignation, some in Fatah now want to deploy their militias against the protesters and clear the streets. The next prime minister, their men argue, should be more ruthless.

Other politicians argue for talking to the protesters. Many look to the president, Barham Salih, to play a leading role. He is a Sunni Kurd and aroused Mr Abdul-Mahdi’s ire by quickly condemning the shooting of protesters. Under Article 81 of the constitution he could serve as acting prime minister while parliament decides on a successor. He has not yet grabbed the mantle, but his call for a technocratic government has been echoed by Muqtada al-Sadr, a temperamental Shia cleric who heads parliament’s largest bloc, Sairoun. Mr Sadr has a strong base in the slums of Baghdad and Iraq’s second city, Basra. A new government, he says, should reform the electoral law to weaken the hold of the Shia blocs, and hold early elections.

That might just satisfy some protesters. But they are also divided. An increasing number of them want no truck with any representatives of the old order, including Mr Sadr. Some think he is trying to buy time and is also in cahoots with Iran, where he has been spending much of his time lately. The situation could escalate. In Nasiriya the killing of protesters outraged tribal leaders, who had thus far stayed on the sidelines—and who could tip the balance against the government. The danger is that the loudest voices on both sides will be those advocating violence.