Attackers stormed the Iranian Parliament and the mausoleum of Grand Ayatollah Ruhollah Khomeini Tuesday, killing at least 12 in attacks on two hugely symbolic sites of both the revolution and the Islamic Republic.
The Persian Gulf has long endured threats from a number of Islamist terrorist groups, which have attacked a range of targets including the Grand Mosque in Mecca, Shia mosques across the region, and the Khobar Towers complex in Khobar, but Tuesday's attack is a first for Iran.
For Al Qaeda, the enemy was the West and other Muslims could help in this struggle. In contrast, for ISIS, Shia Muslims are a legitimate target and the growth in sectarian violence in Iraq has only served to fuel these differences.
For many rank and file ISIS members, the rafida -- the derogatory name for the Shia -- should have been struck in Iran much earlier, but it was the elders of the jihadi movement who urged leaders to focus upon different targets.
Security calculations are increasingly fused with political considerations across the Persian Gulf, shaping domestic politics and international relations.
Within these calculations, religion occupies a central role, affecting the two most serious threats to regional security: terrorism, and relations between the powerful six state Gulf Cooperation Council (GCC) -- which includes Saudi Arabia and the UAE -- and Iran.
Friends and enemies
The attack in Iran comes as tensions between members of the GCC have rapidly escalated, resulting in the most serious crisis to hit the Gulf since Iraq's invasion of Kuwait in 1991.
On Tuesday, the Saudi daily, Al-Riyad published an op-ed that argued that "If your friend deceives you, treat him as your enemy," reflecting the increasingly fractious tensions between Saudi Arabia and Qatar.
Following the alleged hacking of Qatar's national media website -- allegedly by Russian hackers
-- which revealed comments made by Sheikh Tamim about Iran and the need to normalize relations with the Lebanese military group Hezbollah, Saudi Arabia, the United Arab Emirates, Bahraini, and Egypt all withdrew their ambassadors from Qatar.
How members of GCC members engage with Islamist groups and Iran determines the nature of the organization and relations between its members.
The diplomatic spat between Qatar and the emerging Saudi-led bloc has developed as a consequence of Doha's relationships with both Iran and a number of Islamist groups.
The Muslim Brotherhood
, an 90-year-old religious and political group, has long been vocal opponents of regimes in Egypt and the UAE, and Qatar's support for -- and funding of -- the Brotherhood has been viewed with a great deal of suspicion across the region.
Prominent Hamas leaders, including Khalid Meshaal, have also sought safe haven in Doha and the Qataris have also attempted to facilitate dialogue between the Taliban and the US.
It is this relationship with Islamist groups -- and the Muslim Brotherhood in particular -- that has shaped Emirati and Egyptian antagonisms towards Qatar.
Iran biggest concern
Yet for Saudi Arabia, it is Qatar's approach towards Iran that is the most serious cause for concern.
Since the revolution of 1979, Riyadh and Tehran have become embroiled in a struggle to shape the Persian Gulf in their image, with religion a fig leaf to justify their activity in Iraq and Lebanon.
Since the Arab Uprisings, the two have become increasingly embroiled in proxy conflicts in Bahrain, Syria and Yemen, in addition to hostility in Iraq.
The attack in Iran seriously challenges Riyadh's allegation that Tehran is behind all acts of terrorism in the Middle East.
Of course, such a claim is not without substance. One only has to look at Iranian support for a number of groups across the region who have used terrorism as a tactic, including Hezballah, Hamas, the Assad regime -- states are complicit in terrorism too -- a range of Shia militias in Iraq, and for a long period, Al Qaeda.
The two have also drawn upon the support of regional allies, yet Doha's increasingly autonomous foreign policy agenda has been a cause of serious concern to Riyadh. It was this that caused the previous stand off between Saudi Arabia and Qatar in 2014.
In Qatar's support, Turkish President Recep Erdogan sent troops and food to Doha whilst strongly rejecting claims that the country had supported terrorism. There was also the suggestion that Iran may also provide food, which will fuel the suggestion about a burgeoning rapprochement between the two Gulf neighbors.
Of course, any further movement towards Iran will add to Qatar's isolation from the GCC and also the US, as President Donald Trump has been vocal in support for Saudi Arabia.
It appears that almost 40 years after the formation of the GCC, Saudi Arabia is increasingly of the opinion that its friend is deceiving them and that Qatar must be treated like an enemy.