This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

UVALDE, Texas (AP) — Frustrated onlookers urged police officers to charge into the Texas elementary school where a gunman’s rampage killed 19 children and two teachers, witnesses said Wednesday, as investigators worked to track the massacre that lasted upwards of 40 minutes and ended when the 18-year-old shooter was killed by a Border Patrol team.

“Go in there! Go in there!” nearby women shouted at the officers soon after the attack began, said Juan Carranza, 24, who saw the scene from outside his house, across the street from Robb Elementary School in the close-knit town of Uvalde. Carranza said the officers did not go in.

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 the building.

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.

Minutes earlier, Carranza had watched as Salvador 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 nearby funeral home who ran away uninjured.

Officials say he “encountered” a school district security officer outside the school, though there were conflicting reports from authorities on whether the men exchanged gunfire. After running inside, he fired on two arriving Uvalde police officers who were outside the building, said Texas Department of Public Safety spokesperson Travis Considine. The police officers were injured.

After entering the school, Ramos charged into one classroom and began to kill.

He “barricaded himself by locking the door and just started shooting children and teachers that were inside that classroom,” Lt. Christopher Olivarez of the Department of Public Safety told CNN. “It just shows you the complete evil of the shooter.”

All those killed were in the same classroom, he said.

Department of Public Safety Director Steve McCraw told reporters that 40 minutes to an hour elapsed from when Ramos opened fire on the school security officer to when the tactical team shot him, though a department spokesman said later that they could not give a solid estimate of how long the gunman was in the school or when he was killed.

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

Meanwhile, a law enforcement official familiar with the investigation said 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 the condition of anonymity because he was not authorized to speak publicly about the ongoing investigation.

Carranza said the officers should have entered the school sooner.

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

Uvalde is a largely Latino town of some 16,000 people about 75 miles (120 kilometers) from the Mexican border. Robb Elementary, which has nearly 600 students in second, third and fourth grades, is a single-story brick structure in a mostly residential neighborhood of modest homes.

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

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 small yard to the truck parked in front of the house. He seemed panicked, Gallegos said, and had trouble getting the truck out of park.

Then he raced away: “He spun out, I mean fast,” spraying gravel in the air.

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

Gallegos, whose wife called 911, said he had heard no arguments before or after the shots, and knew of no history of bullying or abuse of Ramos, who he rarely saw.

Investigators also shed no light on Ramos’ motive for the attack, which also left at least 17 people wounded. Texas Gov. Greg Abbott said Ramos, a resident of the small town about 85 miles (135 kilometers) west of San Antonio, had no known criminal or mental health history.

“We don’t see a motive or catalyst right now,” said McCraw of the Department of Public Safety.

Ramos legally bought the rifle and a second one like it last week, just after his birthday, authorities said.

About a half-hour before the mass shooting, Ramos sent the first of three online messages warning about his plans, Abbott said.

Ramos wrote that he was going to shoot his grandmother, then that he had shot the woman. In the last note, sent about 15 minutes before he reached Robb Elementary, he said he was going to shoot up an elementary school, according to Abbott. Investigators said Ramos did not specify which school.

Ramos sent the private, one-to-one text messages via Facebook, said company spokesman Andy Stone.

Grief engulfed Uvalde as the details emerged.

The dead included Eliahna Garcia, an outgoing 10-year-old who loved to sing, dance and play basketball; a fellow fourth-grader, Xavier Javier Lopez, who had been eagerly awaiting a summer of swimming; and a teacher, Eva Mireles, whose husband is an officer with the school district’s police department.

“You can just tell by their angelic smiles that they were loved,” Uvalde Schools Superintendent Hal Harrell said, fighting back tears as he recalled the children and teachers killed.

The tragedy was the latest in a seemingly unending wave of mass shootings across the U.S. in recent years. Just 10 days earlier, 10 Black people were shot to death in a racist attack at a Buffalo, New York, supermarket.

The attack was the deadliest school shooting in the U.S. since a gunman killed 20 children and six adults at Sandy Hook Elementary in Newtown, Connecticut, in December 2012.

Amid calls for tighter restrictions on firearms, the Republican governor repeatedly talked about mental health struggles among Texas young people and argued that tougher gun laws in Chicago, New York and California are ineffective.

Democrat Beto O’Rourke, who is running against Abbott for governor, interrupted Wednesday’s news conference, calling the tragedy “predictable.” Pointing his finger at Abbott, he said: “This is on you until you choose to do something different. This will continue to happen.” O’Rourke was escorted out as some in the room yelled at him. Uvalde Mayor Don McLaughlin yelled that O’Rourke was a “sick son of a bitch.”

Texas has some of the most gun-friendly laws in the nation and has been the site of some of the deadliest shootings in the U.S. over the past five years.

“I just don’t know how people can sell that type of a gun to a kid 18 years old,” Siria Arizmendi, the aunt of victim Eliahna Garcia, said angrily through tears. “What is he going to use it for but for that purpose?”

President Joe Biden said Wednesday that “the Second Amendment is not absolute” as he called for new limitations on guns in the wake of the massacre.

But the prospects for reform of the nation’s gun regulations appeared dim. Repeated attempts over the years to expand background checks and enact other curbs have run into Republican opposition in Congress.

The shooting came days before the National Rifle Association annual convention was set to begin in Houston, with the Texas governor and both of the state’s Republican U.S. senators scheduled to speak.

Dillon Silva, whose nephew was in a classroom, said students were watching the Disney movie “Moana” when they heard several loud pops and a bullet shattered a window. Moments later, their teacher saw the attacker stride past.

“Oh, my God, he has a gun!” the teacher shouted twice, according to Silva. “The teacher didn’t even have time to lock the door,” he said.

The close-knit community, built around a shaded central square, includes many families who have lived there for generations.

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.”