Gunmen have opened fire on an Iranian military parade in the south-western city of Ahvaz, killing at least 25 people, including civilians, and injuring 60, state media say.
The attackers shot from a park near the parade and were wearing military uniforms, reports say.
An anti-government Arab group, Ahvaz National Resistance, and Islamic State (IS) have both claimed the attack.
President Hassan Rouhani has vowed a "harsh response".
"The response of the Islamic Republic of Iran to the smallest threat will be harsh, but those who sponsor the terrorists must be held accountable," he said in a statement.
Foreign Minister Javad Zarif blamed "terrorists paid by a foreign regime", adding that "Iran holds regional terror sponsors and their US masters accountable".
Iran has previously accused its regional rival, Saudi Arabia, of supporting separatist activity amongst Iran's Arab minority.
Meanwhile, an Iranian military spokesman claimed the attackers were not from IS but "were trained and organised by two Gulf countries", and had ties to the US and Israel.
Fars news agency said the attack started at 09:00 local time (06:30 BST), lasted about 10 minutes, and appeared to involve four gunmen.
The attackers fired at civilians and attempted to attack military officials on the podium, Fars reports.
Nearly half of those killed were members of Iran's Revolutionary Guard, reports say.
A number of civilians, including women and children, who were watching the military parade, were also among those killed, Irna news agency said.
However Irna said no journalist was among those killed, contradicting earlier reports.
There were also conflicting reports about the four attackers, with state media saying all four had been killed after local deputy governor Ali Hosein Hoseinzadeh said two of the four had been arrested.
Iran is marking the anniversary of the beginning of the 1980-88 war with Iraq with several military parades across the nation.
How will the US react?
By Siavash Mehdi-Ardalan, BBC Persian
There have been two conflicting claims of responsibility: one from a low profile Arab militant group in Iran's Khuzestan region and one from IS. It makes some difference.
The former would suggest a resurgence of separatist militancy after a seven-year lull. If it was IS, it would represent a failure by Iran's intelligence community to prevent a second major IS attack in its soil.
Iran has not provided any evidence of foreign collusion but has vowed revenge. The Saudi reaction and more importantly the wording of the US administration's response may prove important as leaders of all three countries are set for a possible diplomatic clash at the UN General Assembly next week.
Who is behind the attack?
There have been conflicting reports.
A spokesman for the Ahvaz National Resistance, an umbrella group that claims to defend the rights of the Arab minority in Khuzestan, said the group was behind the attack.
The spokesman did not say whether the group had links to other countries.
IS's Amaq agency has also claimed it carried out the attack. However the group provided no evidence that it had been involved.
IS has carried out a major attack in Iran before. In June last year, suicide bombers attacked parliament and the mausoleum of the Islamic Republic's founder Ayatollah Khomeini, killing 18 people.
Iranian government and military officials have pointed the finger at Gulf states, the US and Israel, with all of whom Iran has longstanding tensions.
The US and Saudi Arabia accuse Iran of supporting Houthi rebels in the conflict in Yemen, where Saudi Arabia and the United Arab Emirates are fighting on the side of the internationally-recognised government of President Abdrabbuh Mansour Hadi.