By Agence France-Presse
Seventeen of those taken to area hospitals after the discovery in San Antonio -- about a two hour drive from the Mexican border -- were in critical condition, suffering from heat stroke and dehydration, authorities said.
City police chief William McManus said the truck driver had been arrested.
At least 38 people were in the trailer including at least two school-age children, Fire Chief Charles Hood said. McManus later told CNN that the dead were all adult men.
It was not immediately clear how many might have escaped and were unaccounted for.
"We got a call from a Walmart employee about a welfare check in a tractor-trailer that was parked on the lot here," McManus told a news conference.
"He was approached by someone from that truck, who was asking for water."
The employee returned with the water and then called the police who "found eight people dead in the back of that trailer," the police chief said, calling it a "horrific tragedy."
"We're looking at a human trafficking crime," McManus said.
'Hot to the touch'
Authorities used helicopters to rush some of the injured to seven area hospitals, Hood said.
He added that the people in the truck were "hot to the touch," adding the air conditioner in the trailer was not working.
"For those people who survived, they took a beating," Hood told CNN.
"With heat stroke, you sometimes have neurological deficits that you're never going to be able to recover from."
Weather in the area has been hot and dry. Hood estimated the temperature in the truck could have reached 150 degrees Fahrenheit (65 degrees Celsius), likening it to an "oven."
"If that truck would have been there overnight, there's no doubt that we would have lost all 38 of those people," Hood said.
Happens 'all the time'
The US Department of Homeland Security and immigration officials are assisting local law enforcement with the investigation.
"This is not an isolated incident... this happens all the time," McManus said.
"It happens late at night, under darkness because they don't want to be discovered."
The police chief said store security footage showed that some vehicles came to pick up some travelers who were on the truck and who had made it out alive.
It was not immediately clear how long the truck had been in the parking lot, and police were working to determine who owns it.
Tens of thousands of illegal migrants from Mexico and Central America attempt to make the treacherous trip into the United States each year.
In 2003, 19 would-be migrants died in an overheated truck while being taken from south Texas near the Mexican border to Houston.
President Donald Trump has pledged to build a security wall along America's border with its neighbor -- and make Mexico pay for it -- in order to crack down on illegal immigration, leading to raised tensions with Mexico City.
So far, the project has been stalled by reluctance in Congress to dedicate funding for the barrier, which could cost as much as $20 billion according to some estimates.
US Homeland Security Secretary John Kelly has been to Mexico twice to discuss immigration, human trafficking and the spiraling cross-border drugs trade.
US Senator John Cornyn of Texas said Sunday on Twitter: "Border security will help prevent this Texas tragedy."
Acting Immigration and Customs Enforcement director Thomas Homan said the incident "ranks as a stark reminder of why human smuggling networks must be pursued, caught and punished."
"These networks have repeatedly shown a reckless disregard for those they smuggle, as last night's case demonstrates," Homan said in a statement.