Two men were taken to hospital after 16 people, all believed to be Iraqi nationals, were found in the back of a lorry in sweltering heat.
The stowaways waved to alert passing motorists who flagged down the driver to stop on the A22 in East Grinstead, West Sussex, at around 9.20am on Saturday.
Emergency teams helped free the 13 men, two women and a child from the back of the HGV. Two of the men were taken to hospital with dehydration.
The others were provided with water and medical aid, Sussex Police said. The nearby Trinity Methodist Church was used as a refuge centre as immigration officers arrived.
The lorry driver, a 63-year-old man of no fixed address, was arrested on suspicion of facilitating illegal immigration. He was in police custody.
With temperatures in East Grinstead hitting 25C on Saturday, police said it was vital that they reacted quickly to free the stowaways from the lorry.
Sergeant William Keating-Jones, of Sussex Police, said: "Our priority was for the welfare of the occupants who were in the back of the lorry. The vehicle was exceptionally hot and it was important we reacted quickly.
"This was a great multi-agency response to a potentially life-threatening situation, with emergency services, immigration officials, volunteers and even local residents all pulling together.
"We were also mindful of causing minimal disruption to motorists, and the road was closed for about 20 minutes while we were at the scene."