Robb Elementary School had measures in place to prevent this kind of violence. A fence lined the school property. Teachers were ordered to keep classroom doors closed and locked. Students faced regular lockdown and evacuation drills.
But when an 18-year-old man arrived Tuesday at the school in Uvalde, Texas, intent on killing children, none of it stopped him.
Security failures allowed the shooter to massacre 19 students and two teachers, school safety experts say. The shooting already has led to calls to fortify schools further, on top of millions spent on equipment and other measures following earlier shootings. But more security offers drawbacks, with no guarantee of an end to mass violence. In the worst case, as in Uvalde, it could backfire.
"You can do the best job you can to prevent a school crisis, but we cannot read the minds of all the criminals who are out there," said Ronald Stephens, executive director of the National School Safety Center, a nonprofit that works with schools across the country. "We cannot prevent all crime."
According to a district safety plan, Uvalde schools had a wide range of measures in place to prevent violence. The district had four police officers and four support counselors, according to the plan, which appears to be dated from the 2019-20 school year. The district had software to monitor social media for threats and software to screen school visitors.
Yet when the gunman arrived at the school, he hopped its fence and easily entered through a back door that had been propped open, officials said. Behind the locked door of a fourth-grade classroom, he gunned down children and teachers.
Amid the attack, nearly 20 officers stood in a hallway because the on-site commander believed the gunman was barricaded in the classroom and children were not at risk, Texas Department of Public Safety Director Steven McCraw said at a Friday news conference, saying "it was the wrong decision."
The case underscores that even the strongest security plans can be undermined by a seemingly simple lapse, said Curtis Lavarello, executive director of the School Safety Advocacy Council, which provides training on school safety. The Texas school appeared to be doing many things right, he said, but none of that mattered once the gunman was able to walk unobstructed into the building and into a classroom.
"All those things on paper mean nothing if they're not followed in practice. And there seemed to be a number of gaps," he said.
In the aftermath of the shooting, some Republicans have been calling for further investments in school safety to prevent more attacks. Some have pushed for more armed police in schools, along with metal detectors and measures to make it harder to enter schools.
Among those promoting physical security measures is Senator Ted Cruz, a Texas Republican. Appearing on Fox News on Wednesday, he brought up 2013 legislation that created grants to help schools install bulletproof doors and hire armed police officers, among other measures.
If those grants had gone to Robb Elementary, Cruz said, "the armed police officers could have taken him out and we would have 19 children and two teachers still alive."
Security experts say the Uvalde case illustrates how fortifying schools can backfire. A lock on the classroom door — one of the most basic and widely recommended school safety measures — kept victims in and police out.
U.S. Border Patrol agents eventually used a master key to open the locked door of the classroom, where they confronted and killed the gunman, McCraw said at the Friday news conference.
Some argue that investments in school security have come at the expense of student welfare. Lockdown drills that have become routine for a generation of American students have traumatized students and added to strains on mental health, educators say.
Schools need more counselors and psychologists to help troubled students, not stronger buildings, said Dewey Cornell, a psychologist and director of the Virginia Youth Violence Project at the University of Virginia.
"We have systemically reduced the number of support staff in our schools, and focused too much on installing metal detectors and surveillance cameras and electronic door locks, which are very short term and reactive and very expensive," he said.
In the wake of the 2012 massacre at Sandy Hook Elementary School in Newtown, Connecticut, schools across the country began spending huge sums of money on fortifications, including bulletproof glass, metal detectors and armed security.
But such measures can create an atmosphere where students feel uncomfortable and less trusting, and it does not necessarily prevent attacks, said Matthew Mayer, a Rutgers University associate professor who works on issues related to school violence.
"You'll go down these sorts of endless rabbit holes of how much security is enough. And when it comes to someone who's coming in heavily armed, you're not going to stop them," Mayer said. "So the idea is you need to figure out why people do this in the first place and have ways — multilevel systems of prevention — to prevent it from happening."
He advocates for a multifaceted prevention approach that also includes steps such as improving mental health services, assessing threats more effectively and building trust so students and families are not afraid to speak up if they're concerned someone has the means or intent to cause harm.
Still, schools can only do so much, he said, and he isn't optimistic that public outrage over Uvalde will lead to significant change.
"The problem is that a lot of this public reaction, you know, sort of rises like a wave and then recedes over time, and the politicians have been accustomed to riding that out. You know, they make speeches and so forth, and sometimes there's a commission that gets appointed, and they issue reports," Mayer said. "But substantive change is lacking."