At least nine people died after being crammed into a sweltering tractor-trailer found parked outside a Walmart in the midsummer Texas heat, victims of what authorities said on Sunday was an immigrant-smuggling attempt gone wrong.

The driver was arrested, and nearly 20 others rescued from the rig were hospitalized in dire condition, many with extreme dehydration and heatstroke, officials said.

One U.S. official said Sunday evening that 17 of those rescued were being treated for injuries that were considered life-threatening. The official spoke to The Associated Press on condition of anonymity because the information has not been publicly released.

Authorities were called to the San Antonio parking lot late Saturday or early Sunday and found eight people dead inside the truck. A ninth victim died at the hospital, said Liz Johnson, spokeswoman for U.S. Immigration and Customs Enforcement.

Thomas Homan, acting director of ICE, earlier told The Associated Press that two of the people taken to hospital had died but later revised down the figure.

The high in San Antonio reached 38 C on Saturday.

San Antonio police chief William McManus, left, and San Antonio fire chief Charles Hood speak to the media early Sunday. (San Antonio Police via EPA)

Based on initial interviews with survivors, Homan says there may have been more than 100 people in the truck. Thirty-eight were found inside. The rest are believed to have fled or been picked up.

Homan says some survivors have identified themselves as Mexican nationals. Four of the passengers are believed to be between 10 and 17 years old.

Authorities said the driver had been detained, but they didn't release the driver's identity.

The U.S. Department of Homeland Security has taken over the investigation.

We are very fortunate that there weren't 38 people who were locked inside of this vehicle dead - Charles Hood, San Antonio fire chief

San Antonio fire Chief Charles Hood told journalists at the scene early Sunday that paramedics and firefighters who treated the victims found all had accelerated heartbeats when they were taken from the truck in the stifling heat.

"They were very hot to the touch. So, these people were in this trailer without any signs of any type of water," Hood said.

'Mass casualty situation'

In video authorities posted online, Hood stood against a backdrop of flashing emergency vehicle lights in the pre-dawn hours as he briefed reporters. He said police and fire officials treated it as a "mass casualty situation" much like an airplane disaster.

"We are very fortunate that there weren't 38 people who were locked inside of this vehicle dead," he said.

The discovery of the bodies started after a person from the truck approached a Walmart employee in the parking lot and asked for water late Saturday night or early Sunday morning.

The parking lot of a Walmart, where the truck trailer was found, is seen on Sunday. A Walmart employee alerted police. (Suzanne Cordeiro/AFP/Getty Images)

The employee gave the person the water and then called police.

Some of those in the truck ran into the woods, leading to a search, McManus added.

Hours later, after daybreak, a helicopter hovered over the area, and investigators were still gathering evidence from the tractor-trailer, which had an Iowa licence plate and was registered to Pyle Transportation Inc. of Schaller, Iowa. A company official did not immediately respond to a phone message seeking comment.

Investigators checked store surveillance video, which showed vehicles arriving and picking up people from the truck, authorities said.

They did not say whether the rig was locked when they arrived, whether it was used to smuggle the occupants across the border into the U.S., or where it might have been headed. San Antonio is about a 240-kilometre drive from the Mexican border.

Deaths, injuries linked to heat

"We're looking at a human trafficking crime this evening," McManus said.

Later, ICE clarified that the incident is a case of human smuggling, not trafficking, since it does not seem to have involved coercion.

A spokesperson for San Antonio police, Romana Lopez, sent an email to CBC early Sunday, saying that 17 of the 38 people found were taken to hospital with life-threatening injuries and 13 were taken to five other area hospitals with non-life-threatening injuries. Most were in their 20s and 30s, but some were juveniles.

A San Antonio police officer clears crime scene barrier tape on Sunday near where the truck was found. (Darren Abate/EPA)

It's believed all of those who died or were injured had heat exposure and/or asphyxiation, the email said. The dead were taken to the Bexar County Medical Examiner's Office to determine cause of death.

"We do not yet know the country of origin, destination, or the demographics of the deceased or injured," said the police email.

'A horrific tragedy'

McManus called the case "a horrific tragedy."

Joaquin Castro, a Democratic Congressman from Texas, echoed the sentiment and called for the smugglers responsible be "prosecuted to the fullest extent of the law."

ICE released a statement Sunday highlighting the importance of dismantling the kind of smuggling networks that were likely behind the San Antonio operation.

"By any standard, the horrific crime uncovered last night ranks as a stark reminder of why human smuggling networks must be pursued, caught and punished," acting director Homan said in the statement. "These networks have repeatedly shown a reckless disregard for those they smuggle, as last night's case demonstrates."

My statement on the tragic deaths of eight immigrants in San Antonio this morning: <a href="https://t.co/MBceh1RBtu">pic.twitter.com/MBceh1RBtu</a> —@JoaquinCastrotx

Homan said he personally worked on a 2003 case in Victoria, Texas, in which 19 immigrants being transported from South Texas to Houston died inside a sweltering tractor-trailer.

Homan said those people died "as a result of the smugglers' total indifference to the safety of those smuggled and to the law."

Prosecutors in the 2003 case said the driver heard the immigrants begging and screaming for their lives as they were succumbing to the stifling heat inside his truck but refused to free them. The driver was re-sentenced in 2011 to nearly 34 years in prison after a federal appeals court overturned the multiple life sentences he had received.

Watch the San Antonio officials' update on the apparent human smuggling deaths