HUIXTLA, Mexico — Soon after dawn on Tuesday, the mayor stood on the central plaza of his town here in southern Mexico and took stock.

Thousands of migrants — men, women, entire families — had wandered into town the day before, many on foot, and turned the humble commercial district into a vast makeshift encampment. They had filled every square foot of the plaza, including its bandshell, and jammed the sidewalks and storefronts, sprawling on cardboard, blankets, plastic sheeting and spare clothes.

“This is straight-up biblical,” said Julio Raúl García Márquez, 43, a Guatemalan traveling with his wife, their 1-year-old son and a cousin. They spent part of the night on sheets of cardboard in the central square.

Nearby, two pairs of jeans had been hung to dry on the bust of Venustiano Carranza, a hero of the Mexican Revolution. Municipal trash cans were buried under mounds of garbage.