Saudi Arabia executed a prominent Shi'ite Muslim cleric and dozens of al Qaeda members on Saturday, signaling that it would not tolerate attacks, whether by Sunni jihadists or minority Shi'ites, and stirring sectarian anger across the region.
Several news outlets reported late Saturday that Iranian protesters stormed the Saudi embassy in Tehran, setting fire to part of the compound before police managed to wrest back control from the mob. The New York Times cited an eyewitness that claimed that demonstrators broke windows and set rooms ablaze in the embassy.
Hundreds of Shi'ite Muslims marched through Qatif district in Saudi Arabia's Eastern Province in protest at the execution of cleric Nimr al-Nimr, an eyewitness said. They chanted "Down with the Al Saud!", the name of the ruling Saudi royal family.
Nimr, the most vocal critic of the dynasty among the Shi'ite minority, had come to be seen as a leader of the sect's younger activists, who rejected the quiet approach of older community leaders for failing to achieve equality with Sunnis.
Most of the 47 killed in the kingdom's biggest mass execution for decades were Sunnis convicted of al Qaeda attacks in Saudi Arabia a decade ago. Four, including Nimr, were Shi'ites accused of involvement in shooting policemen.
The executions took place in 12 cities, four prisons using firing squads and the others beheading. In December, al Qaeda in the Arabian Peninsula threatened to retaliate against Saudi Arabia for any execution of its members.
The move further soured relations between Sunni-ruled Saudi Arabia and its Shi'ite regional rival, Iran, which had hailed Nimr as the champion of a marginalized Shi'ite minority.
The website of Iran's Supreme Leader, Ayatollah Ali Khamenei, carried a picture of a Saudi executioner next to notorious Islamic State executioner 'Jihadi John', with the caption "Any differences?", and the powerful Revolutionary Guards said "harsh revenge" would topple "this pro-terrorist, anti-Islamic regime". Saudi Arabia summoned the Iranian ambassador in response.
In Iraq, prominent religious and political figures demanded that ties be severed, calling into question fence-mending efforts by Riyadh that had been intended to boost a regional alliance against Islamic State militants.
The U.K.-based publication The Independent quoted from a statement by former Iraqi Prime Minister Nuri al-Maliki, who warned the executions could result in the toppling of the Saudi government. The former head of Iraq's government drew comparisons between the Saudis and Iraq's regime under former president Saddam Hussein, the publication reported.
However, the executions seemed mostly aimed at discouraging Saudis from jihadism after bombings and shootings by Sunni militants in Saudi Arabia over the past year killed dozens and Islamic State called on followers there to stage attacks.
Saudi Arabia's ruling Al Saud family has grown increasingly nervous in recent years as turmoil across the Middle East, especially Syria and Iraq, has empowered Sunni jihadist groups that seek to bring it down and given opportunities to Shi'ite Iran to spread its influence.
The simultaneous execution of 47 people - 45 Saudis, one Egyptian and a man from Chad - was the biggest mass execution for security offences in Saudi Arabia since the 1980 killing of 63 jihadist rebels who seized Mecca's Grand Mosque in 1979.
The 43 Sunni jihadists executed on Saturday included several prominent al Qaeda figures, including those convicted for attacks on Western compounds, government buildings and diplomatic missions that killed hundreds from 2003-06.
The four Shi'ites were convicted of involvement in shootings and petrol bomb attacks that killed several police during anti-government protests from 2011-13 in which over 20 members of the minority sect were also shot dead by the authorities.
Under Saudi Arabia's reading of Islamic Sharia, such attacks are interpreted as "banditry", which carries an automatic sentence of death followed by public display of bodies on gibbets.
Justice Ministry spokesman Mansour Kafari said on television another four prisoners remained on death row for acts of terrorism.
Most jihadist groups follow an extreme interpretation of the Salafi branch of Islam, the strict Sunni Muslim school that was developed in Saudi Arabia and is still followed by its clergy; but they have long regarded Riyadh as an enemy.
Government-appointed clerics have for years denounced al Qaeda and Islamic State as religious "deviants", while the government has cracked down on jihadists at home, squeezed their funding streams abroad and stopped them travelling to fight.
However, critics of the Al Saud ruling family say it has not done enough to tackle sectarian intolerance, hatred of infidels and praise for the principles of violent jihad propagated by Saudi clerics, which they see as contributing to militancy.
Mustafa Alani, a security analyst close to the Interior Ministry, commented: "There is a huge popular pressure on the government to punish those people. It included all the leaders of al Qaeda, all the ones responsible for shedding blood. It sends a message."
Analysts have speculated that the execution of the four Shi'ites was partly to demonstrate to Saudi Arabia's majority Sunni Muslims that the government did not differentiate between political violence committed by members of the two sects.
But a top Iranian cleric said the kingdom's Al Saud ruling family would be "wiped from the pages of history", Yemen's Houthi group described Nimr as a "holy warrior" and Lebanese militia Hezbollah said Riyadh had made "a grave mistake".
Saudi police increased security in Qatif district of Eastern Province, where the 2011-13 protests took place, residents said, and Bahrain police fired tear gas at several dozen people protesting against the execution of Nimr, a witness said.
Human rights groups have consistently attacked the kingdom's judicial process as unfair, pointing to accusations that confessions have been secured under torture and that defendents in court have been denied access to lawyers.
Riyadh denies torture and says its judiciary is independent.
Family members of the executed Shi'ites have vigorously denied they were involved in attacks and said they were only peaceful protesters against sectarian discrimination in the Sunni-ruled kingdom.
The three other executed Shi'ites were Ali al-Rubh, who relatives said was a juvenile at the time of the crime for which he was convicted, Mohammed al-Shayoukh and Mohammed Suwaymil.
The cleric's brother, Mohammed al-Nimr, said he hoped any response in Qatif would be peaceful, but activists said new protests were possible.
"My mobile is getting non-stop messages from friends, all shocked and angry. We know four of the names on the list. The fear is for the children among those detained," an activist in Qatif told Reuters.
The Interior Ministry statement began with Koranic verses justifying the use of execution and state television showed footage of the aftermath of al Qaeda attacks in the last decade. Saudi Grand Mufti Sheikh Abdulaziz Al al-Sheikh appeared on television soon after to describe the executions as just.
The executions are Saudi Arabia's first in 2016. At least 157 people were put to death last year, a big increase from the 90 people killed in 2014.
--CNBC contributed to this report.