Three assailants, one with a pistol and two with AK-47 assault rifles, carried out the attack in central Tehran, lawmaker Elias Hazrati told state television. The semi-official ISNA news agency said all entrance and exit gates at parliament were closed and that lawmakers and reporters were ordered to remain in place inside the chamber, where a session had been in progress.
IRNA news agency quoted the Head of Imam Khomeini Mausoleum Public Relations Office Ali Khalili, as saying that one of the armed men detonated himself in front of a bank outside the mausoleum.
The attack on the Khomeini shrine was likely purposeful, as the former leader is a revered figure among Iranians.
On Wednesday morning, the Iranian capital Tehran was rocked by twin terrorist attacks carried out by armed gunman and suicide bombers - one at the parliament and one at the mausoleum of Ayatollah Ruhollah Khomeini.
Photos showed people climbing down from exterior windows of the building as they tried to escape.
Both attacks, claimed by the Islamic State (IS) armed group left a toll of 12 dead and almost 40 wounded, according to the most up-to-date official reports, which may change with the passing of hours.
Several gunmen and suicide bombers stormed the Iranian parliament building, setting off an hours-long siege that ended with all four attackers dead.
Regional analysts claim the attacks were tied to President Trump's decision to visit Saudi Arabia for his first overseas diplomatic trip since taking office in January. Iran provides ground forces and supports groups fighting against ISIS and other Sunni jihadis in Syria and Iraq.
In an unusual development, the group also released a short video that it said was taken by one of the attackers inside the parliament.
Iran has mostly Shiite Muslims, which means it does not get along with Sunni terrorist groups al-Qaeda and ISIS.
The Islamic State's claim of responsibility could not be independently verified.
A woman was also arrested.
ISIS members consider the predominantly Shiite Iranians as heretical, and consider shrines to be idolatrous.
The United States is condemning what it calls "terrorist attacks" in the Iranian capital of Tehran.