(NEXSTAR) – Former child actor Ryan Grantham has been sentenced to life in prison for murdering his mother.

Grantham, known for his roles in “Diary of a Wimpy Kid” and the series “Riverdale,” pleaded guilty to killing his 64-year-old mother, Barbara Waite, in March of 2020 inside her British Columbia home. He was 21 at the time.

This week, a judge handed down the sentence in B.C. Supreme Court in Vancouver, according to the CBC. Grantham won’t be eligible for parole for 14 years.

Justice Kathleen Ker called the case “tragic and heartbreaking,” according to the Canadian news outlet, and described during sentencing how Grantham shot his mother in the back of her head with a rifle as she played piano. He then recorded a GoPro video confessing to the crime and recording Waite’s body.

The court heard how Grantham lit candles, set up rosaries over the piano and prayed the next day, before embarking on what might have been killing rampage. The prosecution revealed that he loaded his car with gun, ammunition and Molotov cocktails before driving east to Ottawa, and had a printed map with directions to Prime Minister Justin Trudeau’s residence at Rideau Cottage, according to CTV News.

During the drive, however, he reconsidered and turned himself in to Vancouver police.

Grantham’s defense attorney argued that their client had been struggling with his mental health and had been attending counseling.

Ker called his decision to turn himself over to authorities a “saving grace” and told the courtroom that Grantham had been overwhelmed by suicidal and homicidal urges in the months before the killing, during which he increasingly used marijuana and watched violent online videos, according to the CBC.

The Squamish, British Columbia native, now 24, started acting when he was in elementary school, according to the Vancouver Sun, first landing a role in a fried chicken commercial. He eared 30 acting credits during his career, which spanned 2007 to 2019.

His last appearance was as Jeffery Augustine in “Riverdale,” a dark reboot of the Archie Comics.

If you or someone you know needs mental health help, there are multiple resources at MentalHealth.gov.