Alex Hribal, now 20, was 16 when he stabbed 20 students and 1 security guard in the hallway early on the morning of April 9, 2014.
All 21 victims survived, though some were in critical condition and underwent surgeries as a result of the attack.
Hribal, charged as an adult, faces 23.5 to 60 years in state prison, according to the Westmoreland County District Attorney's office.
Hribal pleaded guilty in October 2017 to 21 counts of attempted homicide, in addition to 21 counts of aggravated assault and having a weapon on school property, according to court documents.
Though the case never went to trial, during litigation the judge denied a defense motion arguing that Hribal be charged as a juvenile, according to court documents.
Hribal's defense attorney Patrick Thomassey, citing severe mental illness, also argued that the juvenile be allowed to plead "guilty but mentally ill," but the judge denied that motion as well.
Hribal would have been allowed psychological treatment before serving his prison sentence had that motion been granted. Instead he will go directly to prison to begin his sentence.
The judge ordered Hribal to pay hundreds of thousands in restitution to the victims, but Hribal's parents aren't responsible for payment and Hribal will not have a means of income in the foreseeable future, according to his attorney.
Thomassey said he's disappointed with the sentencing, calling it excessive.
"I think this kid is severely mentally ill, but there were politics in this situation that I couldn't get around."
What happened in the hallway
Early in the morning of April 9, 2014, Hribal began the stabbing spree, using a pair of 8-inch kitchen knives to slash those in his path.
The Franklin Regional Senior High School assistant principal tackled Hribal to the ground to end five gory, terrifying minutes inside his school, Murrysville, Pennsylvania, police Chief Thomas Seefeld said in a press conference after the incident.
Hribal refused to drop the knives even when he was tackled. "My work is not done, I have more people to kill," Hribal said, according to the criminal complaint.
Authorities looking through his locker found "a document" -- dated April 6, three days before the mass stabbing -- signaling Hribal's intentions to kill, according to the criminal complaint.
One part of it read: "I can't wait to see the priceless and helpless looks on the faces of the students of one of the 'best schools in Pennsylvania' realize their previous lives are going to be taken by the only one among them that isn't a plebeian."
His parents and classmates insisted afterward that they didn't see the horror coming. Thomassey, his lawyer, described him as a well-liked and "typical young kid" who had "never been in trouble."
Clarification: This story and the headline have been updated to clarify Alex Hribal's current age. He was a teen at the time of his arrest.