File photo: Gun

The Texas shooter shared images of guns and ammunition on Instagram ahead of the school attack before tagging a woman unknown to him and telling her he had “a secret”.

Salvador Ramos, 18, posted the pics of the weapons four days ahead of his horror gun rampage at an elementary school in Texas that killed 18 children and three adults.

In one photo he tags a woman, who has since said she had no idea who he was, and tried to strike up a conversation.

During a series of messages he reveals that he has “a secret” that he wanted to share.

His last message to her is: “Ima air out”.

The woman later wrote on her Instagram stories that she had no idea who Ramos was and was worried about the gun post.

“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 in a now-deleted Instagram story.

“The only reason I responded to him was because I was afraid of him. I wish I stayed awake to at least try to convince him to not commit his crime. I didn’t know.”

Ramos’ own Instagram account has now been removed from the platform.

Governor Greg Abbott said that Ramos was killed by police officers responding to the scene, and that two officers were struck by gunfire, though the governor said their injuries were not serious.

The motive for Tuesday’s massacre in Texas, the latest in a string of seemingly random mass shootings that have become commonplace in the United States, was not immediately known.

Official details remained sketchy about the circumstances of the late morning shooting at Robb Elementary School in the town of Uvalde, Texas, about 80 miles west of San Antonio.

Gvr Abbott said the suspect was believed to have abandoned his vehicle and entered the school armed with a handgun, and possibly a rifle, before opening fire.

Governor Greg Abbott initially said 14 students and one schoolteacher were dead and more than a dozen people were injured in the horrifying incident.

Police updated the death toll on Tuesday evening, announcing that four more children were among the dead in a total of 18.

The shooting unfolded just 10 days after 10 people were killed in Buffalo, New York, in a predominantly Black neighbourhood. An 18-year-old man whom authorities said opened fire with an assault-style rifle has been charged.