Garvan Walshe is a former National and International Security Policy Adviser to the Conservative Party. He runs TRD Policy.

This is the Islamic Revolution’s Gerald Ratner moment. The mullahs’ rule is based on three articles of faith that time turned into lies: that Iran is a democracy; that the people who run it are holy men; and that Iran is besieged by enemies against whom an expensive military industrial complex must be maintained to ensure that Iran’s enemies are fighting “over there” in Lebanon, Syria and Iraq, not over here in Iran itself.

Qasem Soleimani led that the sharp end of that military industrial complex: the Revolutionary Guards (IRGC), established to protect the revolution from a regular Army considered loyal to the Shah, converted into a huge force that managed the proxy forces Iran used to build influence across the region, and fight an undeclared war against the United States, Saudi Arabia and Israel. His assassination was merely a spectacular coup in an ongoing conflict.

The downing of Ukrainian Airlines flight PS752 has become the most serious threat to the regime since the rigging of the presidential election in 2009 to give Mahmoud Ahmadinejad a second term in office.

It is a mistake to compare the death of Soleimani with a terrorist leader like Osama bin Laden or drug kingpin “El Chapo” Guzmán. They were in charge of autonomous organisations. Soleimani, for all his bravado, was the servant of of an institutionalised theocracy now entering its fifth decade. America’s public bragging about killing him may have required some equally spectacular revenge, but the Iranian system is too robust to be thrown off course by the removal of one general, however skilled.

Their “response” has been to plug the gap in the IRGC command structure, exploit his funeral for propaganda purposes, and otherwise continue to pursue what they see as Iranian interests. They tried to divert Iraqi anger, which had been mounting against Iran, towards the United States, but this was taking advantage of the backlash against the assassination to pursue the long-term goal of expelling US troops. The assassination also gave Iran cover to further breach the JCPOA nuclear deal, which had outlived its usefulness to them once the Trump Administration withdrew from it. These should not be understood as responses or retaliation, but the Iranians learning from the ancient American proverb: “if life gives you lemons, make lemonade.”

The fog of war has started to obscure the formal act of spectacular retaliation: the use of ballistic missiles (as opposed to rockets) to attack American bases in Iraq. One story has it that the Iranians warned the Iraqis who warned the United States about it hours in advance; another that the CIA had picked up intelligence, and dispersed a warning to troops in theatre; a third that the attack caught troops off-guard, giving them 15 minutes to wake up and run to the base’s bomb shelters.

Certainly, the narrative that Iran conducted an attack designed to avoid casualties, as though it were the IRA phoning in a coded warning to Waterloo train station, is too neat. Messages could be passed to the US, but how could they be sure, particularly in this administration, that they would be taken seriously? Is it wise to rely on a military bureaucracy to transmit the warning to the right place in time? (Answer: No) Even if a casualty-free attack had been the plan, it was a plan with a significant risk of going wrong, and provoking a spectacular counter-attack from the United States.

It was in this atmosphere that a jumpy air-defence commander gave the order to fire twice at the Ukrainian Airlines jet, killing all on board, and provoking the fateful cover-up by the authorities (the unfortunate man whose video first provided external evidence that a missile hit the plane has been taken in for questioning). The incident has now been tossed into the crucible of Iranian politics, a system where in December the regime killed 1,500 people protesting against the government.

Iran is twice divided: between the people and the regime establishment; and within the establishment between hardline and reformist factions, which the Supreme Leader must balance. His own politics are adamantine, but he has to allow reform some success as a safety valve, without yielding reformists so much power that they actually reform the system. The reformist president Hassan Rouhani has proved too weak, shifting opposition from within the system back out onto the streets.

Thus Rouhani’s call for a special inquiry into events surrounding the shooting down of the airliner (think of something more like a French-style investigating magistrate than a British public inquiry, because the presiding judge would have the power to put people in prison) both to exact revenge against the Revolutionary Guards, whom he accuses of jailing his brother, and sabotaging the nuclear détente which was to bring economic relief; and also to show the furious public the system can deliver if the “right people” are put in charge.

How far the inquiry will be allowed to go is a matter for the Supreme Leader. Restrict it too much, and it will be clocked for a whitewash. Allow it to do its work and it might take down too many of his own supporters.

This explains the apparently bizarre situation where the President and Foreign minister are accusing their own government of lying about the plane. The message they hope to send is that it’s not their part of the system that shot it down. But the message received is that the system has admitted it’s run by lying crooks who cover up murder. And it is when regimes admit their own lies that they are at their most fragile.