New details have emerged regarding Salvador Ramos, the suspected gunman who opened fire on Tuesday at an elementary school in Uvalde, Texas. The 18-year-old reportedly fatally shot 19 children and two teachers at Robb Elementary School before being killed by law enforcement.

At least 17 additional people were wounded and transported to local hospitals for treatment.

After police received a 911 call regarding a wrecked car near the campus and someone armed with a rifle entering the school, they responded and engaged the shooter before he entered the building.

According to Department of Public Safety Lieutenant Chris Olivarez, two police officers were wounded in the exchange of gunfire but are expected to survive.

The shooter then entered the school and barricaded himself inside a classroom, shooting numerous children and two teachers, Olivarez added.

It is currently unclear who among law enforcement fatally shot Ramos.

According to the lieutenant, a special tactical team of local and federal officers responded, forced their way into the classroom, and shot the gunman dead.

However, according to the Associated Press, he was shot by a U.S. Border Patrol agent who was nearby at the time and raced into the building without waiting for help.

“A Border Patrol agent who was nearby when the shooting began rushed into the school without waiting for backup and shot and killed the gunman, who was behind a barricade,” the Associated Press reported. “The agent was wounded but able to walk out of the school.”

A Fox News correspondent claims to have verified the AP report.

DPS stated that Ramos shot his grandmother, who was still in the hospital Wednesday, according to Olivarez. The man then apparently traveled to Robb Elementary to carry out the attack.

According to police, Ramos wore a tactical vest with no hardened body armor plates. He also left a bag at the school entrance with magazines full of ammunition.

Governor Greg Abbott revealed that Ramos posted his plans on social media minutes before attacking the school. Ramos had posted three social media messages about 30 minutes prior, according to the governor: he posted that he was going to shoot his grandmother and, afterward, that he had done so, as well as said he was going to shoot up an elementary school.

State Senator John Whitmire said he was informed by authorities that Ramos purchased one of the firearms at a federally licensed dealer in the Uvalde area on May 17. Ramos bought 375 rounds of ammunition the next day, and he reportedly purchased a second gun last Friday.

An Instagram account that police believe belonged to Ramos showed an image of two AR-style weapons. Ramos appeared to have tagged another Instagram user with almost 10,000 followers, requesting that she share the photo with her followers.

“I barely know you and u tag me in a picture with some guns,” the Instagram user allegedly responded. “It’s just scary.” She has since deactivated her profile.

Tuesday’s incident marks the deadliest school shooting since that of Sandy Hook Elementary School, when 26 people, including children and adults, were killed in 2012.