Washington (AFP) - The day after his 18th birthday, Salvador Ramos, a troubled teenager from small-town Texas, bought an assault rifle.A week later, he walked into a local elementary school, where he shot and killed 19 young children and two of their teachers.
Authorities are still trying to piece together what drove Ramos to commit America's worst school massacre in a decade, but here is what is known so far about the shooting:
How the shooter attacked
Described as a long-bullied youth with a history of self-harm, Ramos turned 18 on May 16 and bought an assault rifle the very next day.
He purchased 375 rounds of ammunition on May 18, and then a second rifle two days after that.
Ramos -- a school dropout with no criminal history -- messaged on social media Tuesday morning that he planned to attack his grandmother, Texas Governor Greg Abbott said.
Ramos shot his 66-year-old relative in the face.She survived and was airlifted in critical condition to a hospital in nearby San Antonio.
The shooter then messaged again to say he had followed through on his plan to attack his grandmother, and that an elementary school was his next target.
He drove a little over two miles (3.2 kilometers), crashing near Robb Elementary School, where more than 500 students in grades two to four -- aged around seven to 10 years old -- had just three days of class left before summer vacation.
He fired on bystanders at a funeral home, then climbed a fence, entered the school through a door that was apparently unlocked, and made his way to two adjoining classrooms.
"That's where the carnage began," said Steve McCraw, director of the Texas Department of Public Safety (DPS).
How he was stopped
As a crowd grew near the school, police arrived on the scene.
Officers entered the school minutes after the shooter, but were held back by gunfire and called for backup, according to Victor Escalon of DPS.
A tactical team that included US Border Patrol agents entered and killed the suspect "approximately an hour later," Escalon said.
In the interim, officers evacuated students and teachers from the school, and unsuccessfully tried to negotiate with the gunman, who held them back with rifle fire.
Texas police are facing scrutiny over the delay between the start of the attack and the death of the shooter.
When pressed by journalists on the law enforcement response -- and on contradictory accounts provided by officials -- Escalon said investigators were still conducting interviews and working to piece together what happened.
There were "numerous officers" involved, he said."Once we interview all those officers, what they were thinking, what they did, why they did it...we'll have a better idea."
Who was the gunman?
Ramos had been living with his grandmother for two months, McCraw said.According to Texas Governor Greg Abbott, no psychological problems were known to local health departments.
A cousin, Mia, told The Washington Post Ramos "wasn't very much of a social person" after being bullied for a stutter.
But two graduating seniors at Uvalde High School -- both of whom said they knew the shooter -- painted a different picture.
"We went to school with him….We all knew of him," Jaime Cruz, 18, told AFP.
"I do vividly remember him being a bully in school.It wasn't just that he was getting bullied, he was also the bully," said Cruz.
"He was a bully.He was mean," agreed Ariana Diaz, 17.
Speaking to ABC News, Ramos's mother Adriana Reyes said her son could be aggressive when angry but was "not a monster" -- and that she was not aware he had been buying weapons.
"I had an uneasy feeling sometimes, like 'what are you up to?,'" she said."We all have a rage, that some people have it more than others."