A student brandishing two knives injured multiple people inside a high school near Pittsburgh, Pa., on Wednesday morning, before he was tackled by an assistant principal.

The nightmarish scene unfolded inside Franklin Regional Senior High School in Murrysville, about half an hour east of Pittsburgh.

Shortly before 7:15 a.m., the suspect, a 16-year-old sophomore at the school, made his way down a hallway “flashing two knives around,” Thomas Seefeld, the Murrysville police chief, said in a news conference Wednesday. The two straight blades were each about eight to 10 inches long, Seefeld said.

Authorities later identified the suspect as Alex Hribal, and said he will be charged as an adult.

The ordeal lasted for about five minutes before the assailant was subdued. Twenty-two people were injured, all of them students except for the school security guard; the guard had a stomach wound when he was found on the first floor hallway by police. Four of the victims suffered critical injuries, Seefeld said, and by Wednesday afternoon two of them remained critically injured.

Police arrived to find “a chaotic scene outside, with people running everywhere,” Seefeld said. The crime scene covered an entire hallway in one wing of the school, he said.

“What we saw when we got there was a hallway that was pretty much in chaos, as you could imagine,” he said.

The suspect, who had some injuries to his hand, was placed under arrest and taken into police custody. He was already detained when police arrived, Seefeld said, owing to the assistant principal who tackled him and the school resource officer who handcuffed him.

Hribal’s attorney, Patrick Thomassey, said the teen is a good student who got along with well with others, according to the Associated Press.

Sam King is the assistant principal who tackled the attacker, authorities said. “I’m proud of him,” Zack King, his son, told the Associated Press.

Someone also pulled the fire alarm, which Seefeld said was the right thing to do, because it got people to evacuate the school. He said all of these actions combined to perhaps avert what could have been a more catastrophic situation.

“I think it could have been a lot worse if there wasn’t immediate interaction that occurred,” Seefeld said.

It’s unclear what prompted the violence. Seefeld said that authorities were looking into a report that a threatening phone call had been made to a student at the school the previous night.

“We don’t know what led up to this,” he said.

Federal and state authorities are helping the ongoing investigation, which Seefeld said will continue over the coming days.

The school was locked down as a result of the stabbings. Parents of students at Franklin Senior High were told to pick up their students at nearby Heritage Elementary School.

“This is obviously a very difficult day for this community,” Pennsylvania Gov. Tom Corbett (R) said at a news conference Wednesday.

Eight people in conditions ranging from “critical to serious” were brought from the school to Forbes Regional Hospital in Monroeville, the closest trauma center to the school, said Jesse Miller, a spokesman for the hospital.

Seven of these patients were between the ages of 15 and 17, while the eighth person was an adult and not a student, he said. Another patient was airlifted to Allegheny General Hospital in Pittsburgh.

A student recovering after the stabbing appeared to post a selfie from the hospital on Wednesday morning, showing a forearm wrapped in bandages, which sparked a bit of a backlash.

“Tragedies that strike communities—whether it’s an inner city school or in a suburban school in a quiet town—impact us all,” Secretary of Education Arne Duncan said in a statement. “When we send our children to school each day, we expect them to return home safely. Staff and students at every school deserve to work and learn in a safe environment.”

Police say four students are in critical condition and as many as 20 are injured after a stabbing at a Pennsylvania high school took place on Wednesday. (Reuters)

This is a developing story. We will bring you updates as we get them. First posted: 9:44 a.m. Last update: 10:01 p.m. (to note that it’s Gov. Tom, not John, Corbett).