Iran attackers fought for Islamic State in Syria, Iraq
Iran's powerful Revolutionary Guards have also said regional rival Saudi Arabia was involved, fuelling tensions between Sunni Muslim power Riyadh and Shi'ite power Tehran as they vie for influence in the Gulf. Saudi Arabia dismissed the accusation.
Iran's intelligence ministry said on Thursday five of attackers who died in the assault had been identified as Iranians who had joined the hardline Sunni Muslim militants of Islamic State on their main battlegrounds in Iraq and Syria.
"They earlier left Iran and were involved in the crimes of the terrorist group in Raqqa and Mosul," the ministry said, referring to Islamic State's effective capital in Syria and a city it captured in Iraq.
"Last year, they returned to Iran ... to carry out terrorist attacks in the holy cities of Iran," the ministry added in a statement on state news agency IRNA.
The attacks were the first claimed by Islamic State inside tightly controlled Iran, one of the powers leading the fight against the militants in Iraq and Syria.
Two Sunni militant groups, Jaish al-Adl and Jundallah, have been also waging an insurgency in Iran, mostly in remote areas, for almost a decade.
Iran's intelligence ministry said earlier on Thursday it had arrested more suspects linked to the attacks, on top of six Iranians, including one woman, detained on Wednesday.
The semi-official Tasnim news agency said on of the wounded people had died in hospital, bringing the death toll to 17. Two of the victims were women, it added, citing official figures.
Security camera footage aired on state TV showed people running and seeking cover as the gunmen strode through parliament's halls, firing their weapons and hitting at least one person.
Iranians, contacted by Reuters, said there was a heavy police presence, particularly in the capital's busy squares.
"It feels safe to see police everywhere. Also there are plainclothes officers in shopping centers," said Mohammadali Rastgou, a shopkeeper in northern Tehran's Tajrish square.
State TV also showed pictures of ammunition, rifles and binoculars laid out next to an Islamic State flag, all, it said, taken from the attackers.
"We have seen worse than this. Iranians will not be intimidated by such attacks. Our country is the safest place in the region," a middle-age man told state TV.
Other members of the public accused Saudi Arabia and Iran's long-time foe, the United States, of backing the attacks.
U.S. President Donald Trump said on Wednesday he was praying for the victims, but added that "states that sponsor terrorism risk falling victim to the evil they promote."
Foreign minister Mohammad Javad Zarif dismissed what he called the "repugnant White House statement". "Iranian people reject such U.S. claims of friendship," he added on Twitter.