IS has taken responsibility for the attacks, which would be the first time the Sunni-based group has attacked the predominantly Shiite country.
The group had posted a video in March warning it would, as it phrased it, "conquer and restore" Iran.
Scores of people fled the parliament in Iran's capital, Tehran, after four armed men began shooting inside the building.
The four men were dressed as women when they stormed the parliament, with one of the attackers detonating an apparent suicide vest soon after entering the building.
A nearby store worker has described the events that unfolded.
"There was the noise of gunshots between 10:30 and 12. I saw six or seven people were carried out of the parliament building. The attackers once walked out of the parliament door to shoot people and then went back into the building. When they were shooting at people, we just lay down here."
A second group of attackers stormed the mausoleum of the Ayatollah Khomeini.
One of the three attackers detonated an explosive belt, another was shot dead by security, and the third - a female - was arrested after sustaining injuries.
A witness at that attack says the first man detonated his belt because the group could not escape the guards.
"Conflict started between them and the shrine's guards, then the attackers ran away. As they were escaping, one blew himself up because he could not run away."
Ayatollah Khomeini was the revered founder of Iran's Islamic republic, and the shrine is a hotspot for tourists and religious pilgrims.
IS has taken responsibility for the attacks and published a 24-second video from inside the parliament siege that one of the attackers filmed.
It is the first time IS has targerted Iran, although the group had threatened to, as it put it, "restore" the country in a Farsi-language video posted in March.
Iran's supreme leader, Ayatollah Ali Khamenei, has played down the latest attack, despite two of the country's most potent symbols coming under fire.
"The firecracker play that took place today will have no effect on the people's will. However, these incidents prove that, if the Islamic Republic had not resisted at the epicentre of these seditions, in Iraq and Syria, we would be dealing with many troubles caused by them inside the country now."
The Islamic Revolutionary Guard Corps has released a statement to local media blaming Saudi Arabia for the attacks.
It says the attacks happened a week after United States and Saudi officials met, and the IS involvement proves the two countries were involved.
Saudi foreign minister Adel Al-Jubeir, speaking in Berlin, says he does not know who was responsible and there is no evidence Saudi Arabia was involved.
US president Donald Trump has released a statement expressing his sympathy for the victims, but he also issued a warning that Iran was being repaid for promoting evil.
He said countries that sponsor terrorism risk falling victim to it.
Iran's Intelligence Ministry has confirmed it stopped a third group that planned another attack in Tehran.
Share
