UVALDE, TEXAS -- Students trapped inside a classroom with a gunman repeatedly called 911 during this week’s attack on a Texas elementary school, including one who pleaded, “Please send the police now,†as officers waited more than an hour to breach the classroom after following the gunman into the building, authorities said Friday.

The commander at the scene in Uvalde — the school district’s police chief — believed that 18-year-old gunman Salvador Ramos was barricaded inside adjoining classrooms at Robb Elementary School and that children were no longer at risk, Steven McCraw, the head of the Texas Department of Public Safety, said at a contentious news conference.

“It was the wrong decision,†he said.

Friday’s briefing came after authorities spent three days providing often conflicting and incomplete information about the more than an hour that elapsed between the time Ramos entered the school and when U.S. Border Patrol agents unlocked the classroom door and killed him.

Three police officers followed Ramos into the building within two minutes. In the next half hour, as many as 19 officers piled into the hallway outside. But another 47 minutes passed before the Border Patrol tactical team breached the door, McCraw said.

As the gunman fired at students, law enforcement officers from other agencies urged the school police chief to let them move in because children were in danger, two law enforcement officials said.

The officials spoke on condition of anonymity because they had not been authorized to speak publicly about the investigation.

One of the officials said audio recordings from the scene capture officers from other agencies telling the school police chief that the shooter was still active and that the priority was to stop him.

Ramos killed 19 children and two teachers inside the room. His motive remained unclear, authorities said.

There was a barrage of gunfire shortly after Ramos entered the classroom where officers eventually killed him, but those shots were “sporadic†for much of the time that officers waited in the hallway, McCraw said. He said investigators do not know if children died during that time.

Throughout the attack, teachers and children repeatedly called 911 asking for help, including the girl who pleaded for the police, McCraw said.

Young survivors of the attack said they pretended to be dead while waiting for help.

Miah Cerrillo, 11, told CNN that she covered herself with a friend’s blood to look dead. After the shooter moved into an adjacent room, she could hear screams, more gunfire and music being blared by the gunman. Samuel Salinas, 10, who also played dead, told ABC’s “Good Morning America†that the assailant shot teacher Irma Garcia before firing on the kids.

Questions have mounted over the amount of time it took officers to enter the school to confront the gunman.

It was 11:28 a.m. Tuesday when Ramos' Ford pickup slammed into a ditch behind the low-slung Texas school and the driver jumped out carrying an AR-15-style rifle. Five minutes after that, authorities said, Ramos entered the school and found his way to the fourth grade classroom where he killed the 21 victims.

But it was not until around 12:50 p.m. that police killed Ramos, McCraw said, when shots could be heard over a 911 call from a person inside the classroom as officers breached the room.

What happened during that time frame, in a working-class neighbourhood near the edge of Uvalde, has fuelled mounting public anger and scrutiny over law enforcement's response to Tuesday's rampage.

"They say they rushed in," said Javier Cazares, whose fourth grade daughter, Jacklyn Cazares, was killed in the attack, and who raced to the school as the massacre unfolded. “We didn’t see that.â€

According to the new timeline provided by McCraw, after crashing his truck, Ramos fired on two people coming out of a nearby funeral home, officials said.

Contrary to earlier statements by officials, a school district police officer was not at the school when Ramos arrived. When that officer did respond, he unknowingly drove past Ramos, who was crouched behind a car parked outside and firing at the building, McCraw said.

At 11:33 a.m., Ramos entered the school through a rear door that had been propped open and fired more than 100 rounds into a pair of classrooms, McCraw said. He did not address why the door was propped open.

Two minutes later, three local police officers arrived and entered the building through the same door, followed soon after by four others, McCraw said. Within 15 minutes, officers from different agencies had assembled in the hallway, taking sporadic fire from Ramos, who was holed up in a classroom.

Ramos was still inside at 12:10 p.m. when the first U.S. Marshals Service deputies arrived. They had raced to the school from nearly 70 miles (113 kilometres) away in the border town of Del Rio, the agency said in a tweet Friday.

But the commander inside the building — the school district's police chief, Pete Arredondo — decided the group should wait to confront the gunman, on the belief that the scene was no longer an active attack, McCraw said.

The crisis came to an end at 12:50 p.m., after officers used keys from a janitor to open the classroom door, entered the room and fatally shot Ramos, he said.

Arredondo could not be reached for comment Friday. No one answered the door at his home, and he did not reply to a phone message left at the district's police headquarters.

Gov. Greg Abbott, who at a Wednesday news conference lauded the police response, said Friday that he was “misled,†and he’s “livid.â€

In his earlier statements, the governor told reporters, he was repeating what he had been told. “The information that I was given turned out, in part, to be inaccurate,†he said.

Abbott said exactly what happened needs to be “thoroughly, exhaustively†investigated.

The governor previously praised law enforcement for their “amazing courage by running toward gunfire†and their “quick response.â€

On Friday, Abbott had been set to attend the annual convention of the National Rifle Association, which is being held across the state in Houston. Instead he addressed the gun-rights group's convention by recorded video and went to Uvalde.

At the convention, speaker after speaker took the stage to say that changing U.S. gun laws or further restricting access to firearms isn’t the answer.

“What stops armed bad guys is armed good guys,†Texas Sen. Ted Cruz told those gathered in Houston.

Former President Donald Trump was among Republican leaders speaking at the event, where hundreds of protesters angry about gun violence demonstrated outside, including some who held crosses with photos of the Uvalde victims.

The motive for the massacre — the nation's deadliest school shooting since Newtown, Connecticut, almost a decade ago — remained under investigation. Authorities have said Ramos had no known criminal or mental health history.

During the siege, 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.

Cazares said that when he arrived, he saw two officers outside the school and about five others escorting students out of the building. But 15 or 20 minutes passed before the arrival of officers with shields, equipped to confront the gunman, he said.

As more parents flocked to the school, he and others pressed police to act, Cazares said. He heard about four gunshots before he and the others were ordered back to a parking lot.

“A lot of us were arguing with the police, ‘You all need to go in there. You all need to do your jobs.’ Their response was, ‘We can’t do our jobs because you guys are interfering,’†Cazares said.

The many chilling details of the attack were enough to leave parents struggling with dread.

Visiting a downtown memorial to those killed, Kassandra Johnson of the nearby community of Hondo said she was so worried the day after the attack that she kept her twin boys home from school.

Before she sent the 8-year-olds back, she studied the school building, figuring out which windows she would need to break to reach them. And she drew hearts on their hands with marker, so she could identify them if the worst happened, Johnson said, as she put flowers near 21 white crosses honouring the victims.

“Those kids could be my kids,†she said.

___

Associated Press reporters Claire Galofaro in Uvalde, Jake Bleiberg in Dallas and Mike Balsamo in Washington contributed to this report.