By ACACIA CORONADO and JIM VERTUNO Associated Press

UVALDE, Texas (AP) — The 18-year-old gunman who slaughtered 19 children and two teachers at a Texas elementary school barricaded himself inside a single classroom and “began shooting anyone that was in his way,” authorities said Wednesday in detailing the latest mass killing to rock the U.S.

Law enforcement officers eventually broke into the classroom and killed the gunman. Police and others responding to Tuesday’s attack also went around breaking windows at the school to enable students and teachers to escape, Lt. Christopher Olivarez of the Texas Department of Public Safety said Wednesday on NBC’s “Today.”

READ MORE: Maryland Weather: Warm & Dry Fourth Of July Forecast

Olivarez told CNN that all the victims were in the same fourth-grade classroom at Robb Elementary.

The killer “barricaded himself by locking the door and just started shooting children and teachers that were inside that classroom,” he said. “It just shows you the complete evil of the shooter.”

Investigators did not immediately disclose a motive but identified the assailant as Salvador Ramos, a resident of the community about 85 miles (135 kilometers) west of San Antonio. Olivarez said investigators were working with the FBI and looking at social media to see if there were any “red flags” before the shooting.

Ramos had hinted on social media that an attack could be coming, according to state Sen. Roland Gutierrez, who said he had been briefed by state police. He said that the gunman “suggested the kids should watch out” and that he had bought two “assault weapons” after turning 18.

Investigators believe Ramos posted photos on Instagram of two guns he used in the shooting.

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

Families waited hours for word on their children. At the town civic center where some gathered Tuesday night, the silence was broken repeatedly by screams and wails. “No! Please, no!” one man yelled as he embraced another man.

“My heart is broken today,” said Hal Harrell, school district superintendent. “We’re a small community, and we’re going to need your prayers to get through this.”

Adolfo Cruz, a 69-year-old air conditioning repairman, was still outside the school as the sun set, seeking word on his 10-year-old great-granddaughter, Eliajha Cruz Torres.

He drove to the scene after receiving a terrifying call from his daughter about the first reports of the shooting. Waiting, he said, was the heaviest moment of his life.

“I hope she is alive,” Cruz said.

On Wednesday morning, volunteers were seen arriving at the community center with Bibles and therapy dogs.

The attack was the latest in a seemingly unending string of mass killings at churches, schools, stores and other sites in the United States. Just 10 days earlier, 10 Black people were shot to death in a racist rampage at a Buffalo, New York, supermarket.

In a somber address to the nation hours after the bloodshed in Uvalde, President Joe Biden pleaded for new gun restrictions.

“As a nation we have to ask: When in God’s name are we going to stand up to the gun lobby? When in God’s name are we going to do what has to be done?” Biden asked. “Why are we willing to live with this carnage?”

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

Before the attack, Ramos shot and wounded his grandmother, then fled the scene, crashing his car at the school and making his way inside, authorities said.

READ MORE: Fourth Of July Festivities Kick Off In Baltimore County

Olivarez said the gunman “just began shooting numerous children and teachers that were in that classroom, having no regard for human life. … Just began shooting anyone that was in his way.”

He said a tactical team forced its way into the classroom, and “they were met with gunfire as well, but they were able to shoot and kill that suspect.’’

Earlier, a law enforcement official said one Border Patrol agent who was working nearby when the shooting began rushed into the school without waiting for backup and shot and killed the gunman. The official spoke on condition of anonymity because he was not authorized to talk about it.

The agent was wounded but able to walk out of the school, the law enforcement official said.

Jason Owens, a top regional official with the Border Patrol, said some area agents have children at Robb Elementary.

“It hit home for everybody,” he said.

Staff members in scrubs and devastated victims’ relatives could be seen weeping as they walked out of Uvalde Memorial Hospital, which said 13 children were taken there. Another hospital reported a 66-year-old woman was in critical condition.

Uvalde, home to about 16,000 people, is about 75 miles (120 kilometers) from the border with Mexico. Robb Elementary, which has nearly 600 students in second, third and fourth grades, is in a mostly residential neighborhood of modest homes.

The attack came as the school was counting down to the last days of the school year with a series of themed days. Tuesday was to be “Footloose and Fancy,” with students wearing nice outfits.

Law enforcement officers investigating the bloodshed began serving search warrants and gathering telephone and other records. They also sought to contact Ramos’ relatives and trace the guns.

Condolences poured in from leaders around the world. Pope Francis pleaded that it was time say “‘enough’ to the indiscriminate trade of weapons!” Ukrainian Foreign Minister Dmytro Kuleba said his nation also knows “the pain of losing innocent young lives.”

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

In 2018, a gunman killed 10 people at Santa Fe High School in the Houston area. A year before that, a gunman shot more than two dozen people to death during a Sunday service in the small town of Sutherland Springs. In 2019, a gunman at a Walmart in El Paso killed 23 people in a racist attack targeting Hispanics.

The shooting came days before the National Rifle Association annual convention was set to begin in Houston. Gov. Greg. Abbott and both of Texas’ U.S. senators were among elected GOP officials who were the scheduled speakers at a Friday leadership forum sponsored by the NRA’s lobbying arm.

___

This story was first published on May 24, 2022. It was corrected to reflect that state Sen. Roland Gutierrez said the gunman shot his grandmother before going to the school; he did not say the gunman killed his grandmother. It was also updated to correct the spelling of the name of the 10-year-old great-granddaughter.

___

Eugene Garcia and Dario Lopez-Mills in Uvalde, Jake Bleiberg in Dallas, Ben Fox, Michael Balsamo and Eric Tucker in Washington, Paul J. Weber in Austin, Juan Lozano in Houston, Gene Johnson in Seattle and Rhonda Shafner in New York contributed to this report.

MORE NEWS: Man Who Shot Wicomico Sheriff's Deputy Indicted On 18 Charges

(© Copyright 2022 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)