Iranian police outside the parliament building in central Tehran. Photograph: (Reuters)
Iran's elite Revolutionary Guards on Wednesday said the United States and Saudi Arabia were "involved" in the twin attacks Iran's parliament complex and the shrine of its revolutionary leader.
"The Revolutionary Guards have always proven that they will never allow the blood of innocents to be spilt without revenge," they said in a statement.
"This terrorist action, coming one week after the meeting of the president of the United States with the leader of one of the region's reactionary governments (Saudi Arabia)... shows they are involved in this savage action."
The United States condemned "terrorist" attacks in Iran that killed 12 people.
"The depravity of terrorism has no place in a peaceful, civilized world," State Department spokeswoman Heather Nauert said.
US President Donald Trump expressed sympathy for the victims of a terror attack in Iran, but issued a barbed warning that the country was reaping what it sowed.
"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," Trump said in a brief statement.
"We underscore that states that sponsor terrorism risk falling victim to the evil they promote."
Twelve people were killed and 39 injured in twin attacks claimed by the Islamic State group on Wednesday, its emergency services chief said.
Dozens of people were wounded in the attacks, which ended after a standoff lasting several hours as the gunmen holed up in parliamentary office buildings.
Iranian media said all four terrorists were killed and that the siege was over.
A security guard was killed when gunmen burst into Tehran's parliament complex, while a gardener was killed when armed assailants entered the grounds of Khomeini's mausoleum in the south of the city, the ISNA news agency reported.
Lawmaker Elias Hazrati said three assailants, one with a pistol and two with AK-47 assault rifles, raided parliament, according to the state television website.
Attackers raided Iran's Parliament and set off a suicide bomb at the Mausoleum of Ayatollah Khomeini in Tehran on Wednesday, killing at least five people (WION)
ISNA news agency quoted a member of the parliament as saying that all the parliament doors were shut and one of the assailants was surrounded by the security forces.
One member of parliament told state broadcaster IRIB that there were four gunmen inside the parliamentary complex in central Tehran, armed with rifles and a pistol.
In a separate incident, an armed man opened fire at the mausoleum of Ayatollah Khomeini and wounded a number of people, the semi-official Fars news agency reported.
ISNA quoted an unnamed source saying that the attacker at the mausoleum had blown himself up.
"Fighters from the Islamic State attacked the Khomeini mausoleum and the parliament building in Tehran," the agency said, citing a "security source".
Saurabh Kumar, Indian envoy to Iran has said no Indian has been harmed in the attacks.
Ayatollah Ruhollah Khomeini launched the Islamic revolution in 1979.
(WION with Agency inputs)