|Twenty people were taken to hospital with serious injuries|
Police discovered dozens of people inside the tractor-trailer in the early hours of Sunday, and 20 of them have serious injuries.
Detectives have described the "horrific tragedy" in San Antonio as a case of human trafficking.
The driver has been arrested and will be charged.
Weather in the area had been hot and dry, with firefighters claiming the air conditioning unit inside the truck was not working.
The US attorney for the western district of Texas, Richard Durbin, described the heat as "punishing" at this time of year, adding: "These people were helpless in the hands of their transporters. Imagine their suffering, trapped in a stifling trailer in 100-plus degree heat."
He described the immigrants as victims of "ruthless human smugglers indifferent to the well-being of their fragile cargo".
The driver of the truck faces state and federal charges
Police were called to the scene after a person from the truck approached a Walmart employee and asked for water.
Surveillance footage showed several vehicles had come to the car park to pick up travellers who had made it out of the truck alive.
San Antonio fire chief Charles Hood said: "They were very hot to the touch. So these people were in this trailer without any signs of any type of water. It was a mass casualty situation for us."
The city is a few hours' drive from the border with Mexico's Nuevo Leon state, and illegal immigration into the US is a daily occurrence.
Most of the migrants are from Mexico and Central America, and come to the US in search of better-paying work.
Scores of people have died in recent years while trying to make the dangerous journey.
In May 2003, 19 immigrants being transported from South Texas to Houston died inside a sweltering tractor-trailer.
Prosecutors alleged the driver had refused to free them - despite hearing begging and screaming for their lives as they succumbed to the stifling heat. He is currently serving a 34-year jail sentence.