Islamic state claimed responsibility for a shrine attack in the Iranian city of Shiraz on Wednesday, a statement on their telegram channel said.
The attack on a Shi'ite Muslim shrine in the Iranian city of Shiraz killed 13 people on Wednesday, authorities said, and President Ebrahim Raisi vowed that the shooting by suspected Sunni Muslim militants would not go unanswered.
"Experience shows that Iran's enemies, after failing to create a split in the nation's united ranks, take revenge through violence and terror. This crime will definitely not go unanswered, and the security and law enforcement forces will teach a lesson to those who designed and carried out the attack."President Raisi
The killing of Shi'ite pilgrims praying at the Shah Cheragh shrine in Shiraz increased tension in a country reeling from weeks of protests sparked by the killing in custody of Kurdish woman Mahsa Amini. Security forces clashed with protesters marking 40 days since death of the 22-year-old's death.
Interior Minister Ahmad Vahidi said many people had been injured in the Shiraz incident and the death toll could rise further. He blamed the protests sweeping Iran for paving the ground for such "terrorist attacks".
Iran will respond to the shrine attack, Raisi said, according to state media.
"Experience shows that Iran's enemies, after failing to create a split in the nation's united ranks, take revenge through violence and terror. This crime will definitely not go unanswered, and the security and law enforcement forces will teach a lesson to those who designed and carried out the attack," Raisi said.
Early reports said three gunmen were involved in the attack. State news agency IRNA described them as "takfiri terrorists", a label used by officials in predominantly Shi'ite Muslim Iran to refer to hardline, armed Sunni Islamist groups.
Nournews, affiliated with Iran's top security body, said they were not Iranian nationals.
However, the local police chief later said a lone gunman had carried out the attack, and was being questioned after he was captured. He gave no further details.
The semi-official Tasnim news agency said the attacker shot an employee at the shrine entrance before his rifle jammed and he was chased by bystanders.
He managed to fix his gun and opened fire on his pursuers, before entering a courtyard and shooting worshippers. Several women and children were among the dead, it said.
The attack took place on the same day that Iranian security forces opened fire at mourners who gathered in Amini's Kurdish home town of Saqez, according to a witness.
"Riot police shot mourners who gathered at the cemetery for Mahsa's memorial ceremony ... dozens have been arrested," the witness said. Iranian authorities were not available to comment.
The semi-official ISNA news agency said about 10,000 people had gathered at the cemetery, adding that the internet was cut off after clashes between security forces and people there.
Videos on social media showed thousands of Iranians marching towards the cemetery where Amini is buried despite the heavy presence of riot police. Activists had called for protests across the country to mark 40 days since she died after being detained for "inappropriate attire".
Demonstrations ignited by the 22-year-old's death in the custody of Iran's morality police on Sept. 16 have become one of the boldest challenges to the clerical leadership since the 1979 revolution.
A wide range of Iranians have come out on to the streets, with some calling for the downfall of the Islamic Republic and the death of Supreme Leader Ayatollah Ali Khamenei.
A witness said "men and women have gathered around Amini's grave at the Aichi cemetery in Saqez, chanting 'Woman, Life, Freedom'". Another witness in Saqez said the cemetery was filled with members of the volunteer Basij militia and riot police.
"But people from all around the Kurdistan province are here. We are all mourning Mahsa's death together."
Security police had warned her family not to hold a memorial procession or "their son will be arrested", rights groups said. However, the governor of Kurdistan, Zarei Kusha, denied there were restrictions, adding that it was the family's decision not to hold a gathering, according to state media.
Videos on social media showed security forces had blocked roads leading to Saqez. Reuters could not verify the authenticity of the videos.
Authorities closed all schools and universities in Kurdistan province on Wednesday "because of a wave of influenza", Iranian state media reported.
Videos on social media showed crowds packing streets in many cities and the bazaars of Tehran and some other cities shut down with people chanting "Death to Khamenei".
1500tasvir, a Twitter account focused on Iran protests with 280,000 followers, reported a "brutal crackdown" on protesters in multiple locations in Tehran, including a gathering at the Tehran Medical Association.
An Iranian former pro-reform official said the spread of the protests appeared to have taken authorities by surprise and contrasted with the establishment's assertions that support for the Islamic system is overwhelming.
The United States imposed new sanctions on Iranian officials, including those overseeing Tehran's Evin prison, and others over internet censorship and the crackdown.
While some analysts said prospects for the imminent dawn of a new political order are slim, activists said a wall of fear had fallen and the path to a new revolution was not reversible.
Students have played a pivotal role in the protests, with dozens of universities on strike. Hundreds of schoolgirls have joined in, chanting "Freedom, Freedom, Freedom," despite fierce crackdowns by security forces.
State media and hardline officials have branded protesters "hypocrites, monarchists, thugs and seditionists".
Rights groups said at least 250 protesters had been killed, including teenage girls, and thousands had been arrested.
The authorities, who have accused the United States and other Western countries of fomenting what they call "riots", have yet to announce a death toll but state media have said around 30 members of the security forces have been killed.