A would-be school shooter was tackled by a teacher in Washington state on Monday morning, before anyone could be killed or injured.

The gunman, who was taken into police custody but not immediately identified, fired several shots at the commons of North Thurston high school in Lacey, Washington. Students say a teacher approached him from behind and tackled him to the ground, and was then aided by more teachers in holding the shooter down. The school district confirmed in a statement that staff had apprehended the gunman.

Lacey police locked down the building, and the school district said classes would be dismissed for the day after police finished searching the school. Students, many shaken, gathered at the school’s stadium to meet with parents.

“When safety of area is confirmed, reunification will take place at the football stadium after a full accounting of all students has been completed,” the school district said on its website.

Student Devin Santos described the shooter to local Fox affiliate Q13, saying he “was a white male, he had kind of a Justin Bieber haircut, it was black hair”, and adding: “I did not recognize that kid.”

The description matched what other students said on social media: the suspect was described as a 15- or 16-year-old student, dressed all in black and with long hair. He was said to have been armed with a handgun.

School district spokesperson Courtney Schrieve said reports appeared correct that Brady Olson, who teaches government and civics, tackled the gunman from behind. He is “obviously a very brave man who probably saved a lot of people”, Schrieve told Q13.

“I owe Mr Olson my life. I think we all do. I wouldn’t have had the courage to do that,” tweeted one student, Joseph Delacruz.

“I think it’s heroic,” police commander Chris Ward told local K5 news about the teacher’s actions. “People rise to the occasion when they need to do something.”

Olson did not immediately return a call to his house.

Students described a scene of chaotic flight, many hurtling toward the parking lot as word of the active shooter spread. Many students ran to their cars and tried to leave the campus, clogging up the parking lot as police arrived.

Beverly Barrett, another student, told Q13 she was “maybe 20ft away from the shooter” when he opened fire, but initially thought the bang of his first shot was only a falling table.

“All of a sudden we saw this kid, and we saw his hand go up in the air with something black in it, obviously it was a gun,” she said.

“Next thing I knew the whole school started screaming, everyone starts running toward the door ... There were people running and pushing people out the door, it was crazy.”

Other students were locked down in their classrooms, sheltering in place as many schools teach in preparation for active shooter emergencies. Some texted parents as they hid, some screenshots of which ended up on social media, conveying a state of terrified uncertainty.

“Mom we are hiding right now,” wrote one student, “but there is a kid at school with a gun there’s were a few shoots and we’re all okay we’re all hiding mom I don’t want to say.”

Student Rodolfo Ruedas told Q13 he was worried by the panicked reaction that swept through the school.

“It’s either fight or flight or in some cases freeze,” he said. “But everybody was running.”