At the height of the Iran-Iraq war in the 1980s, Ayatollah Ruhollah Khomeini told his countrymen that the Islamic regime’s survival came before prayer and fasting.
The comments of the then supreme leader, who spearheaded the 1979 Islamic revolution, underscored a pragmatism that has shaped the regime’s thinking for nearly four decades: do whatever is required to ensure the theocratic system endures even if that means compromising on core principles.
Last week’s presidential election was, in many ways, a case in point.
The winner, President Hassan Rouhani, is a regime insider and consummate pragmatist. A former top security official, he has re-modelled himself as a champion of reform and was swept to a landslide victory on promises of opening up to the west and allowing more social freedoms.
His opponent, Ebrahim Raisi, was thought to have enjoyed the backing of the Revolutionary Guards, the judiciary and the clergy — powerful hardline forces at the regime’s heart. There was also speculation that he was the favoured candidate of Ayatollah Ali Khamenei, the current supreme leader, who made thinly veiled attacks on Mr Rouhani’s record.
Combined with the increasingly muscular presence of hardliners at Raisi rallies, this sparked nervousness among reformers about whether the regime would allow a Rouhani victory. Reformers have remembered all too well the disputed 2009 election that brought Mahmoud Ahmadi-Nejad, the hardline populist, to power and triggered mass protests.
But last week, two days before votes were cast, Mr Khamenei delivered a statement that was viewed as an effort to allay those fears and send a message to hardliners that the result must be respected — even if their camp had to endure a humiliating loss.
Mr Khamenei wanted to avoid any repeat of the 2009 protests — the biggest threat to the regime since 1979. Holding a successful election is deemed critical to showcasing the regime’s legitimacy. And Mr Khamenei would have been all too aware that the vote was taking place as US President Donald Trump prepared to embrace Tehran’s two regional enemies, Saudi Arabia and Israel.
The imagery was telling. While Mr Trump unleashed a storm of anti-Iran rhetoric, millions of Iranians danced and sang in cities across the country celebrating Mr Rouhani’s victory — scenes that would have been anathema to Saudi Arabia and other Gulf monarchies. The crowds lauded the 2015 nuclear deal, while gushing about the potential for reform and their desires for Iran to engage with the outside world.
But does Iranian pragmatism mean Mr Rouhani will be able — and willing — to deliver on his promises?
He struck the nuclear deal with the US and five other powers because the regime’s leadership deemed it to be in the national interest. It staved off an economic collapse caused by Mr Ahmadi-Nejad’s populist polices and tightening sanctions. Iranian security chiefs were also appeased because it meant they finally got their hands on a Russian S-300 air defence system, the delivery of which was delayed for years because of western pressure.
Mr Rouhani will be entering his second term with a strong popular mandate to meet the aspirations of a young and urbanised population. But the margin of his victory — he won 57 per cent to Mr Raisi’s 38.5 per cent — may also hinder him. The sting of defeat is likely to stiffen hardliners’ resistance to reforms.
The republic can also shift from one extreme to the other. Mohammad Khatami was the first “reformist” president to shake the system. But his two terms were followed by Mr Ahmadi-Nejad’s disastrous presidency.
There are also questions as to whether Mr Rouhani, now favourably positioned for the eventual succession to Mr Khamenei, 77, will be willing to fight for the agenda he championed.
With ultimate power resting with Mr Khamenei, there is unlikely to be any radical shift at least until a new supreme leader takes the reins.
Get alerts on Middle Eastern politics & society when a new story is published