BEIRUT, Lebanon — A Saudi teenager who faced possible execution for acts he was accused of committing as a child has been handed a 12-year prison sentence instead, a human rights group that has been monitoring his case said on Sunday.

Last year the Saudi public prosecutor’s office sought a death sentence for Murtaja Qureiris, now 18, but the threat of execution did not become public until last week, drawing international condemnation. The charges filed against the teenager related to his attendance at antigovernment protests, some that took place when he was as young as 10. The charges included possessing a firearm and joining a terrorist organization.

He was arrested at 13 and has been held in prison since.

The judge overseeing his case delivered the sentence on Thursday, according to the rights group, the European Saudi Organization for Human Rights, which has tracked the case for years.

According to the group, the judge told the teenager’s lawyer that instead of the death penalty, he would receive a 12-year sentence that would include the four years he has already served and four years of probation after his release, meaning he would serve three more years in prison.