The attacks by Islamic State in Tehran on 7 June, apparently perpetrated by two groups of four terrorists, cost 12 or more innocent lives. Forty or more were wounded and at a number of points (the attack on parliament, pictures of children escaping the scene) they echoed recent attacks in Europe and the UK. The scenes were similar enough on a human level to prompt recognition of the fear felt. Isis claimed responsibility, and there is no reason to doubt this, although it’s possible some aspect of the attacks may have been facilitated by dissident groups.

Isis has recently escalated its propaganda against Iran, lashing out as its position in the fighting in Mosul and in Syria has deteriorated. The forces that have beaten Isis back, along with western-backed elements, have substantially been fighters backed by Iran’s Revolutionary Guard – Shia militia and others. Iran’s fight with Isis is essential and inescapable; Isis has a visceral hatred of Shias, at least as great and probably greater than its hatred of the west, and the areas where Isis has tried to establish its ugly caliphate are squarely on Iran’s doorstep – not on our’s.

Saudi Arabia stroked Trump's ego. Now he is doing their bidding with Qatar | Mohamad Bazzi Read more

The attacks also come after an intensification of the level of rivalry between Iran and Saudi Arabia in the Persian Gulf region. Contributing to this was President Donald Trump’s visit to Riyadh, where he waggled a sword, and set aside his previous hostility to praise Saudi Arabia, welcome big new arms deals, and please his hosts by repeating Saudi condemnations of Iran. More recently, Saudi Arabia has cut relations with Qatar (and, it seems, road and air access), for mixed reasons that include displeasure at the Qatari stance towards Iran.

Whatever we may think about Iranian democracy and its many real shortcomings, their parliament was a target for Isis, which suggests their Isis enemies, at least, take that aspect of the Islamic republic seriously. Iran is an Islamic republic, and the bombers attacked symbols of the two main features of the constitution – the Islamic principle (Khomeini’s tomb) and the principle of popular representation (parliament).

Those two principles have often been in conflict, and the Islamic republic as it is today has many faults, which we cannot and should not ignore. But we need to see Iran as it is, not as its rivals and enemies in the region would have us see it, for their own purposes. Despite the manipulation of candidate lists that took place before President Hassan Rouhani’s recent re-election and other problems with the process (there were commentators in the US who dismissed the whole thing as an empty show), there was a 74% turnout and Rouhani got 57% of the vote.

Rouhani is a moderate – it would be painfully foolish for western governments to snub him or make his job more difficult

Rouhani is a moderate, a pragmatist, and he argued in his campaign for better relations between Iran and the west, and Iran’s neighbours, against Revolutionary Guard hardliners and other regime diehards. It would be painfully foolish for any western governments to snub him or make his job more difficult. In many respects, and especially in fighting Isis, Iran’s position in the Middle East makes it a natural ally of the UK, the US and the west. The achievement of the nuclear deal, in Rouhani’s first presidential term, after many long years of effort and struggle, was a marker of that, and of the possibility of further improvements in relations with Iran.

The Tehran attacks are a pointer in the same direction. The sectarian rivalry between Saudi Arabia and Iran, exaggerated by the paranoia and domestic insecurity of Saudi Arabia and some other Gulf Cooperation Council states, and to some extent by past and present Iranian rhetoric, is not our fight, and we should scrupulously avoid taking sides in it.

In Britain, we urgently need the Foreign Office to reassert foreign policy against the Treasury–inspired prosperity agenda in the Persian Gulf region, which has made us align ourselves too closely with Saudi Arabia and accept too uncritically its interpretation of motivations and events. With the intensification of Isis-inspired terrorism in the UK, and renewed political talk of the need to tackle with more toughness the origins of terrorism, that misguided policy is looking increasingly untenable anyway. And we need to argue strongly, with others in the EU, for the US to do the same.