Wednesday's twin attacks were the first in Iran claimed by the Islamic State group
Thousands packed Tehran’s streets on Friday to mourn the victims of two suicide bomb and gun attacks, and joined their supreme leader in accusing regional rival Saudi Arabia of involvement in the assaults.
People in the crowds, some crying, chanted “Death to Saudi Arabia" alongside the more customary "Death to America" and slogans against Israel, as they reached out to touch coffins wrapped in flags and covered in flowers.
Iran's supreme leader said on Friday that the attacks would only "reinforce hatred" for the United States and Saudi Arabia, at a funeral for those killed.
"Such acts will have no other result than to reinforce hatred for the US government and its agents in the region, like the Saudi (government)," Ayatollah Ali Khamenei wrote in a message of condolence to the families of the dead.
Wednesday's attacks on Tehran's parliament complex and the shrine of revolutionary leader Ayatollah Ruhollah Khomeini killed 17 people and wounded more than 50.
They were the first attacks in Iran to have been claimed by the Islamic State group.
A man takes cover during an attack on the Iranian parliament in central Tehran (Reuters)
The intelligence ministry said the attacks were carried out by five Iranian men who had joined IS and travelled to their bastions in Iraq and Syria before returning home.
Iran's elite Revolutionary Guard has accused regional rival Saudi Arabia of involvement in the attacks and the assaults have further fuelled tension between Riyadh and Tehran as they vie for control of the Gulf and influence in the wider Islamic world.
But Intelligence Minister Mahmoud Alavi said "we still cannot judge that Saudi Arabia has had a role in this terrorist incident".
Read more ►
The funerals for those killed began on Friday morning in Tehran with a ceremony in parliament, with President Hassan Rouhani in attendance.
Parliament Speaker Ali Larijani also attacked the United States and Saudi Arabia, which he called "a tribal state very far from anything like a democracy".
In a speech at the ceremony, Larijani denounced US sanctions against Iran over its ballistic missile programme.
The United States "knows that the Revolutionary Guard and its Quds Force are the most important regional forces fighting terrorists", he said.
The imposition of such sanctions "demonstrates their alignment with terrorists in the region", said the speaker, a moderate conservative.
After prayers, a procession will leave Tehran University for the Behesht-e-Zahra cemetery, near the Khomeini mausoleum 13 kilometres south of the Iranian capital.