More details have emerged on how the teenager who reportedly killed 19 children and two adults in a horrific school shooting was stopped by a lone border official.
The shooter is believed to be local 18-year-old Salvador Ramos, who was a student at Uvalde High School.
In footage shared by an Uvalde woman, a man believed to be Ramos was filmed wearing an all-black, hooded outfit as he entered a school building.
An unnamed law enforcement official told US news outlet ABC News that Ramos was killed by a nearby lone Border Patrol agent who rushed to the school, despite not having backup.
Robb Elementary School - where the attack occurred - is just 96km from the Mexico border.
The agent then shot and killed Ramos, who was reportedly behind a barricade. Although the border officer was wounded in the attack, they were able to walk out of the school.
Shooter used guns given to him on his birthday
It was previouly reported that the teen shooter had acquired the guns shortly after May 16 - his 18th birthday.
According to two sources connected to the investigation the shooter used those weapons in the attack shortly after his 18th birthday, the Washington Post reports.
In the US, some states (including Texas) have no minimum age for the ownership of a long gun (like a rifle), while federal law prohibits children under the age of 18 from owning a handgun.
In Texas, there are no other laws surrounding the possession of a firearm, regardless of age.
The teen shooter also hinted at the attack to a stranger on Instagram hours before opening fire.
The senior high school student shared two photos of ammunition and guns in the days before the shooting. In one of the photos he tagged the Instagram account of a woman who was unknown to him.
On the morning of the school shooting, Ramos and the woman began a conversation in which he hinted he had something to tell her.
"I'll text you in a hour," he wrote.
"But you HAVE TO RESPOND.
"I got a lil secret.
"I'll text you in a hour."
The eerie texts were sent at 7.33am, just hours before the first gunshots were reported at 11.43am local time.
The woman responds by saying: "I might be taking a nap cause I'm really sick but if I'm awake I will."
His last message to her was sent at 9.16am.
"Ima air out," he wrote.
'I was afraid'
In the aftermath of the shooting the woman - who lives outside of Texas - said Ramos' random messages left her feeling scared and uncomfortable.
She said she only responded to his messages because she was scared of him and said she regretted that she was didn't stay awake to "at least try to convince him to not commit his crime".
"He's a stranger, I know nothing about him. He decided to tag me in his gun post. I'm so sorry for the victims and their families, I really don't know what to say," she wrote.
"I didn't know."
She said that since the shooting she has received messages which claimed she was Ramos' girlfriend, or an accomplice to the shooting - allegations she strongly denied.
"I don't know him and I don't even live [in] Texas," she wrote in one post.
She also received messages from other Instagram users who reportedly also received photos of guns from Ramos.
Ramos killed grandmother before school shooting
Ramos reportedly also shot and killed his grandmother before entering a Texas high school and opening fire on Tuesday afternoon local time. He was reportedly shot in a stand-off with Texas officials responding to calls of an active shooter in Robb Elementary School in Uvalde.
Reports of shots fired were called in at 11.32am, according to Texas officials.
Ramos reportedly abandoned his vehicle and entered the elementary school with a handgun. He may also have had a rifle with him, according to Governor Greg Abbott.
The governor said Ramos "shot and killed — horrifically, incomprehensibly" more than a dozen people, mostly children.
In a press conference held shortly after 4.15pm local time, Texas officials confirmed the shooter was deceased.
Abbott, citing preliminary reports, said Ramos was killed by responding officers.
Uvalde Memorial Hospital confirmed they received 13 children for treatment. Two additional students who arrived at UMH were deceased on arrival, the hospital said.
UMH said another 66-year-old woman is in critical condition. Neither the school district nor the police department has confirmed if she was a teacher.
Abbott released a statement about 4.30pm local time.
"Texans across the state are grieving for the victims of this senseless crime and for the community of Uvalde.
"Cecilia and I mourn this horrific loss and urge all Texans to come together to show our unwavering support to all who are suffering. We thank the courageous first responders who worked to finally secure Robb Elementary School.
"I have instructed the Texas Department of Public Safety and the Texas Rangers to work with local law enforcement to fully investigate this crime.
"The Texas Division of Emergency Management is charged with providing local officials all resources necessary to respond to this tragedy as the State of Texas works to ensure the community has what it needs to heal."
Robb Elementary is a school for students in grades two, three, and four.
An alert on the school's website had urged parents not to pick up their children at that time.
"Students need to be accounted for before they are released to your care. You will be notified to pick up students once all are accounted for," the alert read.
A reunification site was set up at the Civic Centre.
Uvalde is a small town located about one hour west of San Antonio.