Several had life threatening injuries, Chris Kaufmann, the trauma medical director at Forbes Regional Hospital, told CNN.
The attack on Wednesday at Franklin Regional High School in Murrysville, a suburb of Pittsburgh, began at 7:13 am (1213 GMT) as students began arriving for what should have been a routine day.
The assault was over by 7:45 am with the suspect taken into custody almost immediately, Dan Stevens, a spokesman for Westmoreland County emergency management, told AFP.
Stevens identified the suspect as a male student.
Stevens said he was cornered by police officers who rushed to the scene. His age and identity were not immediately released.
"Twenty students were injured, four of those students were flown from the scene," Stevens told AFP.
He said the victims are aged 14 to 17. They were attacked in "numerous classrooms and hallways" of the school, Stevens added.
The school has since been evacuated.
Kaufmann said his hospital was treating seven teenage students and an adult over the age of 21.
A statement on the website of the Franklin Regional School District said a "critical incident" had occurred.
"All elementary schools are cancelled, the middle school and high school students are secure," the statement said.
Victims had been stabbed in the torso, Kaufmann said.
"These are quite serious injuries," he told CNN.
"We had two patients who went immediately to the operating room," Kaufmann said.
Wednesday's attack comes after a long and frequent line of US school shootings that have inflamed a nationwide debate over gun control in the United States.
But even the December 2012 massacre at Sandy Hook Elementary in Newtown, Connecticut, where 20 young children and six adults were shot dead, ultimately failed to tighten gun ownership rules.
HH/HH