FOUR years ago the re-election of Iran’s president, Mahmoud Ahmadinejad, which millions considered fraudulent and led to months of violent protest, marked the elimination of the country’s reformists at the hands of their hard-line rivals. Now a new and equally bitter struggle is in full cry—between two different types of hardliner, fighting over an Islamic Republic that has been sapped by international sanctions. Less than two months before the presidential poll, the contest resembles nothing so much as a game of chicken.

In the middle of the road stand Mr Ahmadinejad, the outgoing president, with his presumed dauphin: the suave, ambitious Esfandiar Rahim Mashaei. The two men are almost family; the president’s son is married to Mr Mashaei’s daughter. They also share apparently limitless reserves of self-confidence, disdain for the revolutionary old guard of crusty clerics, and a yen for millenarian Shiism (see article) that traditionalists see as almost heretical.

The approaching juggernaut is manned by these same traditionalists. They long to be rid of Mr Ahmadinejad and fear that he intends to stay in charge after manoeuvring his nominee into the presidential palace. So, they are doing everything they can to stop Mr Mashaei from standing. They threaten him with disqualification by a vetting body, prepare legal cases against him and his other allies, and damn him as a fraud and as a “friend of sedition”.

The president and his ally seem unfazed. They were recently out pressing the flesh in the northern province of Semnan, where the president, with Mr Mashaei in attendance, boasted of the warm reception he had received at the funeral of his old Venezuelan friend, Hugo Chávez, and promised an adoring crowd more of the financial largesse he has spent the past eight years doling out. To the ayatollahs and their placemen in the Revolutionary Guard, the subversions of Mr Ahmadinejad and his friend Mr Mashaei are even more sinister than those of the reformists—because they come from within. On his trip to Venezuela, Mr Ahmadinejad was photographed giving an unIslamic hug to Mr Chávez’s grieving mother. Mr Mashaei seems to enjoy nationalist poetry more than the Koran. Their camp has adopted a slogan, “Long Live Spring”, that brings to mind the Arab uprisings of 2011.

The president is trying to make it hard for the Council of Guardians, a body of clerics and lay jurists which weeds out undesirable candidates, to disqualify Mr Mashaei after the formal registration of candidates starts next month. Mr Ahmadinejad trumpets his support for “the people” against a small group who “think they own the country”. And he is not without ammunition of his own.

In February Mr Ahmadinejad caused a sensation by airing secretly filmed video footage accusing a member of the powerful Larijani family, which fiercely opposes the president, of corruption. Mr Ahmadinejad hints that he has more dirt to dish, perhaps even spattering the hem of the supreme leader, Ayatollah Ali Khamenei, one of whose sons is reputed to have accumulated exceptional wealth and influence.

The president seems to feel no debt of gratitude to the supreme leader for supporting him during the unrest of 2009. For his part, the supreme leader does not disguise his distaste for Mr Mashaei. But Mr Khamenei needs the president’s co-operation if the election is to have the international impact he desires, demonstrating the regime’s continuing vitality in the face of sanctions. And he has said that “all hues” should be represented on polling day, a prescription that Mr Ahmadinejad likes quoting back at him.

What, then, if the guardians’ council goes ahead and disqualifies Mr Mashaei, leaving the field to the other declared and expected candidates, including a former head of the Revolutionary Guard, the country’s foreign minister and several high-profile conservatives? Mr Ahmadinejad could raise the stakes and refuse to stage the poll. That was the eventuality raised last month by a prominent general in the Revolutionary Guard, who described the “sedition” faced by the country as “deeper and wider” even than that of four years ago.

Even if the elections pass off relatively smoothly, whoever replaces Mr Ahmadinejad will inherit daunting problems caused by sanctions. Oil sales are down by half, year on year, and car production has similarly declined. The economy is in recession, shrinking perhaps by as much as 4% in the past year. Inflation is running at over 30%. The rial has lost about half its value against the dollar. According to a joke doing the rounds, it is now considered the acme of prosperity to drive a Kia Pride, once considered a poor man’s car, while eating pistachios—the new caviar.

The United States and its allies hope that the smiles will eventually turn to anger, forcing Mr Khamenei to change his nuclear course. Indeed, from the middle class, which led the unrest four years ago, to the president’s poorer fans, Iranians of all stripes seemed united in hoping for the most recent round of nuclear negotiations, held earlier this month between Iran and the UN Security Council’s five permanent members plus Germany, to yield a breakthrough. Anything, the owner of one small food shop remarked, to “get the exchange rate down and people spending again”.

But that did not happen, and even if negotiations have not broken down, the gap between the light touch on the brakes that Iran may be prepared to apply to its uranium enrichment and the very limited lifting of sanctions the West is offering as an incentive, seems unbridgeable. On April 9th Iran displayed further defiance of the West by announcing more uranium mining and processing. On a visit to Israel, John Kerry, the American secretary of state, bleakly warned the Iranians not to expect “open-ended, endless negotiation”.

And yet a continuation of the stalemate is what many Iranians fear, with their country becoming still more isolated. Even stalwarts of the regime are embarrassed that, in international forums such as the UN’s Human Rights Council, Iran enjoys solid support only from North Korea and Venezuela. Most European airlines (KLM is the latest) have cancelled their Tehran services, while the brain drain of young Iranians continues. At least, quips one young man, the gradual exodus of the country’s 400-year-old Armenian community is fostering self-sufficiency; having relied on the Armenians for bootleg alcohol, Tehrani tipplers have learned to make beer and arak themselves.

The presidential poll thus presages danger—and an opportunity. Some dare to hope for a revival of the reformists in the person of a former president, Muhammad Khatami, whose tenure is now remembered as a halcyon period of tolerance and prosperity. On April 15th the mother of a boy who was killed after being arrested in 2009 issued a plea for Mr Khatami to stand again, so that “our dear Iran might be saved”. But few were betting on his candidacy being put forward—or being accepted by the guardians’ council.