UVALDE, Texas (AP) — Law enforcement authorities faced questions and criticism Thursday over how much time elapsed before they stormed a Texas elementary school classroom and put a stop to the rampage by a gunman who killed 19 children and two teachers.

Investigators were also unable to say with any certainty whether an armed school district security officer outside Robb Elementary in the town of Uvalde exchanged fire with the attacker, 18-year-old Salvador Ramos, when Ramos first arrived on Tuesday.

The motive for the massacre — the nation’s deadliest school shooting since Newtown, Connecticut, a decade ago — remained under investigation, with authorities saying Ramos had no known criminal or mental health history.

During the siege, which ended when a U.S. Border Patrol team burst in and shot the gunman to death, frustrated onlookers urged police officers to charge into the school, according to witnesses.

“Go in there! Go in there!” women shouted at the officers soon after the attack began, said Juan Carranza, 24, who watched the scene from outside a house across the street.

Texas Department of Public Safety Director Steve McCraw said Wednesday that 40 minutes to an hour elapsed from when Ramos opened fire on the school security officer to when the tactical team shot him.

“The bottom line is law enforcement was there,” McCraw said. “They did engage immediately. They did contain (Ramos) in the classroom.”

But a department spokesman said Thursday that authorities were still working to clarify the timeline of the attack, uncertain whether that period of 40 minutes to an hour began when the gunman reached the school, or earlier, when he shot his grandmother at home.

“Right now we do not have an accurate or confident timeline to provide to say the gunman was in the school for this period,” Lt. Christopher Olivarez told CNN.

Border Patrol Chief Raul Ortiz did not give a timeline but said repeatedly that the tactical officers from his agency who arrived at the school did not hesitate. He said they moved quickly to enter the building, lining up in a “stack” behind an agent holding up a shield.

“What we wanted to make sure is to act quickly, act swiftly, and that’s exactly what those agents did,” Ortiz told Fox News.

A law enforcement official said that once in the building, the Border Patrol agents had trouble breaching the classroom door and had to get a staff member to open the room with a key. The official spoke on condition of anonymity because he was not authorized to talk publicly about the investigation.

Olivarez said investigators were trying to establish whether the classroom was, in fact, locked or barricaded in some way.

Javier Cazares, whose fourth grade daughter, Jacklyn Cazares, was killed in the attack, said he raced to the school when he heard about the shooting, arriving while police were still gathered outside. Upset that police were not moving in, he raised the idea of charging into the school with several other bystanders.

“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,” he added.

Carranza had watched as Ramos crashed his truck into a ditch outside the school, grabbed his AR-15-style semi-automatic rifle and shot at two people outside a funeral home, who ran away uninjured.

Olivarez told CNN that the school security officer outside was armed and that initial reports said he and Ramos exchanged gunfire, “but right now we’re trying to corroborate that information.”

As Ramos entered the school, two Uvalde police officers exchanged fire with him, and were wounded, according to Olivarez. Ramos went into a classroom and began to kill.

Carranza said the officers should have entered the school sooner.

“There were more of them. There was just one of him,” he said.

On Wednesday night, hundreds packed the bleachers at the town’s fairgrounds for a vigil. Some cried. Some closed their eyes tight, mouthing silent prayers. Parents wrapped their arms around their children as the speakers led prayers for healing.

Before attacking the school, Ramos shot and wounded his grandmother at the home they shared.

Neighbor Gilbert Gallegos, 82, who lives across the street and has known the family for decades, said he was puttering in his yard when he heard the shots. Ramos ran out the front door and across the yard to a truck parked in front of the house and raced away: “He spun out, I mean fast,” spraying gravel in the air, Gallegos said.

Ramos’ grandmother emerged covered in blood: “She says, ‘Berto, this is what he did. He shot me.’” She was hospitalized.

Gallegos said he had heard no arguments before or after the shots, and knew of no history of bullying or abuse of Ramos, whom he rarely saw.

Lorena Auguste was substitute teaching at Uvalde High School when she heard about the shooting and began frantically texting her niece, a fourth grader at Robb Elementary. Eventually she found out the girl was OK. But that night, her niece had a question.

“Why did they do this to us?” the girl asked. “We’re good kids. We didn’t do anything wrong.”