Iran attacks will boost IS morale and trigger calls for revenge
Iran has been at the top of so-called Islamic State's target list for a number of years.
Despite appearing to be a more vulnerable target than European countries and the United States because of its proximity to territory controlled by the jihadist group, Iran had until Wednesday been able to prevent an attack within its borders.
In May 2016, the Iranian authorities announced that they had dismantled 20 terrorist cells and foiled a plot involving 50 different targets throughout the country.
Such operations were the result of an extensive counter-terrorism programme.
Iran also launched an anti-IS messaging campaign, sought to contain the conflict with IS inside Syria and Iraq to stop it reaching Iranian borders, engaged with various political and religious groups, and carried out extensive intelligence operations.
Iran also has a relatively strong and stable state, with notoriously effective security services.
The goal has been to undermine IS and its ideology, while working to prevent attacks on Iranian soil.
But given that Iran was a major target, it was unlikely to escape attacks completely.
Today, IS militants are facing a losing battle in Iraq and are retreating in Syria.
One consequence of this has been a greater focus on carrying out attacks outside those two countries.
In the past few months, the group has upped its anti-Iran propaganda, and aimed to recruit from the country's Sunni minority community.
Wednesday's attack will therefore significantly boost IS morale, particularly as it is the first to have been carried out in Iran - the region's biggest Shia country and a relatively stable one at that.
In Iran, there will be calls for revenge - especially amongst hardliners - making it more difficult for President Hassan Rouhani's administration to reduce the country's involvement in Iraq and Syria.
The attack will also increase public support for the Revolutionary Guards, who are viewed as the protectors of the country, and for Iran's efforts to combat IS, as happened when the jihadist group seized large swathes of territory in Iraq in 2014.
However, Iran is already extensively involved in both Iraq and Syria, and does not have unlimited resources to spare.
In addition, Iran's involvement in Syria is not popular. Rather, it is viewed as a costly endeavour that has not benefitted the country much and resulted in far too many Iranian deaths.
Dina Esfandiary is a Centre for Science and Security Studies (CSSS) Fellow in the War Studies Department at King's College London, and an Adjunct Fellow (non-resident) in the Middle East Programme at the Centre for Strategic and International Studies (CSIS).