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

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

"We're looking at a human-trafficking crime," Police Chief William McManus said. He called it "a horrific tragedy".

Many of the victims looked to be in their 20s and 30s, and there were apparently two school-age children, the police chief said.

Authorities were called to the San Antonio car park late on Saturday night or early Sunday and found eight dead inside the truck. A ninth victim died at the hospital, said Liz Johnson, spokeswoman for US Immigration and Customs Enforcement.

The victims "were very hot to the touch. So these people were in this trailer without any signs of any type of water," San Antonio Fire Chief Charles Hood said.

Based on initial interviews with survivors of the weekend tragedy, more than 100 people may have been packed into the back of the 18-wheeler at some point in its journey, ICE Acting Director Thomas Homan said.

Thirty-nine were inside when rescuers arrived, and the rest were believed to have escaped or hitched rides to their next destination, officials said.

Some of the survivors told authorities they were from Mexico, Homan said.

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

The temperature in San Antonio reached 101 degrees (38 Celsius) on Saturday and didn't dip below 90 (32 C) until after 10pm. The trailer didn't have a working airconditioning system, Hood said.

Federal prosecutors said James Mathew Bradley Jr, 60, from Clearwater, Florida, was taken into custody.

No immediate charges were filed.

READ MORE: Deadly human trafficking business on Mexico-US border

A person from the lorry initially approached a Walmart supermarket employee in the car park and asked for water late on Saturday night or early on Sunday morning, police Chief William McManus said.

The employee gave the person the water and then called the police, who found the dead and desperate inside the truck.

Investigators checked store surveillance video, which showed vehicles had arrived and picked up other people from the lorry, police said.

The US Homeland Security Department stepped in to take the lead in the investigation.

It was just the latest smuggling-by-truck operation to end in tragedy. In one of the worst cases on record in the United States, 19 immigrants locked inside a stifling rig died in Victoria, Texas, in 2003.