Dozens of people were also wounded in the attacks, with continuing gunfire several hours after they began.
A security guard and one other person were killed when four gunmen burst into Tehran's parliament complex with rifles and a pistol, according to the ISNA news agency.
Islamic State published a 24-second video which purports to show the parliament siege.
The video, circulated online, shows a gunman and a bloody, lifeless body of a man lying on the ground next to a desk.
A voice on the video praises God and says in Arabic: "Do you think we will leave? We will remain, God willing."
One of the attackers blew himself up on the fourth floor of the parliament office building as a standoff with police continued for several hours.
It's believed the attackers were dressed as women and entered parliament's main gate before opening fire.
Read more here.
