Tehran has bragged for years that Islamic State could not deeply penetrate inside Iran, saying it kept a chokehold on any IS roots by arresting possible suspects and monitoring movements along its borders.
But Wednesday's attacks, claimed by IS, on Iran's parliament and the shrine of Ayatollah Ruhollah Khomeini that left at least 12 people dead, exposed Iran's vulnerability, analysts say. It shows, too, that IS will follow through on its threats to terrorize Iran, which it sees as a battlefield enemy and religious persecutor.
IS has long accused Shiite-led Iran of executing thousands of the Sunni minority in the country.
Iraq's Iran-backed Shiite paramilitary force has inflicted hundreds of casualties on IS and driven IS from land outside Mosul. In Syria, Iran has been a major military backer of the Syrian regime, first in its war with rebel groups across the country and later against IS.
Combat troops in Syria
About 10,000 Iranian combat troops are in Syria fighting alongside thousands of fighters from Hezbollah, Lebanon's Tehran-affiliated Shiite militia, and assorted Shiite militias made up of renegade Pakistanis, central Asians and other nationalities.
"With its direct involvement in fighting IS in Iraq and Syria, a retaliation from IS shouldn't be a surprise to authorities in Iran," said Alex Vatanka, a senior analyst at the Washington-based Middle East Institute.
Iran intelligence has boasted about layers of security applied by agents protecting the country from IS infiltrations. Several times in recent months, Iranian officials have spoken about breaking up IS-related terror cells and arresting IS-affiliated militants planning attacks inside Iran.
"We have built a complicated network of security nets from Karbala all the way to Tehran that allows us to trace every single move of Daesh [IS]," Hojatoleslam Toyserkani, representative of Iran's supreme leader to the Basij paramilitary forces, said last week.
Until Wednesday, the alleged security veneer seemed intact even though officials' claims of the public's protection from IS lacked many details, including when alleged incidents took place, the identity of most suspects, and concrete links to IS.
"Iranian authorities were good in preventing IS from conducting operations inside Iran, but this attack put a crack on the bubble of invincibility Tehran tried hard to project," analyst Vatanka said.
Wednesday's twin synchronized attacks on two of the most visible and secure sites in the capital were intended by IS to put Tehran on notice, analysts said.
Video of attack
IS-affiliated Amaq social media released a video allegedly showing the attacker storming a parliament office, shooting at staff and shouting IS slogans in Arabic.
"IS wants to send a message that despite all security measures, they can conduct attacks and tarnish Iran's intelligence reputation," Karim Pourhamzavi, an extremism analyst at Macquarie University in Sydney, told VOA.
In March, IS issued a video threatening Iran and promising to conquer the country soon. The 36-minute Persian-language clip was narrated and hosted by several Persian speakers with heavy Baloch accents.
The speakers allege that more than 18,000 Iranian Sunnis have been executed since the 1979 Islamic Revolution. One of the speakers urges Sunnis to join the group "to defend their dignity and regain the pride taken away by Iranian Shia authorities."
But several opinion polls have shown little Sunni interest in joining IS.
Still, Wednesday's attack had people in Tehran wondering if IS has more support than Iran leaders let on. It marks the first time the Sunni Muslim group admitted it staged an attack in the majority Shiite Muslim country.
"The timing of the attack and good knowledge about the entrances of parliament are hints that may make us think that they had insiders or having access to some precise information before conducting the attack," said Mohammad Ghorbani, a Tehran-based reporter who covers terrorism issues.
Presence likely to grow
Still, in the long run, some analysts think it's doubtful IS will forge a deeper presence in Iran.
"IS have always conducted attacks inside countries using local agents and supporters," Emad Abshenasan, a Tehran-based extremism analyst, told VOA. "IS has no base in Iran, and even its minority Sunni population do not favor or support IS or its ideology."
But by getting more involved in conflicts in Yemen, Syria and Iraq, Tehran is exposing itself more to possible terror at home, analysts said.
"As Tehran deepens its engrossment in regional conflicts and into affairs of the Arab world, it makes itself more susceptible to these kinds of attacks partially, directly, or indirectly supported or directed by its contenders in the region," analyst Vatanka said.