At least 12 people have been killed and dozens injured in twin attacks in Tehran on the Iranian parliament and Ayatollah Ruhollah Khomeini's shrine.
The attacks, which drew worldwide condemnation including from the United States, were claimed by the extremist group Islamic State (IS), which released a video purporting to show gunmen inside the parliament building.
It is the first time the Sunni militant organization has claimed responsibility for an attack in tightly controlled Shi’ite-majority Iran.
Supreme Leader Ayatollah Ali Khamenei called the attacks mere "firecrackers" that would have no effect on the Iranian people.
President Hassan Rohani said the attacks would make Iran more united.
"Today's terrorist attacks in Tehran will make the Islamic Republic of Iran more determined in the fight against regional terrorism, extremism, and violence," Rohani said in a statement published on the ISNA news agency.
"Iran's message as always is that terrorism is a global problem, and unity to fight extremism, violence, and terrorism with regional and international cooperation is the most important need of today's world," Rohani said in a statement.
Iran's powerful Islamic Revolutionary Guards Corps (IRGC) accused the United States and Saudi Arabia of being behind the action and vowed revenge.
"This terrorist attack occurred only a week after the meeting between the U.S. president and the [Saudi] backward leaders who support terrorists. The fact that Islamic State has claimed responsibility proves that they were involved in the barbaric attack," an IRGC statement said, adding that the "spilled blood of the innocent will not remain unavenged."
Separately, the deputy chief of the IRGC's Intelligence Service, Mohammad Hossein Nejat, told the Fars news agency that the men who attacked the parliament building in Tehran were aged between 20 and 25.
"[They] went to the parliament as visitors. The guards became suspicious of their bags and when they wanted to search them, shooting began and they killed the security guard," he said. "The U.S. and Saudi regimes had ordered their stooges to do this."
PHOTO GALLERY: Terror In Tehran (CLICK PHOTO TO OPEN)
The head of Iran's emergency department, Pir Hossein Kolivand, said 43 people were also wounded in the attacks. It is not clear whether the attackers were included in the death toll.
Islamic State has regularly threatened Iran, one of the countries involved in the fight against the militants’ forces in neighboring Iraq and in Syria.
The attacks occurred after Saudi Arabia and other Sunni powers cut ties with Qatar on June 5, accusing it of backing Tehran and militant groups.
The attacks began midmorning, when officials said assailants dressed as women and armed with Kalashnikov rifles entered the parliament building through the main entrance.
"One of them was shot dead and another one detonated his suicide vest," Deputy Interior Minister Mohammad Hossein Zolfaghari said, according to the semiofficial Tasnim news agency.
After an hourslong siege that ended with four attackers dead, Iranian media reported that the assault on the parliament building was over.
There were earlier reports of a hostage situation.
WATCH: Iran's Parliament Speaker Calls Attack 'Minor Issue'
The situation was also calm at Khomeini’s mausoleum in southern Tehran, which had been targeted by a suicide bomber and other assailants.
"After the attack in the mausoleum of Ayatollah Khomeini, five suspects were arrested by the police. … They are under investigation," Tehran police chief Hossein Sajedinia was quoted as saying by ISNA news agency.
One assailant detonated a suicide vest, another was killed by security forces, and the rest of the attackers were arrested, Tehran Governor Hossein Hashemi was quoted as saying by state broadcaster IRIB.
The two attacks occurred at about the same time and appeared to be coordinated, reports said.
Iran's Intelligence Ministry said the attacks were carried out by "terrorist groups."
"Members of a third group were arrested before being able to carry out any attack," state TV quoted the ministry as also saying.
The speaker of Iran's parliament, Ali Larijani, said the "coward terrorists...were seriously confronted," according to the state-run IRNA news agency.
"This is a minor issue but reveals that the terrorists pursue troublemaking," Larijani added.
The attacks come less than a month after Rohani, a relative moderate in a country where ultimate power is held by Supreme Leader Ayatollah Ali Khamenei, convincingly won a second term in a May 19 election.
The attacks drew international condemnation, including from the United States, who accuses Iran itself of fomenting unrest across the Middle East and of backing terrorism.
"We grieve and pray for the innocent victims of the terrorist attacks in Iran, and for the Iranian people, who are going through such challenging times," the White House said in a statement.
"We underscore that states that sponsor terrorism risk falling victim to the evil they promote," the statement added.
U.S. President Donald Trump has accused Iran of fueling "the fires of sectarian conflict and terror" and called for its international isolation during a visit to Saudi Arabia last month.
Separately, the State Department also condemned the June 7 attacks in Tehran, saying that "terrorism has no place in a peaceful, civilized world."
Eliot Engel, the senior Democrat on the House of Representatives' Foreign Affairs Committee, condemned the attacks, saying in a statement that "terrorism can never be tolerated, no matter where it takes place."
"America's quarrel is not with the people of Iran but with the Iranian regime," Engel said, adding that he hopes Iranian leaders "understand the cost that they are inflicting on other countries as a sponsor of terrorism."
UN Secretary-General Antonio Guterres condemned the attack and voiced hope that "those responsible for this unjustifiable violence will be swiftly brought to justice," UN spokesman Stephane Dujarric told reporters.
"This is obviously a very sad day again," EU foreign policy chief Federica Mogherini said. "For us, any time when there's a terrorist attack anywhere in the world, this is something we follow closely."
European Parliament President Antonio Tajani wrote on Twitter: "I stand in solidarity with the President of [the] Iranian Parliament and the Iranian people."
Iran's allies Syria and Russia also condemned the attacks, with the Kremlin saying "the continuation of a series of terror attacks again underlines the need for coordinated actions in the fight against terror and IS."
France's Foreign Ministry also “strongly condemned” the attacks, while German Foreign Minister Sigmar Gabriel said "once again unscrupulous criminals have dragged many innocent people to their death."