During the 1879–1883 War of the Pacific, Chilean troops occupied Lima after defeating Peruvian resistance in the battles of San Juan and Miraflores. The city suffered the depredations of the invaders, which looted public museums, libraries and educational institutions. At the same time, angry mobs attacked wealthy citizens and the Asian population; sacking their properties and businesses.