Suicide bombers and gunmen have attacked Iran's parliament and the Mausoleum of Ayatollah Khomeini in Tehran, killing at least 12 people in a twin assault at the heart of the Islamic Republic.

ISIS claimed responsibility and released a video purporting to show gunmen inside the parliament building and one man, who appeared wounded, on the floor.

The rare attacks were the first claimed by the hardline Sunni Muslim militant group inside the Shi'ite Muslim country.

Iran is one of the powers leading the fight against Islamic State militants in neighbouring Iraq and, beyond that, Syria.

Attackers dressed as women burst through parliament's main entrance in central Tehran, deputy interior minister Mohammad Hossein Zolfaghari said, according to the semi-official Tasnim news agency.

A file image of the Khomeini Mausoleum. (AAP)

"One of them was shot dead and another one detonated his suicide vest," he said.

About five hours after the first reports, Iranian news agencies said four people who had attacked parliament were dead and the incident was over.

At least 12 people were killed by the attackers, the head of Iran's emergency department, Pir-Hossein Kolivand, was quoted as saying by state broadcaster IRIB.

"I was inside the parliament when shooting happened. Everyone was shocked and scared. I saw two men shooting randomly," said one journalist at the scene, who asked not to be named.

Soon after the assault on parliament, another bomber detonated a suicide vest near the shrine of the Republic's revered founder, Ayatollah Khomeini, a few kilometres south of the city, Zolfaghari said, according to Tasnim.

A second attacker was shot dead, he said.

The attackers stormed Iran's parliament and the Khomeini Shrine. (Getty)

US President Donald Trump expressed sympathy for the victims of a terror attack in Iran that killed 13 people, 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."

The Iranian Intelligence Ministry said security forces had arrested another "terrorist team" planning a third attack, without giving further details.

The attacks took place less than a month after the re-election of President Hassan Rouhani, a moderate, whose landslide victory defeated candidates supported by the hardline clergy and the Islamic Revolutionary Guard Corps (IRGC), which is responsible for national security.

"The atmosphere is tense. It is a blow to 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.

The Intelligence Ministry called on people to be vigilant and report any suspicious movement.

Despite unconfirmed reports of a hostage situation, state television said parliament had resumed, and broadcast footage of what it said was the opening session proceeding normally.

Attacks are rare in Tehran and other major cities though a Sunni militant group named Jundallah and its splinter group Ansar al Furqan have been waging a deadly insurgency, mostly in more remote areas, for almost a decade.