Armed men launched attacks in Iran's parliament and the Mausoleum of Ayatollah Khomeini on Wednesday morning, killing at least 12 people in rare twin attacks, the head of Iran's emergency department, Pir-Hossein Kolivand, was quoted as saying by state broadcaster IRIB.
The Islamic State group (ISIS) claimed responsibility for the two attacks, the group's state news agency AMAQ said.
"Fighters from Islamic state attacked Khomeini's shrine and the Iranian parliament in Tehran," the news agency said.
In another statement the news agency said the attacks on Khomeini's shrine were carried out by two suicide bombers.
ISIS often claims attacks around the world, even when links to the group cannot be confirmed and appear dubious. Iranian security officials have not said who is behind the attacks but if confirmed, they would be the first assaults by the hardline Sunni Muslim group inside the Shi'ite Muslim country.
Amaq published a video on Wednesday showing a gunman at the Iranian parliament where an attack has been taking place.
Another attacker was heard on the video saying: "Thank God ... Do you think we will go away?"
Iran's Intelligence Ministry said a third attack had been thwarted. "This morning two terrorist groups attacked the parliament and Imam Khomeini's shrine ... Members of a third group were arrested before being able to carry out any attack," state TV quoted the ministry as saying.
The unusual attacks in Iran's capital, Tehran, prompted the Interior Ministry to call for an urgent security meeting, according to the state-run IRNA news agency.
Four attackers, dressed as women and armed with AK-47 assault rifles, entered parliament's main gate and opened fire. They barricaded themselves in the upper floors of the building and held several people hostage in a standoff that lasted several hours.
All four of the attackers were shot dead by Iranian security forces.
Iranian media reported that eight people were wounded, including a guard who was hit in the leg.
State TV reported that one attacker at the Iranian parliament exploded a suicide vest in the building, but some other news agencies said the explosion might have been caused by grenades thrown by the assailants
During the standoff, an Associated Press reporter saw several police snipers on the rooftops of buildings around the parliament. Shops in the area were shuttered, and gunfire could be heard. Witnesses said the attackers were shooting from the fourth floor of the parliament building down at people in the streets below.
Police helicopters were circling over the parliament building and all mobile phone lines from inside were disconnected. In addition, all entrance and exit gates at parliament were closed, while lawmakers and reporters were ordered to remain in place inside the chamber, where a session had been in progress.
Iranian TV said parliament had resumed, and broadcast footage of what it said was the opening session proceeding normally.
Targeting shrine for leader of Islamic revolution
In a separate incident about half an hour later, four terrorists, including a suicide bomber, attacked the Mausoleum of Ayatollah Khomeini in southern Tehran, killing a worker and wounding four other people, according to state TV.
Tehran Governor Hossein Hashemi told state broadcaster IRIB that one attacker detonated a suicide vest at the mausoleum, one was killed by the security forces and the rest of the assailants were arrested.
In addition to being lethal, the attack on the shrine of Khomeini is symbolically shocking. As Iran's first Supreme Leader, Khomeini is a towering figure in the country and was its revolutionary leader in the 1979 ouster of the shah.
Sunni extremists, including ISIS, despise Shiite-majority Iran and are at war with Tehran's proxies in Syria and Iraq.
"The atmosphere is tense. It is a blow to (Iranian President) Rouhani. How can four armed men enter the parliament, where a very tight security has always been in place," said a senior official, who asked not to be named.
Rouhani retained power with a landslide victory over candidates supported by the hardline clergy and the Revolutionary Guards Corps (IRGC), the country's most powerful security force in charge of ensuring national security.
The Kremlin said the attacks underlined the need for countries to pool their efforts to fight against terrorism, something it said meant working closely with Muslim nations.
Russian President Vladimir Putin has long been calling for greater international co-operation to combat ISIS, but Russian government officials say they have been dismayed by Washington's reluctance to collaborate with Moscow on the issue.