By the end of the 19th century the exploitation of guano on the islands off the coast and the recovering economy brought the city of Lima again decent wealth and prosperity. From the 1890s to the 1920s Lima went through a process of urban renewal and expansion. Growth took place mostly towards the south, where for example the district of La Victoria emerged as a fast-growing worker's neighborhood. Soon the former distant cities of Miraflores, Barranco, Chorrillos, Magdalena and the port of Callao were absorbed by the growing metropolis. Even if Lima recovered during this time it never attained the power and wealth it had during its colonial time.
During the "Belle Epóche" in the 1920s and 1930s several buildings of the historic centre including the Government Palace and the Municipal Palace were renovated. On the 20th of May 1940 an earthquake destroyed once again most of the city and Lima had to be rebuilt another time. After World War II thousands of poor Andeans moved to Lima hoping for a better future and started a period of rapid growth. Increasing industrialization and modernizing led to an extraordinary migration movement from the country side to Lima and to a demographic explosion. Also many foreign immigrants found their way to the Peruvian coast.
In the middle of the 20th century the old colonial and magnificent city changed dramatically. Due to extreme poverty and natural disasters even more Peruvians migrated to Lima. Throughout the city huge "pueblos jóvenes" (shanty towns) without proper infrastructure developed quickly. The estimated population in 1920 was about 176,000, in 1940 already 540,000. It roughly doubled by the 60s and again by the 70s. At one point the city couldn't cope any more with its uncontrolled massive growth and public services collapse completely. On the other hand in the course of the years a multicultural mixture of peoples developed in Lima which significantly enriched the cosmopolitan flair of the once glamorous city. Soon Lima was called "small Peru".
In the 80s Lima, and basically whole Peru, faced serious social problems. Due to economic mismanagement by the military regime, natural disasters and the fall of international commodity prices, the production decreased, wages depressed, unemployment exaggerated and inflation increased dramatically. The economic collapse worsened living conditions for all, but mainly the poor Peruvians. This provided a breeding ground for social and political discontent.
The emergence of the terrorist group Sendero Luminoso (Shining Path) in rural areas was shortly afterwards followed by the Tupac Amaru Revolutionary Movement (MRTA) that was established in Lima. This sent the country and Lima further into chaos. Even if most terrorist activities took place far away from Lima, the city still was a favoured place for assassinations, bombings and overall violence. Even though president Fujimori stopped the terror he did little for the poor. Lima became the city of demonstrations and protests. Nevertheless, in the 90s about 200,000 people came yearly from the rural areas of Peru to Lima trying to escape the terror and seeking a better future.
While the rich people had moved a few decades back from the city center to the upper-scale districts of San Isidro and Miraflores or even to the east of Lima (Monterrico and La Molina), the middle-class lived in the districts in between and the very poor in the ever growing "pueblos jóvenes" (shanty towns). By the end of the 20th century Lima had to cope with many serious problems: crime, prostitution, drugs, rubbish all over the city, massive traffic, lack of infrastructure, just to name a few.