HISTORY repeats itself in Afghanistan, usually as tragedy. The aftermath of the second round of the presidential election held on June 14th eerily echoes events in 2009, when Hamid Karzai held on to the presidency amid allegations of “industrial-scale fraud”. On June 18th Abdullah Abdullah, a former foreign minister, and clear leader after the first round in April, accused Mr Karzai and the election commission of being in cahoots in a massive fraud, notably by stuffing ballot boxes.

Dr Abdullah made similar accusations in 2009, when he reluctantly withdrew from the second round. This time he has demanded vote-counting cease immediately, said he is cutting ties with election officials and ordered his observers to boycott the process. As in 2009, the stage is set for a spiteful stand-off.

Changes in the political landscape in Afghanistan and abroad, however, mean that this crisis may not fizzle out as fast as that in 2009. Dr Abdullah entered the run-off election against Ashraf Ghani, a former finance minister, having won 45% in the first round to Mr Ghani’s 32%. Turnout was initially estimated to be the same as in April, at 7m (though the first-round number was revised to 6.6m after more than 350,000 ballots were deemed fraudulent). The high second-round turnout was a surprise. Many observers thought that fewer people voted in Kabul and many other places than in April.

Whatever the case, millions of Afghans braved the threats of Taliban insurgents to have their say. The election commission reported 130 “security incidents” and the death of six of its staff on polling day. Grotesquely, 11 elderly men in Herat in the west had fingers cut off as punishment for voting. Official preliminary results are expected to be announced, in stages, any day now. But Dr Abdullah is getting his retaliation in first. He alleges a surge of votes in the country’s eastern and south-eastern provinces, the power base of Mr Ghani, who is a Pushtun, a member of the country’s largest ethnic group.

These are the areas where, in 2009, the biggest frauds were uncovered; the election commission discarded more than 1m votes as dodgy. This time, in Khost, a province racked by insecurity, some 400,000 votes were cast, according to officials from both camps, compared with just 113,000 in the first round. Dr Abdullah claims a similar tripling of votes in surrounding provinces—all for Mr Ghani. He again blames Mr Karzai and his cosy ties to the election commission for the alleged fraud. He does not trust it to be detected by the counting process, which this time is without foreign oversight.

“Everyone assumed there would be fraud but these examples in the east are worrying,” says a diplomat, adding that Western donors may be partly to blame by insisting on at least one polling-booth for women at each voting centre. Many of these may have been used to cheat.

The West must shoulder some of the blame in other ways, too. The 2009 presidential poll and corrupted parliamentary elections in 2010 highlighted to international donors, who have financed each of Afghanistan’s elections, the need for a proper voter-registration list. No one knows how many voters (or indeed people) there are in any of the country’s 34 provinces. As many as 20m voter-identity cards are floating around, traded like football stickers or sold to the highest bidder. Diplomats and proposals for a registration system have come, diplomats and proposals have gone. Nothing was done, so this election was fought using the same fraud-riddled tools as before.

This time, though, the stakes are higher. Foreign troops are almost all due to depart by the end of 2016 and will take much commercial activity with them. The West’s patience with Afghan corruption has worn thin and yet another tainted election could imperil some of the aid the country needs. And who knows how Dr Abdullah, whose team includes an array of former warlords and militia leaders, will behave now he feels cheated again?

A protracted battle to sort out the election is yet another unwanted problem. Donors were hoping for a smooth transition to a new president by August 2nd. That might be delayed, jeopardising a September deadline for a security pact with America that will keep a modest foreign-troop presence after the end of this year. “We will need to accept a slower process if we are to avoid an acrimonious process,” a diplomat said this week, calling for “a balance between speed and thoroughness, because the thing that Afghanistan doesn’t have is time.” Given past form it is much more likely to be slow, slapdash and perilous.