Iran will not sit back after an attack at a Shi'ite Muslim shrine, which killed 15 people, the foreign minister said on Thursday.
"We will certainly not allow Iran's national security and interests to be toyed with by terrorists and foreign meddlers who claim to defend human rights," Foreign Minister Hossein Amirabdollahian said in a statement carried by state media.
"This crime made the sinister intentions of the promoters of terror and violence in Iran completely clear. There is reliable information that the enemies have drawn up a multi-layered project to make Iran insecure."
The attack will add pressure on Iran's government.
Wednesday's killing of Shi'ite pilgrims came on the same day that Iranian security forces clashed with increasingly strident protesters marking 40 days since the death in police custody of Mahsa Amini, a 22-year-old Kurdish woman.
The demonstrations have become one of the boldest challenges to the clerical leadership since the 1979 revolution, drawing many Iranians into the streets, with some calling for the downfall of the Islamic Republic and the death of Supreme Leader Ayatollah Ali Khamenei.
The authorities, who have accused the United States and other Western countries of fomenting what they call "riots", have yet to declare a death toll, but state media have said about 30 members of the security forces have been killed.
Interior Minister Ahmad Vahidi blamed the protests sweeping Iran for paving the ground for the Shiraz attack, and President Ebrahim Raisi said Iran would respond, according to state media.
CCTV footage broadcast on state TV on Thursday showed the attacker entering the shrine after hiding an assault rifle in a bag and shooting as worshippers tried to flee and hide in corridors.
He was shown being arrested by police after being shot and injured. State media said he was not Iranian, but did not give his nationality.
Officials have called three days of mourning in the southern province of Fars, after the attack in the provincial capital of Shiraz.