Saudi Arabia has executed 47 people for terrorism, including the prominent Shi’ite Muslim cleric Nimr al-Nimr, the Interior Ministry said Saturday. Most of those executed were said to be involved in a series of attacks carried out by Al Qaeda between 2003 and 2006.

Iran has warned that executing Nimr “would cost Saudi Arabia dearly,” Reuters reported.

Nimr, along with six others, were accused of orchestrating anti-government protests between 2011 and 2013 in which 20 people died. Earlier this year, the kingdom’s Supreme Court rejected an appeal against the death sentence passed on the Shia cleric.

The Interior Ministry statement announcing the executions began with verses from the Koran, justifying the use of the death penalty, while state television showed footage of the aftermath of Al Qaeda attacks over the last decade. Shortly afterward, Saudi Grand Mufti Sheikh Abdulaziz Al al-Sheikh appeared on Saudi Arabian television, hailing the executions as just.

The absolutist Sunni Muslim monarchy carried out at least 158 executions in 2015, with beheadings reaching their highest level in two decades, according to human rights groups.

Adam Coolge, Middle east researcher for Human Rights Watch, told AP that Saudi Arabia had executed almost twice as many people in 2015 as the year before. The horrific figure is second only to 1995, when the Gulf kingdom executed 192 people.

Saudi Arabia carries out most executions through beheading and often in public, giving rise to comparisons with terrorist group Islamic State (which also claims to be implementing Shariah law) while carrying out public beheadings.

The Gulf monarchy, however, has rejected parallels with Islamic State (IS, previously ISIS/ISIL). Foreign Minister Adel al-Jubeir told reporters in Paris in December that “it’s easy to say Wahhabism equals Daesh equals terrorism, which is not true,” referring to the Arabic acronym for IS.

The absolutist monarchy argues that its judicial processes require at least 13 judges in three tiers of its courts system to rule in favor of a death sentence before it is carried out. According to Saudi officials, the executions are aimed at curbing crime.

Saudi law allows for execution in cases of murder, rape and drug offenses. The death penalty also applies to adultery, apostasy and witchcraft.

The number of prisoners put to death for non-lethal offenses, such as illicit drug use, have also skyrocketed. A royal decree issued in Saudi Arabia in 2005 to combat narcotics further codified the right of judges to issue execution sentences “as a discretionary penalty” against any person found guilty of smuggling, receiving or manufacturing drugs.

In November 2015, at least 63 people (including 45 foreign nationals) were executed since the start of the year for drug-related offenses, Amnesty International said. That figure accounted for at least 40 percent of the total number of executions in 2015 (compared to less than 4 percent for drug-related executions in 2010).

Foreign nationals, mostly migrant workers from developing countries, are particularly vulnerable as they typically lack knowledge of Arabic and are denied adequate translation during their trials,” Amnesty said.

According to Human Rights Watch, of the first 100 prisoners executed in 2015, at least 56 sentences were carried out based on judicial discretion, not for crimes for which Saudi law requires a mandatory death penalty.

Delphine Lourtau, research director at Cornell Law School’s Death Penalty Worldwide, told AP that defendants in Saudi Arabia are not provided with defense lawyers and in numerous cases of South Asians arrested for drug trafficking, are not even provided translators in court hearings. There are also concerns “over the degree of influence the executive has on trial outcomes” when it comes to cases where Shi’ite activists are sentenced to death, she said.

Emory Law professor and Shariah scholar Abdullahi An-Naim has said that since there is an “inherent infallibility in court systems,” no judicial system can claim to enforce an immutable, infallible form of Shariah, AP reported him as saying.

After an avalanche of international criticism from human rights groups, Saudi Arabia’s representative to the United Nations Human Rights Council, Bandar al-Aiban, claimed in a speech in Geneva in March that capital punishment applies “only [to] those who commit heinous crimes that threaten security.