“We are confronting a natural disaster caused by climate change,” he said. “We need to prepare because the rains that are coming will be more intense.”

The wreckage in Peru points to an even larger problem in this part of the world: Years of economic expansion in Latin America have spurred migration and development, but these changes have not been buttressed by preparation for even the most basic natural disasters.

Peru is a prime example, experts say. Growth since the early 2000s drew thousands from rural areas to coastal desert towns and into new settlements on the outskirts of Lima looking for jobs. Many of the newcomers founded squatters’ towns on the fringes of cities.

Leopoldo Monzón, a civil engineer and urban planning expert in Peru, said many of these areas had long been unsettled precisely because they were susceptible to flash flooding. Yet some politicians developed the lands in exchange for votes from the new arrivals.

“They never thought there would be such a flood,” said Mr. Monzón, who estimates that more than 100,000 people now live in flash flooding zones around Lima alone.

Making matters worse, meteorologists say, is the arrival of a localized El Niño event, a sudden rise in ocean temperature in the Pacific, which this year has happened off the coast of South America. Normally scorched mountain towns have faced devastating mudslides, while residents of Lima, the capital, were cut off from water for five days after pumps were inundated.

The flash flooding in Peru even has a local name, huaycos, a Quechua word referring to the dry valleys where the severe floods appear without warning.