UVALDE, Texas— Nearly 20 officers stood for about 45 minutes in the hallway outside the adjoining Texas classrooms where the gunman killed students and teachers this week before U.S. Border Patrol agents unlocked the door to confront and kill him, authorities said Friday. At least some of the 911 calls made during the Tuesday attack on Robb Elementary School in Uvalde came from inside the connected classrooms where 18-year-old Salvador Ramos was holed up, Steven McCraw, the head of the Texas Department of Public Safety, said during a contentious news conference. The commander at the scene believed Ramos was barricaded inside and that the children were not at risk, McCraw said. “It was the wrong decision,” he said. McCraw released new details about the attack in which Ramos killed 19 children teachers, though his motive remains unclear. The Border Patrol agents eventually used a master key to open the locked door of the classroom where they confronted and killed Ramos, he said. There was a barrage of gunfire shortly after Ramos entered the classroom where officers eventually killed him, but that shots were “sporadic” for much of the 48 minutes when officers waited in the hallway, McCraw said.