This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

DUBAI, United Arab Emirates (AP) — Iran’s supreme leader and its president tried Thursday to link the nationwide protests roiling the country to an Islamic State-claimed gun attack on a famous mosque that killed 15 people.

The comments by Supreme Leader Ayatollah Ali Khamenei and President Ebrahim Raisi come as Iran’s theocracy has been unable to contain the demonstrations, sparked by the death of 22-year-old Mahsa Amini after her detention by the country’s morality police.

The protests, the most serious unrest to grip Iran since its 2009 Green Movement demonstrations, have grown to encompass anger over Iran’s cratered economy and its theocracy as well. Over 200 people have been killed amid a crackdown in Iran, with thousands others arrested by police, activists say.

On Wednesday, a gunman opened fire on worshippers at Shiraz’s Shah Cheragh mosque, the second-holiest site in Iran. State media said at least 15 people had been killed in the assault, which authorities initially attributed to multiple gunmen.

Footage released Thursday by authorities showed the gunman walking near the mosque with a large backpack, then later moving into the mosque with a Kalashnikov-style assault rifle. Barefoot worshippers inside try to flee as the man opens fire, then hunts those hiding behind whatever they could find. Blood could be seen on the mosque’s floor.

Riot police later captured the man, who authorities have yet to identify.

The Islamic State group late Wednesday claimed responsibility for the attack on its Amaq news agency. It said an armed IS militant stormed the shrine and opened fire on its visitors.

In a speech Thursday, Raisi described the ongoing protests as “riots” that allowed for the shooting in Shiraz. However, there is no evidence linking extremist groups to the widespread, largely peaceful demonstrations that have been repeatedly targeted by a heavy-handed security force crackdown in the country.

“The enemy wants the riots to pave the way for terrorist attacks. The enemy is always the enemy,” Raisi contended. “They go to a holy shrine of a son of the prophet, our third-most important shrine, his majesty Shah Cheragh, and open fire at innocent worshipers.”

For his part, 83-year-old Khamenei blamed the attack on a “plot of the enemies.”

“We all have duties to deal a blow to the warmongering enemy and its treacherous and foolish cohorts,” Khamenei reportedly said. “All our people ranging from the security bodies and the judiciary body and activists in the field of media must be united against the wave that disregards and disrespects people’s lives, their security and their sacred things.”

However, former Iranian President Mohammad Khatami warned that “violence cannot be answered with violence” in a statement carried online. Khatami’s name and image have been banned in Iranian media since 2015 over his reformist political views, which call for changing the Islamic Republic from within.

“If (the people) see that the conditions of this life are not provided (by the government), they have the right to criticize and even protest,” Khatami said.

Meanwhile on Thursday, protests continued in Iran, particularly in the northwestern city of Mahabad, some 515 kilometers (320 miles) from the capital, Tehran. There, online videos purported to show demonstrators at offices for the city’s governors, with shots heard in the background. Others purported to show a building ablaze.

Iran’s state-run IRNA news agency later said that “rioters” had damaged public property, including breaking the windows of some banks and a tax administration office there.

The protests appeared sparked by the death of a man from gunshot wounds overnight. The Kurdish group called the Hengaw Human Rights Organization posted video it described as the man’s funeral before the demonstrations began. A regional judiciary officials acknowledged the man’s death to gunshots.

Hengaw later said two others had been killed in demonstrations Thursday in Mahabad by security forces firing at protesters. Authorities did not immediately acknowledge it. Hengaw also said the sound of gunshots echoed through the city of Baneh, some 85 kilometers (50 miles) south of Mahabad, amid demonstrations as well.