Law enforcement authorities in the southwest U.S. state of Texas are facing tough questions about their response and the length of time it took them this week to storm a school to confront a teenage gunman who had shot to death 19 children and two teachers.

Officials say the gunman, Salvador Ramos, an 18-year-old high school dropout, was in the school for 40 minutes to an hour before police barged into the fourth-grade classroom where he had killed 21 people at Robb Elementary School in the small town of Uvalde, Texas.

Witnesses say parents of the children trapped in the school located in a residential neighborhood, and onlookers who gathered at midday on Tuesday, had shouted at police to enter the school and put an end to the carnage.

One witness outside the school, Juan Caranza, 24, who watched the scene from outside his house across the street, said women shouted at police, “Go in there! Go in there!”

Police further filled in the timeline of the shooting Thursday. Victor Escalon, a regional director at the Texas Department of Public Safety, said Ramos walked into the building through an unlocked door and without encountering a school safety officer, contradicting earlier reports.

The school normally has an armed officer on duty, but when the gunman arrived Tuesday, “there was not an officer, readily available, armed,” and the gunman entered the building “unobstructed,” Escalon said.

The gunman was killed when a U.S. Border Patrol tactical team arrived, broke into the classroom and killed the gunman, Escalon said.

Law enforcement personnel near the scene of a suspected shooting near Robb Elementary School in Uvalde, Texas, May 24, 2022.

Law enforcement personnel near the scene of a suspected shooting near Robb Elementary School in Uvalde, Texas, May 24, 2022.

Javier Cazares, whose fourth-grade daughter, Jacklyn Cazares, was killed in the attack, said he raised the idea with other bystanders of storming the building themselves because he did not think police were moving fast enough.

“Let’s just rush in because the cops aren’t doing anything like they are supposed to,” he said. “More could have been done. They were unprepared.”

One bystander recorded a video posted to his Facebook account that gave his running account of parents trying desperately to get police to move quicker to rescue their children.

“These cops are right here. Bro, there’s a (expletive) shooting at the school, and these (expletive) cops are telling everybody to leave, dude, while everybody’s here trying to pick up their (expletive) kids,” the man said in an account published by The Washington Post.

Later, the man says the children “are all in there, and the cops ain’t doing (expletive) but standing outside.”

One woman, who said her son was in the school, urged police to take a shot at the gunman if they could.

“They’re kids,” she shouted. “I’m going to go, I’m going to (expletive) go.”

Texas Department of Public Safety Director Steve McCraw on Wednesday defended the police response, saying, “The bottom line is law enforcement was there. They did engage immediately. They did contain (Ramos) in the classroom” before killing him.

Escalon, of the Texas Department of Public Safety, said that two Uvalde police officer arrived four minutes later and ran into the school but were quickly pinned down when Ramos fired at them.

Authorities continued to search for a motive behind the horrific rampage, the deadliest U.S. school shooting spree in nearly a decade. They said Ramos had no known criminal or mental health history, although some acquaintances recounted his troubling anti-social behavior, such as him firing a BB gun at random people walking in Uvalde.

A 15-year-old German girl who Ramos chatted with online said he told her he “threw dead cats at people’s houses.”

Just as Ramos unleashed his attack, he texted the girl, warning her in a private message that he was about to shoot up an elementary school.

Texas Governor Greg Abbott said Wednesday that 17 others were wounded or injured in the attack, but none had life-threatening injuries. A spokesman for the Texas Department of Public Safety said the injured include “multiple children” who survived gunfire in their classroom.

The White House announced Thursday that President Joe Biden and first lady Jill Biden would travel to Texas on Sunday to grieve with the community.

Some information for this report came from The Associated Press and Reuters.