A truck driver was busted for human smuggling after 31 Mexican immigrants were found in the back of his trailer at a border checkpoint in Arizona, according to authorities.

A US Border Patrol dog first alerted agents to the 2008 Freightliner coming through the checkpoint near Amado on Wednesday night — with a scan then showing the mass of immigrants huddling in the back, Customs and Border Protection officials said.

The 31 immigrants, between the ages of 15 and 40, were “all illegally present in the country” and undocumented, the agency said.

All 31 were arrested and will be processed for immigration violations.

The unidentified driver, a 40-year-old American from Nogales, Arizona, was arrested on suspicion of human smuggling, the agency said.