For Peru, the trend is a reversal of decades in which rural families traveled from the countryside to Lima in search of work. That migration changed the face of the country, turning it into one of the more urbanized nations in the world.

Javier Torres, the director of a news site that focuses on rural needs, Noticias Ser, called Peru a “country of migrants,” saying that movement “is part of our culture.”

He is used to tracking movement into Lima. But he could not recall a time when so many people were trying to leave. Nearly a third of all Peruvians have lost their jobs in recent weeks, according to a poll by the Institute of Peruvian Studies conducted recently for the newspaper La República.

Government statistics estimate that even amid mass migration to the cities, the vast majority of people in the country remain in the informal labor sector — working at jobs that are typically paid in cash, with no benefits and little economic security.