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.