Students at Oxford High School in Michigan were huddled together, silent, as a mass shooter stalked their hallways. Then came a voice from just outside the door. “Sheriff’s office,” the male voice said. “It’s safe to come out.”

They paused for a moment. Then someone replied, “We’re not willing to take that risk right now.” The man at the door protested. “Well come to the door and look at my badge, bro.”

With that, the students began to stir. “He said `bro'! He said ‘bro’!” one girl said.

“He said ‘bro.’ Red flag,” agreed a boy.

“Go, go!” someone cried, and suddenly the students all jumped, climbing through a window to the snowy ground outside, and then to safety.

As it turns out, the man outside the door was not the suspect, officials said Wednesday. But the moment, posted on TikTok and then circulated widely on other social media, captured for many not just the fear that gripped the students but the importance of training that has been drilled into American schoolchildren for decades now about how to handle an active shooter situation: with every possible caution.

States and school districts have considered and adopted a wide range of strategies meant to thwart potential attacks. That includes hardening buildings by limiting entry points, locking doors and installing surveillance cameras. Many have stationed police, known as school resource officers, into schools.

But many experts say that none of those strategies matter if students and staff are not properly trained in what to do when confronted with an active shooter.

In the hours after the shooting outside Detroit on Tuesday, Oakland County Sheriff Michael Bouchard said that without the measures taken by students, the tragedy would have been worse.

“It is also evident from the scene that the lockdown protocols, training and equipment Oxford schools had in place saved lives,” he said in a statement.

Oakland County Sheriff Michael Bouchard shared the first details about the weapon used in the deadly shooting at Oxford High School on Nov. 30. (AP)

The Center for Homeland Defense and Security, which maintains a database of K-12 school shootings, has totaled nine active shooter incidents in schools this calendar year, in addition to more than 200 other incidents of gunfire on school grounds. A Washington Post database, which uses different criteria, tallied 34 acts of gun violence on K-12 campuses during regular school hours. This year has seen a record number of violent acts at schools, though no increase in mass shootings.

David Riedman, lead researcher on the K-12 School Shooting Database, said that the lockdown procedures that were deployed in Oxford, in which students sheltered and stayed out of sight, “absolutely saved lives.” The training that appeared to be on display in Michigan is similar to what students all over the country are taught, he said.

Another image from inside the school showed desks piled up to barricade a classroom door. A bullet had pierced the door but did not hit anybody. Aiden Page, a senior at Oxford High who took the photograph from inside the classroom, said the students followed the protocols they had been taught.

“We lock the door,” he told CNN. “We have this jammer called a Nightlock. We barricaded as best as we can and then we try to hide. … We grabbed calculators, we grabbed scissors and just in case the shooter got in and we had to attack them.”

There are no national standards for how to prepare for the possibility of a mass shooting on campus. In some cases, students are taught the basics: barricade and lock the doors, turn off the lights, stay silent. In other cases, students are taught ways to engage with an assailant — throwing a stapler, for instance, or otherwise fighting back.

A few of the leading ideas are controversial. Locking down a school, even for a training, can be traumatic for students and staff, Riedman said. Some districts have conducted “ultra realistic” school shooting drills, sometimes without notifying staff or students that it is a drill, with an actor posing as a shooter running through the hallways.

“Just like you don’t need to light the building on fire to practice a fire alarm, the evidence shows these ultra realistic shooting drills are unnecessary,” Riedman said.

Expensive technology has also been aggressively marketed to schools. Some of it, such as locks on classroom doors, may be effective. Other innovations, such as a bulletproof whiteboard, offer questionable or unknown results.

Some districts have responded to the threats by adding school resource officers, but critics argue that police in school lands more students — particularly students of color — in the criminal justice system at a young age, accelerating the so-called school-to-prison pipeline.

And some have advocated for arming teachers, a controversial proposal that critics say would make schools more, not less, dangerous.

Certain techniques have inherent limitations. A school shooter who is enrolled in the school can easily come to campus, so a locked door doesn’t help. Some are suicidal and may not be deterred by armed officers.

“If you know there’s going to be armed guards on the scene, that might be part of the plan,” said James Densley, professor of criminal justice at Metropolitan State University in St. Paul, Minn., and co-founder of the Violence Project, a study of mass shootings in the United States. “More guns on the scene results in more casualties.”

The most effective approach might not feel like security at all, Densley said. He suggests schools hire more counselors, reduce class sizes and otherwise work to connect to students who may be emotionally troubled. “Those things don’t feel like school safety but actually they are,” he said. “It’s a hard sell.”

There’s more consensus around training for lockdowns. Elizabeth Brown, principal of Forest High School in Ocala, Fla., said she watched the video out of Oxford High School and recognized the training that the students had been given. It’s similar, she said, to the training in her school, which uses a popular system called ALICE — an acronym for alert, lockdown, inform, counter and evacuate.

“We will run a drill where we say there is an alleged perpetrator on campus and we need everyone to go into ALICE protocol,” she said. “They lock their doors, barricade doors, go into a safe zone and silence.”