The rampage — which came after years in which U.S. schools have geared much of their emergency planning toward mass shootings, not stabbings — set off a screaming stampede, left blood on the floor and walls, and brought teachers rushing to help the victims.
The motive was under investigation.
The suspect, whose name was not immediately released by police, was taken into custody and treated for a minor hand wound. Late in the afternoon, he was brought into court in shackles and a hospital gown to face charges.
While several bloody stabbing rampages at schools in China have made headlines in the past few years, large-scale knife attacks are almost unheard of in the U.S.
The attack unfolded in the morning just minutes before the start of classes at 1,200-student Franklin Regional High School, in an upper-middle-class area 15 miles east of Pittsburgh. It was over in a matter of minutes.
Witnesses said the boy at first tackled a freshman and stabbed him in the belly, then got up and ran wildly down the hall, slashing other students.
Nate Moore, 15, said he saw the first attack and was going to try to break it up when the boy got up and slashed his face, requiring 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.
The attacker "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."
Doctors said they expect all the victims to survive, despite large and deep abdominal puncture wounds in some cases. The wounded police officer — who was regularly assigned to the campus — was treated and released.
Authorities credited an assistant principal with subduing the assailant. They gave no details, but students identified the educator as Sam King and told local news organizations that they saw him tackle the boy after the youngster stabbed the campus officer.
King's son told The Associated Press that his father was treated at a hospital, though authorities have said he did not suffer any knife wounds.
"He says he's OK. He's a tough cookie and sometimes hides things, but I believe he's OK," Zack King said. He added: "I'm proud of him."
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. Seefeld didn't specify whether the suspect received or made the call.
Mia Meixner, 16, said the initial assault touched off a "stampede of kids" yelling, "Run! Get out of here! Someone has a knife!"
Meixner and Moore called the attacker a shy and quiet boy who largely kept to himself, but they said he was not an outcast and they saw no indication before the attack that he might be violent.
"He was never mean to anyone, and I never saw people be mean to him," Meixner said. "I never saw him with a particular group of friends."
During the attack, the boy had a "blank look," she said. "He was just kind of looking like he always does, not smiling, not scowling or frowning."
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 the wound of another student.
Someone, possibly a student, pulled a fire alarm after seeing some of the stabbings, the police chief said. Although that created chaos, Seefeld said, it emptied out the school more quickly, and "that was a good thing that 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 Center.
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.
Associated Press writer Mike Rubinkam in Allentown contributed to this report.
Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.