TEHRAN — When a Saudi state executioner beheaded the prominent Shiite dissident Sheikh Nimr al-Nimr on Saturday, the Shiite theocracy in Iran took it as a deliberate provocation by its regional rival and dusted off its favored playbook, unleashing hard-liner anger on the streets.

Within hours of the execution, nationalist Iranian websites were calling for demonstrations in front of the Saudi Embassy in Tehran and its consulate in the eastern Iranian city of Mashhad. The police, outnumbered, looked the other way as angry protesters set the embassy ablaze with firebombs, climbed the fences and vandalized parts of the building.

Now, Iranian leaders are suddenly forced to reckon with whether they played into the Saudis’ hands, finding themselves mired in a new crisis at a time they had been hoping to emerge from international sanctions as an accepted global player. Iran might have capitalized on global outrage at the executions by Saudi Arabia, but instead it finds itself once again characterized by adversaries as a provocateur in the region and abroad.

“They knew we couldn’t look the other way,” said Fazel Meybodi, a cleric from the Iranian holy city of Qum, one of the world’s main centers of Shiite theology. “That they would actually go ahead with killing him? That caught all of us by surprise.”