Iran president vows 'crushing response' to parade attack
"The response of the Islamic Republic of Iran to the smallest threat will be crushing", Rouhani said in a statement on his official website.
"Those who give intelligence and propaganda support to these terrorists must answer for it."
Militants shot dead dozens, including women and children in an attack on an Iranian military parade claimed by the Islamic State group.
The attack came as the country marked the anniversary of the start of its 1980-1988 war with Saddam Hussein's Iraq.
Foreign Minister Mohammad Javad Zarif said in a tweet that the attack near the Iraqi border was carried out by "terrorists recruited, trained, armed & paid by a foreign regime".
"Iran holds regional terror sponsors and their US masters accountable for such attacks," he wrote.
IS jihadists said via their propaganda mouthpiece Amaq that "Islamic State fighters attacked a gathering of Iranian forces" in Ahvaz.
The city lies in Khuzestan, a province bordering Iraq that has a large ethnic Arab community and has seen separatist violence in the past that Iran has blamed on its regional rivals.
State television gave a casualty toll of 29 dead and 57 wounded, while official news agency IRNA said those killed included women and children among spectators at the rally.
Many of the wounded were in critical condition.
Armed forces spokesman Brigadier General Abolfazl Shekarchi said the dead included a young girl and a former serviceman in a wheelchair.
"Of the four terrorists, three were sent to hell at the scene, while the fourth who had been wounded and arrested went to hell moments ago due to his severe wounds," Shekarchi told state television.
Khuzestan deputy governor Ali-Hossein Hosseinzadeh told the semi-official ISNA news agency that "eight to nine" troops were among those killed, as well as a journalist.