The official IRNA news agency said a gunman attempted to enter the Shah Cheragh shrine and opened fire on visitors before he could be subdued.
Yadollah Bouali, the regional Islamic Revolutionary Guards Corps commander, told State TV that “a terrorist entered the gate of the shrine and opened fire with a battle rifle”.
The semi-official Fars news agency meanwhile said that the gunman had tried to enter the shrine from the Bab al-Mahdi door but was met with “resistance” from “protection forces”.
Pictures from Tasnim showed bullet holes in what appeared to be the barred windows at the entrance to the shrine, one of Iran’s most important pilgrimage sites.
The main protagonist, identified as an Afghan national in his 30s named Hamed Badakhshan, was killed at the scene in the attack.
IS has claimed previous attacks in Iran, including the deadly twin bombings in 2017 that targeted the country’s parliament and the tomb of the Islamic Republic’s founder, Ayatollah Ruhollah Khomeini.