© Courtney Schrieve/North Thurston Public Schools via AP In this Monday, April 27, 2015 photo provided by the North Thurston Public Schools, school teacher Brady Olson poses for a photo at the school. The popular teacher is being hailed as a hero after tackling a 16-year-old student who fired two shots into the air Monday, April 27, 2015, at North Thurston High School in Lacey, Wash., about 60 miles southwest of Seattle, police and students said. No one was injured after the teen shot toward the ceiling in the school commons before classes began. The shooter is in custody.

SEATTLE - A student fired off two shots inside a Washington state high school on Monday and was tackled by a teacher before anyone was hurt, averting a potentially deadly tragedy, police and students said.

The 16-year-old student, armed with a revolver, shot off two rounds that struck the ceiling inside a stairwell between the first and second floors of North Thurston High School in Lacey, just outside Olympia, Lacey police commander Joe Upton said.

A government teacher at the school, identified as Brady Olson, tackled the male student before more shots could be fired, and police took the teen into custody just before 8 a.m., authorities said. Nobody was hurt.

The incident marked the latest in a growing number of school shootings that have sparked a national conversation about school safety, and came months after a student opened fire at another Washington state high school, killing four people before turning the gun on himself.

"I reacted in a way that any other teacher would react and at the sound of a gunshot, ... going toward the sound of gunfire rather than away," Olson said in a statement, adding that at least three other staff members had headed toward the shooter.

Panicked students fled the building after hearing the shots, local broadcaster KOMO reported.

"I heard a bang, but I thought it was a table that fell," student Elora Shields told the station. "And then we heard it again, and then everyone started running. So I ran outside with my friends."

Other students took to Twitter to commend the teacher.

"I owe Mr. Olson my life. I think we all do. I wouldn't have had the courage to do that," student Joseph Delacruz said.

Detectives were interviewing the student to determine why he brought the gun to school, and his early statements indicated he did not have an intended target he planned to shoot, said Lacey police commander Jim Mack.

"There were plenty of people around if he would have wanted to do that," Mack said, adding that the student was cooperating with detectives, who would recommend charges once an investigation is complete.

Classes at the school were canceled for the rest of the day.

© North Thurston High School via Facebook Exterior of North Thurston High School © Ted S. Warren/AP Parents and students walk away from an area at North Thurston High School Monday, April 27, 2015, where students were released to their parents after a shooting at the school earlier in the morning. Police say no one was injured, and school district officials say the gunman has been apprehended by staff. (AP Photo/Ted S. Warren) © Ted S. Warren/AP Photo Students at North Thurston High School in Lacey, Washington, after a shooting, April 27, 2015.