BEIRUT — Saudi Arabia has released Ali Mohammed al-Nimr, a Saudi citizen who faced the death sentence for participating in protests when he was 17, following a Saudi decision earlier this year to commute death sentences for individuals who committed crimes while minors.

Nimr was arrested in February 2012 for joining demonstrations in Saudi Arabia’s Eastern Province. The Saudi government accused protesters in late 2011 and early 2012 of plotting a revolt and aligning with regional rival Iran, an oft-used accusation when protests erupt in that region because of its large Shiite Muslim population and its proximity to Iran, a Shiite-led theocracy. Saudi Shiites have long complained of marginalization in Saudi Arabia, a Sunni-majority country led by an absolute monarchy.

Hundreds of people were arrested in the protests, and more than a dozen demonstrators and several police officers were killed. In February 2012, Nimr was arrested while leaving school. He was sentenced to death in 2015, as were two others — Dawood al-Marhoon and Abdullah al-Zaher. All three were accused of participating in the 2011-2012 Qatif protests, and all three were underage at the time.

Nimr’s case drew extra notice in part because his uncle, Nimr al-Nimr, was a prominent Shiite cleric and political activist leading anti-government demonstrations. The 2016 execution of Nimr al-Nimr, who was seen as a leader by Shiite activist around the Persian Gulf, set off protests in Saudi Arabia and Iran, and pushed crowds to storm and torch the Saudi Embassy in Tehran.

The case of Ali Mohammed al-Nimr has garnered international media attention, especially with human rights groups pressing the kingdom to end executions of those who commit offenses as minors.

In 2020, Saudi Arabia’s Human Rights Commission appeared to announce a ban on the practice, citing a royal order dated March 2020. But the royal order was never published, leaving the kingdom and human rights defenders confused about whether underage offenders’ death sentences would be commuted.

Saudi Arabia is one of three countries in the world, alongside Iran and Sudan, that have yet to end the juvenile death penalty. In June, the execution of Mustafa al-Darwish earned the kingdom criticism from four United Nations human rights officials who penned a letter denouncing the decision, as Darwish was reportedly under 18 at the time of his alleged offenses.

Despite its overall number of executions dipped last year, Saudi authorities in the first six months of 2021 have “brazenly intensified the persecution of human rights defenders and dissidents and stepped up executions,” Amnesty International said in August.

Although 2020 brought an 85 percent fall in recorded executions, at least 40 people were put to death between January and July of 2021 — more than the total in all of 2020, according to the human rights watchdog.

In February 2021, the Human Rights Commission said the death sentences of the three aforementioned young Shiite prisoners would be commuted and their penalties reduced to 10 years in prison.

Eight months later, on Wednesday, Nimr was reunited with his family, 107 days before completing his 10-year sentence. An uncle announced his release in a tweet accompanied by a photo of a bearded Nimr, softly smiling inside a car.

“For 10 years that have passed, as people were asleep in the dead of the night, I would rely on fervent prayers” awaiting Nimr’s release, his father wrote in a tweet. He thanked everyone who stood by the family over the past decade, and directed gratitude to King Salman for his “historic decision in April 2020 which ruled to stop the issuing and implementation of death sentences against minors, so may Allah reward him and his crown prince.”

But the absence of a published decision retroactively revoking death sentences for juvenile-committed crimes poses doubts about its future implementation.

Nimr’s release is a clear sign of Saudi Arabia’s serious approach to stopping executions for juvenile crimes, said Taha al-Hajji, a Saudi lawyer and legal consultant with the European Saudi Organization for Human Rights. But a lot of work remains, as death sentences are to be commuted only for one type of crime, and the lack of a clear decision by the Saudi government might result in a lack of legal consistency in future cases, Hajji said.

Hajji said he saw this “bloody period” as “effectively over,” but he wondered whether the Saudi government would use trickery to circumvent the decision, such as “if the government fabricates accusations for someone who is under 18, [claiming] it happened after they turned 18.”

The London-based human rights group Reprieve welcomed the release of Nimr and rejoiced in his reunion with his family, but the group decried his being detained in the first place.

“Ali’s release is a tangible sign of progress,” Maya Foa, the organization’s director, said in a statement to The Post “but the fact is, the Kingdom still sentences people to death for childhood crimes.”

She mentioned the case of Abdullah al-Howaiti, 19, who is on death row after being convicted of robbing a jewelry store of more than $200,000 in gold, wounding two employees and fatally shooting a police officer. At the time of the crime, Howaiti was 14.

“Like Ali, Abdullah al-Howaiti was arrested when he was a child, tortured into making a false confession and convicted in a deeply unfair trial,” Foa said. “While Abdullah remains on death row, at risk of execution, any claims by Saudi Arabia to have ended the death penalty for children are an empty PR exercise.”

Correction: An earlier version of this story mistakenly described the length of Nimr’s reduced sentence. The story has been updated.