Saudi Arabia executed a prominent Shia Muslim cleric and dozens of al Qaeda members on Saturday, signalling it would not tolerate attacks by either sunni militants or minority shia seeking equality, but stirring sectarian anger across the region.
Scores of Shia Muslims marched through the Qatif district of Saudi Arabia's Eastern Province in protest at the execution of cleric Nimr al-Nimra, an eyewitness said. They chanted "down with the Al Saud", the name of the ruling Saudi royal family.
But most of the 47 executed 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 Shia accused of shooting policemen.
The executions took place in 12 cities in Saudi Arabia, 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.
Riyadh's main regional rival Iran and its Shi'ite allies immediately reacted with vigorous condemnation of the execution of Nimr, and Saudi police raised security in a district where the sect is a majority in case of protests, residents said.
However, the executions seemed mostly aimed at discouraging Saudis from militanism 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 Egytian 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 militants 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 Shia 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 militants 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 Shia 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 Shia 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 Shia 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.