Suspect arrested following knife attacks and stampede which leaves blood on the floor and walls.
At least five students were critically wounded, including a boy whose liver was pierced by a knife thrust that narrowly missed his heart and aorta, doctors said. Others also suffered deep abdominal puncture wounds.
Police shed little light on the motive.
The suspect, Alex Hribal, was taken into custody and treated for a minor hand wound, then was brought into court in shackles and a hospital gown and charged with four counts of attempted homicide and 21 counts of aggravated assault. He was jailed without bail, and authorities said he would be prosecuted as an adult.
At the brief hearing, District Attorney John Peck said that after he was seized, Hribal made comments suggesting he wanted to die.
Defence attorney Patrick Thomassey described him as a good student who got along with others, and asked for a psychiatric examination.
The attack unfolded in the morning just minutes before the start of classes at the 1,200 student Franklin Regional High School, in an upper-middle-class area 15 miles (24km) east of Pittsburgh.
It was over in about five minutes, during which the boy ran wildly down about 200 feet (61m) of hallway, slashing away with knives 8 to 10 inches long, police said.
Mr Nate Moore, 15, said he saw the boy tackle and knife a freshman. He said he was going to try to break it up when the boy got up and slashed Moore’s face, opening 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,” Mr Moore said.
The attacker “had the same expression on his face that he has every day, which was the freakiest part,” he said. “He wasn’t saying anything. He didn’t have any anger on his face. It was just a blank expression.”
Assistant Principal Sam King finally tackled the boy and disarmed him, and a Murrysville police officer who is regularly assigned to the school handcuffed him, police said.
Mr King’s son told The Associated Press that his father was treated at a hospital, though authorities said he was not knifed.
“He says he’s OK. He’s a tough cookie and sometimes hides things, but I believe he’s OK,” Mr Zack King said. He added: “I’m proud of him.”
In addition to the 22 stabbed or slashed, two people suffered other injuries, authorities said. The security guard, who was wounded after intervening early in the melee, was not seriously hurt.
“There are a number of heroes in this day. Many of them are students,” Gov Tom Corbett said during a visit to the stricken town. “Students who stayed with their friends and didn’t leave their friends.”
As for what set off the attack, Murrysville Police Chief Thomas Seefeld said investigators were looking into reports of a threatening phone call between the suspect and another student the night before. Mr Seefeld didn’t specify whether the suspect received or made the call.
The FBI went to the boy’s house, where authorities planned to confiscate and search his computer.
“They are a very nice family. A great family. We never saw anything out of the ordinary,” said Mr John Kukalis, a next-door neighbour for about 13 years.
His wife, Ms Sonya Kukalis, said: “It should be an eye-opener for everybody. Everyone always thinks it’s the other neighbourhood, the other town. We need to be kinder and show compassion to more people. Something must have been going on for him to do this.”
While several bloody stabbing rampages at schools in China have made headlines in the past few years, schools in the US have concentrated their emergency preparations on mass shooting.
Nevertheless, there have been at least two major stabbing attacks at US schools over the past year, one at a community college in Texas last month that wounded at least 14 people, and another, also in Texas, that killed a 17-year-old student and injured three others at a high school in September.
Yesterday, Ms Mia Meixner, 16, said the rampage touched off a “stampede of kids” yelling, “Run! Get out of here! Someone has a knife!”
The boy had a “blank look,” she said. “He was just kind of looking like he always does, not smiling, not scowling or frowning.”
Ms Meixner and Mr Moore called the attacker a shy boy who largely kept to himself, but they said he was not an outcast and they had no reason to think he might be violent.
“He was never mean to anyone, and I never saw people be mean to him,” Ms Meixner said. “I never saw him with a particular group of friends.”
Mr Michael Float, 18, said he had just gotten to school when he saw “blood all over the floor” and smeared on the wall near the main entrance. Then he saw a wounded student.
“He had his shirt pulled up and he was screaming, `Help! Help!’” Float said. “He had a stab wound right at the top right of his stomach, blood pouring down.”
Float said he saw a teacher applying pressure to another student’s wound.
About five minutes elapsed between the time the campus police officer summoned help over the radio at 7:13am and the boy was disarmed, the police chief said.
Someone, possibly a student, pulled a fire alarm during the attack, Mr Seefeld said. Although that created chaos, the police chief said, it emptied out the school more quickly, and “that was a good thing that was done.”
Also, a girl with “an amazing amount of composure” applied pressure to a schoolmate’s wounds and probably kept the victim from bleeding to death, said Dr Mark Rubino at Forbes Regional Medical Centre.
Public safety and school officials said an emergency plan worked as well as could be expected. The district conducted an emergency exercise three months ago and a full-scale drill about a year ago.
“We haven’t lost a life, and I think that’s what we have to keep in mind,” said county public safety spokesman Dan Stevens.