The attacks in Tehran against the parliament building and the enormous Imam Khomeini shrine were shocking but also just the latest in a series of ISIS-inspired or claimed attacks conducted during Ramadan. At first glance it would be easy to draw a causal link between the attack and the increased anti-Iran rhetoric coming out of Riyadh. But Iran has had an ISIS problem for some time now, and another plot to attack Iranian targets, including in Tehran, was thwarted last Ramadan. The size of Iran's problem may not have been widely recognised in the West.

One of the main justifications for Iranian military support for the Iraqi and Syrian governments was the classic ‘better to fight them there than fight them here’, and these attacks will have reinforced that strategic rationale among Iranians. The shocking nature of the attacks, evidenced in raw footage broadcast on state TV, of the terrorists entering the public entrance of the parliamentary building, will have been compelling evidence for many Iranians.

Much of the Iranian intelligence community’s focus on the ISIS threat has centred on Kermanshah Province, which borders Iraq and acts as the main infiltration route for ISIS into Iran. Last September it was reported that the Iranian ISIS leader was killed there, and there have been regular reports of counter-ISIS operations in that province.

In the current tense regional environment, with accusations of state support for terrorism being thrown around with abandon, it is difficult to separate the issues of domestic terrorism from state rivalries. Although it appears that the attackers were Iranian citizens, if it turns out that they were from among Iran’s minority Arab population, then conspiracy theories about state sponsorship will likely follow. Already Iran’s Revolutionary Guard Corps has pointed the finger at Saudi Arabia as bearing some responsibility for the attack, an accusation denied by Riyadh. And while the US State Department expressed condolences to the people of Iran over the attack, the churlish statement from the White House in which President Trump effectively said Iran had it coming was described by Iran's foreign minister as ‘repugnant’. Even amid tragedy the Trump Administration finds a way of exacerbating, rather than ameliorating, tensions.

Besides some additional tightening of domestic security procedures and a likely re-focusing of intelligence efforts in its border provinces, there is little more Iran can do domestically, given Tehran has long been aware of the scale of the ISIS threat. Questions will be asked as to how this plot was successful when others weren’t, but that will be for those conducting an internal review.

The more intriguing question will be the degree to which Tehran looks to respond internationally. Will the attack prompt a greater direct role by Iranian or Iranian-backed forces against ISIS targets in Iraq and Syria? Or will the belief among the more conspiratorially-minded elements that there was a hidden hand in the attack prompt a response targeted at the interests of regional states? That's a discussion likely being held in Tehran right now. The outcome will influence whether this attack against symbols of the Iranian state has echoes outside Iran.