Occupation of Lima

The occupation of Lima by the Chilean Army in 1881-1883 was an event in the land campaign phase of the War of the Pacific (1879-1883).
Lima was defended by the remnants of the Peruvian army and crowds of civilians in the lines of San Juan and Miraflores. As the invading army advanced, the towns of Chorrillos and Barranco were occupied on January 13 of the same year while the town of Miraflores was captured on the 16 of January, after the Battle of Miraflores; finally the city of Lima was occupied on January 17, 1881 until October 23, 1883 when Miguel Iglesias regained control of the Peruvian government.
Developments.
In January 1881, Chile controlled the sea along the coasts of Peru, as well as the provinces of Tacna, Arica and Tarapacá. The Chilean troops disembarked in the Peruvian towns of Pisco and Chilca, located to the south of Lima. General Manuel Baquedano was in control of the army of Chile during the Lima campaign.
Lima was going to be defended at first by the remaining Peruvian army and by a vast number of civilians in the line of San Juan - Chorrillos; the American engineer Paul Boyton narrates that "" the troops were of natives who had been recruited in the mountain ranges and forced to fight, hundreds of them never had seen before a city" ". On the other hand, the strategic line of Miraflores was defended by more troops than civilians.
Nonetheless, and with little effective Peruvian central government remaining, Chile pursued an ambitious campaign throughout Peru, especially along the coast and in the central Sierra, penetrating as far north as Cajamarca, seeking to eliminate any source of resistance.
"Liberation" of Chinese workers, disorder and looting.
As the war progressed in Chile's advantage, the Chilean Army liberated thousands of Chinese coolies who had agreed to come to work in the Peruvian "haciendas", escaping from the harsh conditions in their own homeland and seeking a better future in Peru.
Liberated Chinese served as helpers with the Chilean army and even formed a regiment under the command of Patricio Lynch, whom the Chinese named 'the red prince' since he spoke Cantonese, which he had learned during his campaigns in China as officer in the British Navy, and the Chinese were prone to trusting a man who could speak to them in their own language and whom they felt a connection with.
"Many Chinese saw the Chilean army as "liberators", in a very controversial decision by which they are mostly deemed as traitors by many of their own countrymen in Peru; in Pacasmayo 600 to 800 Chinese forced labourers looted the sugar estates and this scene was repeated in the Chicama, Lambayeque and Cañete Valleys. The Chinese also fought alongside the Chileans in the battles of San Juan-Chorrillos and Miraflores, and there was also rioting and looting by non-Chinese workers in the coastal cities. As Heraclio Bonilla has observed; oligarchs soon came to fear the popular clashes more than the Chileans, and this was an important reason why they sued for peace". [Source: "From chattel slaves to wage slaves: dynamics of labour bargaining in the Americas", by Mary Turner.]
Prior to the occupation of Lima there were fires and sackings by inebriated Chilean soldiers in the towns of Chorrillos, Barranco and Miraflores, and even killings among themselves; as quoted by both Peruvian historians like Jorge Basadre and Chilean historians like Benjamín Vicuña Mackenna.
Events During the Occupation of Lima.
After the return of General Manuel Baquedano to Chile, Generals Cornelio Saavedra and Pedro Lagos were left to govern the city; on May 17, 1881, the Chilean government appointed Counter admiral Patricio Lynch as commander of the army of operations and political chief of Peru.
During the occupation of Lima, Chilean military authorities pillaged Peruvian public buildings, turned the old University of San Marcos and the recently inaugurated Palacio de la Exposición into a barracks, raided medical schools and other institutions of education, and carried away a series of monuments and artwork that had adorned the city.
On March 10, 1881, Chilean troops began to occupy several important cultural centers including: the University of San Marcos, the College of Guadalupe, Colegio San Carlos, the School of Engineers, the School of Art, the National Military School, the State Printing facility, the Exposition Palace, the Botanical Gardens, the School of Mining, and the School of Medicine. The Chilean army plundered the contents of the Peruvian National Library in Lima and transported thousands of books (including many centuries-old original Spanish, Peruvian and Colonial books) to Santiago de Chile. The Chilean Army recorded sending a total of 103 large crates and another 80 parcels, to Ignacy Domeyko and Diego Barros Arana, at the University of Chile. In August 1881, an inventory was published under the title "List of books brought from Peru" in the Official Journal of the Republic of Chile. On the way to Chile, various texts from the library were lost to private collectors to make space for the, more important, Chilean armament.When Ricardo Palma was appointed Director of the National Library after the occupation he found that only 378 of its 56,000 books were left. In November 2007, the Chilean government returned 3,778 books to the National Library of Peru.
Resistance.
The Peruvian resistance continued for three more years. The leader of the resistance was General Andrés Cáceres (nicknamed the "Warlock of the Andes"), who would later be elected president of Peru. Under his leadership, the Peruvian militia forces heightened with Indian "montoneras" inflicted several painful blows upon the Chilean army in small battles such as Marcavalle, Concepción and San Pablo, forcing Colonel Estanislao del Canto's division to return to Lima in 1882. However, Caceres was conclusively defeated by Colonel Alejandro Gorostiaga at Huamachuco on July 10, 1883. After this battle, there was little further resistance. Finally, on 20 October 1883, Peru and Chile signed the Treaty of Ancón, by which Peru's Tarapacá province was ceded to the victor; on its part, Bolivia was forced to cede Antofagasta.
Impact in Chile.
After the occupation of Lima Chile diverted part of its war efforts to crush Mapuche resistance in the south. Chilean troops coming from Peru entered Araucanía where they in 1881 defeated the last major Mapuche uprising.
After the occupation of Lima was accomplished Chilean newspapers published extremely patriotic, chauvinist and expansionistic material. An extreme example of this journalism is "Revista del Sur" that wrote that firearms obtained in Peru, while useless in the hands of Peruvian "fags" (Spanish: "maricas"), would be useful by Chileans to "kill indians" (Mapuches).
While Argentina had taken advantage of Chile's conflict to push for a favorable boundary in Patagonia, Chilean diplomacy only agreed to sign the Boundary Treaty of 1881 after the triumph at Lima showed Chile to be in a position of power. Thus, the Argentine plans to negotiate with a weakened and troubled Chile were partly forgone with Chile's display of military power in Peru.