The gunman opened fire at Robb Elementary School - which teaches children aged seven to 10 - in the city of Uvalde before he was killed by law enforcement, officials said.
The 18-year-old suspect had a handgun, an AR-15 semi-automatic rifle and high-capacity magazines, investigators say.
The teenager is suspected of shooting his grandmother before the rampage.
Local media report he may have been a high school student in the area.
Uvalde Consolidated Independent School District Chief of Police Pete Arredondo said the shooting began at 11:32 local time on Tuesday, and that investigators believe the attacker "did act alone during this heinous crime".
Texas Governor Greg Abbott said the shooter, whom he named as Salvador Ramos, abandoned a vehicle before entering the school to "horrifically, incomprehensibly" open fire.
One of the adults killed was a teacher, who has been named in US media as Eva Mireles. Her page on the school district's website said she has a daughter in college and loved running and hiking.
Nearly 500 pupils are enrolled in the predominantly Hispanic school around 85 miles (135km) west of the city of San Antonio.