TEHRAN, Iran _ A suicide bomber detonated explosives inside a popular shrine and a suspect blew himself up after a siege inside Iran's parliament building in near-simultaneous attacks in Tehran on Wednesday that left 12 people dead and more than 42 injured.
The militant group the Islamic State claimed responsibility via its Amaq news agency, saying the two attacks were carried out by "martyrdom-seeking fighters with two explosive vests inside the Khomeini shrine in the center of Tehran."
Parliament was in session at mid-morning when assailants, armed with Kalashnikov rifles and explosives, stormed the building. Deputy Interior Minister Mohammad Hossein Zolfaghari said the attackers gained entry dressed as women.
Even as that attack was underway, gunmen and suicide bombers attacked the shrine of Ayatollah Ruhollah Khomeini, a venerated gathering spot for Shiite faithful on the southern edge of Tehran.
Of the eight attackers, six were killed, two arrested, according to state-run Fars news agency.
The Islamic State has clashed with Iranian-backed militias in Iraq and Syria, but Wednesday's attack marked the first time the group has struck deep in the heart of the world's most powerful Shiite state.
The group later released a graphic video of the attack, with a narration: "Do you think we will go away? We are here to stay, God willing," it said.
Iran's powerful Islamic Revolutionary Guard Corps implied Saudi Arabia and the U.S., which have stepped up their alliance against Iran and its fledgling nuclear ambitions, were behind the attacks.
"These attacks happened one week after the joint meeting of the American president and one of the reactionary rulers of the region, which was sponsoring apostate Muslim terrorists," Iran's chief military force said in a statement that appeared to refer to Saudi Arabia.
It called the timing of the assaults "a meaningful coincidence," and said Islamic State's claim was further evidence that "the American president and the reactionary ruler are involved in this brutality."
The siege at parliament lasted about three hours, and it appeared that not all lawmakers were aware of the extent of the violence at first.
Heshmatollah Falahatpishe, a member of parliament, said lawmakers realized something was amiss at about 10:15 a.m.
"We were holding a regular open session on the floor. Suddenly, a couple of our fellow MPs arrived inside and one of them had bloodstains on his clothes and said, 'Daesh has attacked,'" Falahatpishe said, referring to a common Arabic acronym for the Islamic State. "We continued reviewing and discussions until 1 p.m., when we heard the shooting."
He said his bloodstained colleague told them the attackers had entered the parliament building through the western gate, through which constituents normally enter to meet with members of parliament.
He said at least one of the attackers appeared to be dressed in the traditional black robe worn by many Iranian women.
"One of the terrorists wrapped up in a black chador and carrying a gun entered, shot the gate guard and opened the gate for his fellow terrorists. They started shooting," he said.
He said lawmakers were able to leave through the southern gate when an elite law enforcement force stormed the building after about 1 p.m.
Mohammad Ali Saki, editor of the English-language Tehran Times, said four assailants attacked an administrative building next to parliament, targeting guards, cleaners, and other employees, but never got near the parliament chamber.
"The main door where parliamentarians enter has not been targeted," Saki said.
Police initially directed the city's 14 million residents to avoid the downtown area and public transportation, Saki said. Those orders were lifted late Wednesday, but people did not immediately return to the streets.
"The people are both angry and concerned because we are the only country in the region that had remained safe from the vicious acts of terrorism," he said, noting that officials disrupted several terrorist networks last year.
"Unfortunately, they succeeded in attacking the symbols of the country, of democracy and what is cherished by the people, the shrine of the founder of the Islamic Republic."
After the end of the siege, Parliament Speaker Ali Larijani made a defiant address to lawmakers.
"This morning a few terrorists committed a cowardly terrorist action, were seriously brought down, and parliamentarians are doing their normal jobs," he said. "Iran is a pillar in fighting terrorism. They want to make a problem, but the problem will be solved."
Terrorist violence is rare in the Iranian capital, where state security forces keep a tight grip, although analysts have said Tehran's support for Syrian President Bashar Assad could make Iran a target for supporters of Islamic State.
The extremist group is at war with Iranian-backed groups in Syria and Iran and views Iran's Shiite majority as apostates deserving of death.