Iran's President Ebrahim Raisi has strongly condemned the attack on a popular Shia shrine in southern Iran's Fars province, saying the "evil act" will "not go unanswered."
In a statement late on Wednesday, Raisi said the country's security forces will identify the planners and perpetrators of the attack and give a "regretful response."
At least 13 people have been confirmed dead and 40 others injured so far in the attack on Shah Cheragh shrine in Shiraz after an armed assailant on Wednesday evening opened indiscriminate fire at the shrine.
The incident took place at around 5.45 p.m. local time (1415GMT) when people were preparing for congregational evening prayers, local officials said.
The provincial police commander told media people that the attacker opened fire at pilgrims inside the shrine compound and was soon overpowered by security guards and taken into custody.
A CCTV footage released by the police showed an armed man entering the shrine and shooting at people.
Earlier, reports said three attackers were involved in the attack, one of the deadliest in recent years.
Among those killed were a woman and two children, local officials confirmed.
Provincial governor said the attacker intended to target the congregational prayers, but the doors to the main prayer hall were shut by the shrine staff.
Those injured in the attack have been transferred to local hospitals, and some of them are believed to be in critical condition.
Although the identity of the attacker has not been revealed, Nour News, affiliated with Iran's top security body, said he was a foreign national.
The Shah Cheragh shrine, which houses the grave of a revered Shia scholar, is a popular pilgrim destination in southern Iran, thronged by both local and foreign pilgrims.
Iran's Interior Minister Ahmed Wahedi also condemned the attack and said 13 people were killed, while a deputy for political and security affairs at Fars governor's office said 15 people were killed and 19 others wounded in the attack.
He said the stream of unrest in Iran in recent weeks is moving in "dangerous directions" and that terrorists are "taking advantage of the unrest."
In his reaction, Iran's Parliament Speaker Muhammad Baqir Qalibaf said the "enemies failed to achieve their ominous goals" so they "resorted to the method of the Takfiri terrorists."
Wednesday's attack came amid widespread protests across Iran over the death of a young Iranian woman, Mahsa Amini, in police custody last month.
Wednesday marked 40 days since her death and saw fresh protests in several cities, including the capital Tehran, amid heavy deployment of police on the streets.