Sophomore student Alex Hribal was taken into custody, said Captain Rob Liermann of the Murrysville Police Department.
The 16-year-old stabbed or slashed at his victims in the halls of Franklin Regional High School before being subdued by school authorities, AFP reported.
At least five students were critically wounded, including a boy who was on a ventilator after a knife pierced his liver, missing his heart by only millimetres, doctors said.
Witnesses said Hribal at first tackled a freshman and stabbed him in the belly, then got up and ran wildly down the hall, slashing at other students.
Nate Moore, 15, said he saw the first attack and was going to try to break it up when the attacker got up and slashed his face, delivering a wound that required 11 stitches.
“It was really fast. It felt like he hit me with a wet rag because I felt the blood splash on my face. It spurted up on my forehead,” he said.
Hribal “had the same expression on his face that he has every day, which was the freakiest part”, Moore said.
“He wasn’t saying anything. He didn’t have any anger on his face. It was just a blank expression.”
The attack unfolded just minutes before the start of classes at 1,200-student high school, located 15 miles (24 kilometres) east of Pittsburgh.
Doctors said they expected all the victims to survive.