Another 30 people, many suffering from heat stoke and exhaustion, were with the bodies in the trailer, which lacked air conditioning or a water supply, San Antonio Fire Chief Charles Hood said.
The truck's driver was arrested and will be charged, said Richard Durbin, U.S. Attorney for the Western District of Texas, and prosecutors will work to identify others responsible.
"These people were helpless in the hands of their transporters," Durbin said in a statement, adding the heat in southern Texas is "punishing" at this time of year.
"Imagine their suffering, trapped in a stifling trailer in 100-plus degree heat," he said. They were victims of "ruthless human smugglers indifferent to the well-being of their fragile cargo," he added.
San Antonio Police Chief William McManus described it as a "horrible tragedy," and said other suspects had fled the scene as police officers arrived.
"Checking the video, there were a number of vehicles that came and picked up other people who were in that trailer," McManus said.
Twenty people were airlifted to seven hospitals and their conditions were "critical to very critical," fire chief Hood said. Eight others are hospitalized in less serious condition, he said.
The people range from school-age juveniles to adults in their twenties and thirties, he said.
McManus said officials were led to the scene by a man who approached a store employee asking for water.
McManus said the Department of Homeland Security had joined the investigation. The origin of the truck is unclear, he added.