A US official says at least 40 people have been found dead inside a lorry trailer in a presumed migrant smuggling attempt in southern Texas.

The official says 15 others in the truck were taken to hospitals in the San Antonio, where the bodies were found on Monday.

The official spoke to The Associated Press on condition of anonymity because the information had not been authorised for public release.

It may be the deadliest tragedy among thousands where people have died attempting to cross the border from Mexico in recent decades.

An ambulance leaves the scene where police said dozens of people were found dead in a semitrailer in a remote part of Texas
Heat poses a serious danger for those trying to cross the Mexico border into Texas via lorries (Eric Gay/AP)

Ten migrants died in 2017 after being trapped inside a truck that was parked at a Walmart in San Antonio. In 2003, 19 migrants were found in a sweltering truck south-east of San Antonio.

Lorries emerged as a popular smuggling method in the early 1990s amid a surge in US border enforcement in San Diego and El Paso, Texas, which were then the busiest corridors for illegal crossings.

Before that, people paid small fees to mom-and-pop operators to get them across a largely unguarded border. As crossing became exponentially more difficult after the 2001 terror attacks in the US, migrants were led through more dangerous terrain and paid thousands more.

Heat poses a serious danger, particularly when temperatures can rise severely inside vehicles.