Iran broke up an Isis (Islamic State) plan to bomb commemorations marking the Shia religious mourning period of Ashura, state media reported, the latest alleged militant plot to target the country.
Iran's official IRNA news agency quoted Intelligence Minister Mahmoud Alavi as saying several foreign nationals were detained with some 100kg of explosives.
State television also reported the arrests.
Alavi said the suspects planned to attack Ashura events in Iran's southern Fars province. Ashura marks the death of Hussein, the grandson of the Prophet Muhammad, at the Battle of Karbala in present-day Iraq in the 7th century.
Alavi referred to the suspects as "takfiri terrorists", a term used by Iranian officials to describe militant Sunni Muslim fundamentalists like Isis.
"Intelligence Ministry agents, with the cooperation of other security forces, succeeded to defuse one of the anti-security plots of the takfiri terrorist groups and prevent an inhuman crime in the ceremonies," he said.
Iran in recent months has announced an increasing number of thwarted militant attacks. In June, Iran said it broke up one of the "biggest terrorist plots" ever on its soil by Sunni extremists planning bombings in Tehran and elsewhere during the holy Muslim fasting month of Ramadan.
Iran increasingly has warned of possible militant assaults targeting the country, which hasn't seen large-scale attacks since the 1980s.