LONDON — Gunmen dressed as women stormed Iran's parliament building on Wednesday while a suicide bomber targeted a shrine to the Islamic republic's founder in deadly twin attacks that were claimed by ISIS.

At least 12 people were killed and 42 wounded, state media reported, citing the head of Iran's emergency department as saying.

The near-simultaneous attacks were the first terrorist incidents in Tehran in more than a decade.

ISIS claimed responsibility through its Amaq news agency and issued a video it said was taken from the scene — although the veracity of the footage could not be independently confirmed by NBC News.

Later, Reza Seifollahi, a senior official in the country’s Supreme National Security Council, said on state-run television the attackers were home-grown ISIS terrorists.

"About the identity of the attackers I should say they were from parts of Iran, and had joined Daesh [another name for ISIS]," he said, using the Arabic term for ISIS.

This contrasts with an earlier declaration from Iran's Revolutionary Guards, who said in a statement released to state media that Saudi Arabia, one of its main rivals in the region, was behind the attacks.

"This terrorist attack happened only a week after the meeting between the U.S. president (Donald Trump) and the (Saudi) leaders who support terrorists. The fact that Islamic State claimed responsibility proves that they were involved in the brutal attack," the statement read.

Four assailants wearing women's clothing — including some armed with AK-47s — burst through the parliament’s main entrance in central Tehran, deputy interior minister Mohammad Hossein Zolfaghari told the semi-official Tasnim news agency.

About five hours after the first reports, four attackers were dead and the incident was over, Iranian news agencies said.

Lawmakers were holed up inside Iran's parliament for hours. TIMA via Reuters

Amir Yagani, a 34-year old civil engineer, said he was across the street from the building when the shooting started.

"I heard shooting guns and then some of the people were escaping," he told NBC News by phone.

An Associated Press reporter saw several police snipers on the rooftops of buildings around the site.

Witnesses said attackers fired shots from the fourth floor of the building down at people in the streets below.

"I was passing by one of the streets. I thought that children were playing with fireworks, but I realized people are hiding and lying down on the streets," witness Ebrahim Ghanimi told The Associated Press.

Police officers help civilians fleeing Iran's parliament building. Omid Wahabzadeh / EPA

About 30 minutes after the parliament siege began, a suicide bomber and other assailants targeted the Mausoleum of Ayatollah Khomeini in southern Tehran.

One of the attackers was killed by security guards and a woman was arrested, state-run Press TV said.

PHOTOS: Iran Parliament, Shrine Targeted in Deadly Twin Attacks

Tasnim said four pilgrims visiting the mausoleum were injured and a worker at the shrine was killed.

Iran's English-language Press TV said the attack occurred about 30 minutes after the parliament shooting.

Ayatollah Ruhollah Khomeini launched the Islamic revolution in 1979. He died a decade later.

Members of the Iranian security forces take cover during the attack. Tasnim News Agency via Reuters

Iran's Intelligence Ministry said security forces had arrested another "terrorist team" planning a third attack, Reuters reported, without giving further details.

The U.S. State Department condemned the attacks. "We express our condolences to the victims and their families, and send our thoughts and prayers to the people of Iran. The depravity of terrorism has no place in a peaceful, civilized world," the statement said.

Such attacks are rare in Tehran and other Iranian cities. However, a Sunni militant group named Jundallah and offshoot Ansar al Furqan have been waging a deadly insurgency for almost a decade. Most of their attacks have been in remote areas.

Jason Cumming and Alastair Jamieson reported from London. Rima Abdelkader reported from New York.