Alex Hribal, a Franklin High School sophomore, will be charged as an adult.
He faces multiple counts of attempted homicide, aggravated assault and possession of a weapon on school grounds, according to court documents.
He had injured one security guard and 21 fellow students by the time he was confronted by Assistant Principal Sam King, who tackled him to the ground.
Though four people suffered serious injuries, all the wounded are expected to survive the incident.
Hribal's is currently in a Westmoreland County juvenile detention center. His preliminary hearing is set for April 30.