The motive for a horrific knife rampage at a Pennsylvania high school remains a mystery because the teenage suspect is not talking and many of the victims remain in hospital, police have said.

Alex Hribal, 16, is accused of maiming 21 pupils and a guard at the 1,200-student Franklin Regional High School in Murraysville, east of Pittsburgh, on Wednesday . The charges against him include four counts of attempted murder and 21 counts of aggravated assault.

"At this point I don't have anybody that was targeted," police chief Thomas Seefeld said. "I know the issue of bullying has been brought up but his attorney has even said...that bullying is not part of this and we have no evidence or reason to believe that it is."

Five pupils are in hospital, with four - one 15-year-old, two 16-year-olds and one 17-year-old - in a critical condition. Three others have been released.

Hribal used two kitchen knives he brought from home, his lawyer said, in an apparent random attack on other pupils that began minutes before the start of classes in a crowded hallway, setting off a stampede.

Police said Hribal flailed away with the knives down a long stretch of a hallway, leaving blood on the walls and floor.

Two of the most seriously wounded students were found in a classroom, but it was not known whether they had sought refuge there or were attacked there, the chief said.

Police cannot get information from Hribal because his brief, who is seeking a psychiatric evaluation of the boy, "has lawyered him up", Mr Seefeld said.

"It's a little hard to get his side of things right now," he said.

The rampage, which police said lasted only minutes, was stopped when Hribal was tackled by an assistant principal.

After being taken into custody, he made statements suggesting he wanted to die, a prosecutor said, and Mr Seefield said the boy had said "he wanted someone to kill him".

The police chief and district attorney John Peck said they were limited in what information they could release because they still have a crime to prosecute, unlike some other school attacks that ended with student gunmen killing themselves.

Hribal's lawyer did not immediately return a call for comment, but he has said the boy's family remains as puzzled as police by the attack.