Updated

Salvador Ramos, the alleged gunman accused of shooting his grandmother and then targeting dozens of victims – ultimately killing 19 children and two adults – at a Texas elementary school was known to be a loner who had quit his job just weeks before unleashing his attack, Fox News has learned. 

Ramos, an 18-year-old Uvalde, Texas, resident, legally purchased two AR-platform rifles on May 17 and May 20, and bought 375 rounds of ammunition on May 18, Texas Sen. John Whitmire told Fox affiliate KCPQ-TV, citing a briefing from the Bureau of Alcohol, Tobacco, Firearms and Explosives.

Warning: The following contains information that some might consider graphic

On Tuesday, Ramos was involved in a domestic disturbance with his grandmother at his grandparents’ Uvalde home, when he shot the woman in the face and seriously injured her before fleeing, according to authorities. 

TEXAS SCHOOL SHOOTING: LIVE UPDATES

He then crashed his vehicle near Robb Elementary School in Uvalde, authorities said. Local police received a call about "a crashed vehicle and an individual armed with a rifle making his way into the school," DPS Lt. Chris Olivarez told "Fox & Friends" on Wednesday.

Officials said that approximately 30 minutes before the events unfolded, Ramos wrote in a series of Facebook messages, "I’m going to shoot my grandmother," "I’ve shot my grandmother," and then: "I’m going to shoot an elementary school."

He then entered the school and barricaded himself inside a fourth-grade classroom, where he opened fire on students and school staff, officials and law enforcement sources have said. 

Ramos barricaded himself inside the first classroom "that he was able to gain access to," Olivarez said. He then opened fire on the students and teachers inside, Olivarez said. 

TEXAS SCHOOL SHOOTING: TIMELINE

On Friday, authorities revealed more details about the police response that has since come under intense scrutiny. Nearly 20 officers waited for around 45 minutes to breach a classroom door that was eventually unlocked to confront the shooter, Texas Department of Public Safety Director Steven McCraw said. 

A Uvalde police commander at the scene believed Ramos was barricaded inside and that the children were not at risk, based on a mistaken belief that there was no longer an active attack, McCraw said.

Woman sits outside home in Uvalde, Texas

Adriana Reyes, the mother of Salvador Ramos, seen praying and holding Rosary beads outside of her home (Fox News Digital)

"A decision was made on the scene – I wasn’t there -- that this was a barricaded subject situation, there was time to retrieve the keys and wait for a tactical team with the equipment to go ahead and breach the door and take on the subject," he said. "At that point, that was the decision, that was the thought process." 

McCraw said Ramos fired off at least 100 rounds based on audio evidence. A school district police officer responding to reports of a man with a gun at the school drove past Ramos, who was kneeling behind a parked vehicle, authorities said. That detail is in contrast to earlier reports that a district police officer confronted the gunman inside the school. 

The door in which Ramos entered the school had been propped open by a teacher prior to the vehicle crash, McCraw said. Officers breached the door of the classroom where the gunman was hiding after they obtained a key from a janitor on the property. 

A team with the Border Patrol Tactical Unit were then able to enter the classroom, and one of the agents was able to fatally shoot the gunman, authorities said. 

Twenty-two people, including 19 children and the gunman, were killed. At least more than a dozen others remained injured as of Friday, Texas Department of Public Safety said. 

Ramos’s grandmother and a 10-year-old girl remain hospitalized in serious condition, and multiple agents suffered non-life-threatening injuries.

PHOTOS: FAMILIES, VICTIMS OF TEXAS SCHOOL SHOOTING

Speaking to "Fox & Friends" on Wednesday morning, DPS Lt. Olivarez said the suspect had attended a local high school and lived with his grandparents. A man who was believed to be his grandfather told reporters on Wednesday he spoke to his grandson "daily" but said he "didn't know" he had guns in the home.  

"We haven't able to identify any friends, a girlfriend, no gang affiliation, no criminal history. So, a lot of unanswered questions," Olivarez went on. "But that's why we're trying to put all those pieces together, gather as much evidence as possible to try to bring some type of closure to those victims, to the families and also the community here and to all of Texas."

Ramos was described as being a loner. He was unemployed and had no criminal history and no gang affiliation, DPS said. Gov. Greg Abbott said he had "no known mental health history."

"I have talked to a few people that have known him and went to school with him. I talked to some parents of students who went to school with him, but that's about as far as it's gone," Uvalde Mayor Don McLaughlin told Fox News' Bill Hemmer. "They just said that when COVID hit, he kind of dropped out of school and just kind of pulled back to himself."

He added: "My understanding [is that] he was not currently enrolled in school." 

Search warrants related to the suspect were being executed and investigators were scouring phone records and any social media activity, law enforcement sources told Fox News. 

Olivarez said investigators were still trying to determine if there were any "prior indicators, red flags" related to the suspect and were searching for "any initial signs that he was going to conduct a mass shooting." 

Investigators are still working to determine a possible motive. 

An employee at a Wendy’s location on East Main Street in Uvalde told Fox News Digital the suspect quit his job there two weeks prior to the attack, but would not elaborate further. A spokesperson for Wendy’s did not immediately respond to Fox News Digital’s request for comment. 

A since-deleted Instagram account that appeared to be connected to Ramos allegedly featured photographs that showed ammunition and firearms. 

An Instagram account allegedly connected to Ramos featured disturbing photos, including one showing a high-capacity magazine. The Instagram account has since been taken down.

The same account allegedly sent alarming messages to a woman before the deadly attack. The first message, sent on May 12, asked, "You gonna repost my gun pics?" The woman was tagged in photos showing guns.

UVALDE, TEXAS SCHOOL SHOOTING: AT LEAST 2 GIRLS, BOTH 10, STILL MISSING, FAMILY FEARS THEY WERE KILLED

In one message, she described the exchange as "scary." She then continued, "I barely know you and u tag me in a picture with some guns." The account sent a final message to the woman on Tuesday morning: "Ima air out."

CLICK HERE TO GET THE FOX NEWS APP 

Tuesday's Uvalde massacre was the deadliest elementary school shooting since the Sandy Hook tragedy of 2012, when 26 people, including 20 six- and seven-year-old kids, were killed. 

It also occurred 10 days after a mass shooting at a Tops supermarket in Buffalo, New York, claimed 10 lives.

Fox News' Matteo Cina and Paul Best contributed to this report.