Saudi Arabia has executed 47 people for terrorism, including the prominent Shia cleric Sheikh Nimr al-Nimr.

Most of those executed on Saturday were involved in a series of attacks carried out by al-Qaida from 2003-06, the interior ministry said.

However, it also detained hundreds of members of its Shi’ite minority after protests in 2011-13, during which several policemen were killed in shooting and petrol bomb attacks. Several of those held had been sentenced to death.

The interior ministry statement began with Koranic verses justifying the use of execution and state television showed footage of the aftermath of al-Qaida attacks in the last decade. Saudi grand mufti Sheikh Abdulaziz Al al-Sheikh appeared on television soon after to describe the executions as just.

Iran’s Shia leadership has warned that executing Nimr “would cost Saudi Arabia dearly”.

In October 2015 Saudi Arabia’s supreme court rejected an appeal against the death sentence passed earlier on Nimr, who had called for pro-democracy demonstrations and whose arrest in 2012 sparked protests in which three people died.

Nimr had long been regarded as the most vocal Shia leader in the eastern Saudi province of Qatif, willing to publicly criticise the ruling al-Saud family and call for elections. He was, however, careful to avoid calling for violence, analysts say.

That did not prevent the Saudi interior ministry from accusing him of being behind attacks on police, alongside a group of other suspects it said were working on behalf of Shia Iran, the kingdom’s main regional rival.

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.

