information:extraction, structural:reformatting, structural:expansion, stylistic:style_transfer
Republican era

After the War of Independence, Lima became the capital of the Republic of Peru, but the country's economic stagnation and political disorder paralyzed its urban development. This situation was reversed in the 1850s, when the growing public and private income derived from the export of guano allowed a rapid expansion of the city. In the following twenty years, the State financed the construction of large public buildings to replace the old viceregal establishments, among these are the Central Market, the General Slaughterhouse, the Mental Asylum, the Penitentiary and the Hospital Dos de Mayo. There were also improvements in communications; in 1850 a railway line between Lima and Callao was completed and in 1870 an iron bridge was inaugurated over the Rímac River, baptized as Puente Balta. In 1872 the colonial City Walls were demolished by the US engineer Henry Meiggs under contract with the Peruvian government, in anticipation of further urban growth in the future. However, this period of economic expansion also widened the gap between rich and poor, producing widespread social unrest.

During the War of the Pacific (1879–1883), the Chilean army occupied Lima after defeating Peruvian troops and reserves in the battles of San Juan and Miraflores. The city suffered from the invaders, who looted museums, public libraries and educational institutions. At the same time, angry mobs attacked wealthy citizens and the Asian colony, looting their properties and businesses.