Salvador Rolando Ramos, identified by officials as the 18-year-old who shot 19 children and two adults at a Texas elementary school, appears to have been a loner who was bullied, got into fights and shared photos of guns.

On Tuesday, the suspect entered the Robb Elementary School in Uvalde, a town 85 miles west of San Antonio, with an assault rifle that officials said he had bought himself for his 18th birthday. He barricaded himself in a classroom and shot at children and teachers trapped in it.

Also Read: Texas school shooting: Here is what world leaders had to say

A tactical team forced its way into the classroom and shot the gunman dead.

Born on May 16, 2004, Ramos bought an AR platform rifle legally on May 17, a day after his 18th birthday and another on May 20, the state’s senator John Whitmire said after a police briefing. Ramos also bought 375 rounds of ammunition.

Salvador Rolando Ramos lived with his grandparents, not far from the school where he allegedly unleashed the horrific massacre. His motives remain unclear.

Officials said the teen shot his grandmother before heading to the elementary school, attended by children between the ages of 7 and 11. The suspect crashed his car near a ditch close to the school and then walked there. He carried one of his guns with him, leaving the other in the car.

Ramos’ grandmother was airlifted to the hospital and is said to be in a critical condition. The 18-year-old reportedly attacked his grandmother after a fight over low grades.

Salvador Rolando Ramos attended Uvalde’s high school. An Instagram account believed to be his, and now taken down, reportedly had selfies of the 18-year-old and photos of guns posted on it. Hours before the shooting Ramos reportedly messaged another account saying, “I’m about to”. His last message was, “Ima air out”.

Also Read: Ballots and bullets: What Texas elections looked like after Uvalde school shooting

The Instagram user that Ramos allegedly messaged said he was a “total stranger” and that she doesn’t live in Texas, the New York Post reported. Ramos had reportedly tagged her earlier in his gun posts.

A former classmate of Ramos alleged that he had texted him photos of a gun and bag full of ammunition a few days ago. Another former classmate said Ramos was bullied and made fun of.