WHAT would politicians the world over like to do when they lose an election? Annul the results and burn the ballots, of course. In Iraq such dreams come true. On June 6th outgoing MPs voted to hold a recount of Iraq’s election and sack the head of the electoral commission. They were furious that a populist Shia cleric, Muqtada al-Sadr, won the poll, held in May. Then, on June 10th, a warehouse in Baghdad containing a million ballots went up in flames. Firefighters claim to have saved most of them, but the equipment for counting the votes was destroyed.

Weary of the democratic process, Mr Sadr and his rivals are again readying their militias. An arms cache that exploded under a mosque in Mr Sadr’s Baghdad stronghold killed about 20 residents and brought his militia, Saraya Salam, onto the streets. “Certain parties are trying to drag Iraq into civil war,” he warned.

The fiercest rancour is between the Shia factions vying for the post of prime minister. Mr Sadr’s electoral bloc, Sairoun, seeks to wrest power from Dawa, a Shia Islamist party that has led the government since 2005. Dawa held the most seats in the outgoing parliament, but the electoral bloc of its leader, Nuri al-Maliki, a former prime minister, tied for fourth in the poll. Mr Maliki and his allies cried foul and said a new electronic-voting system made the poll easier to rig.

Mr Sadr blames Mr Maliki and his comrades for corruption and a costly sectarian war, which drained Iraq of oil wealth that might otherwise have been used for developing shantytowns where millions of Mr Sadr’s followers live. In 2016 the cleric’s supporters stormed Baghdad’s Green Zone, where the government has its offices. But if protests over the election lead to clashes, Saraya Salam would be a poor match for the better-armed militias backed by Iran. Their political arm, Fatah, came second in May. “Fighting among Shia groups would lead to the collapse of the political process,” says Muhanad Seloom of Britain’s Exeter University.

Iraqis hope their judges will stave off a constitutional crisis. On June 13th the top court upheld parliament’s order for a full recount. It is still considering calls to re-run the election or extend the term of the current prime minister, Haider al-Abadi, another Dawa stalwart. If it cannot decide by June 30th, the current parliament’s term will end and Iraq will have no parliament for the first time since 2005.

Western countries, prioritising stability, endorsed past Iraqi elections, in spite of accusations of fraud. But they are now less vocal, reflecting their declining troop presence, influence and, possibly, interest in Iraq. “We fear speaking out might only further destabilise the country,” says a Western diplomat in Baghdad. Some countries hoped that Mr Abadi, a known quantity, would hang on to the premiership. Behind the scenes and with remarkable unanimity diplomats from Iran, the West and Gulf countries have urged Iraq’s politicians to unite before the country implodes.

They have had some success. On June 12th Mr Sadr announced a new alliance with Hadi al-Amari, the leader of Fatah, at a meeting in the Shia holy city of Najaf. For now, at least, both are downplaying their differences. Mr Sadr has denounced Shia chauvinism, urged reconciliation with Sunnis and reached out to the region’s Sunni champion, Saudi Arabia, and its crown prince, Muhammad bin Salman. Mr Amari, by contrast, has spent much of his career in Shia Iran and says he answers to its leader, Ayatollah Ali Khamenei.

If the initial election results are upheld, Mr Sadr’s coalition would have 141 of the 165 seats needed to form a government. But a manual recount could take until September and a re-run might not be held until local elections in December. Meanwhile the need for a functioning government is growing. Iraqis are facing the worst electricity blackouts in years. Turkey’s new Ilisu dam threatens to cut off the Tigris river and cause water shortages in Iraq.

Confidence in the political system was already falling before the latest crisis. Only 44% of Iraqis voted, and only 35% of MPs elected in 2014 kept their seats. Damn democracy, say many Iraqis; if only we had a strongman again.