The Battle of Miraflores occurred on January 15, 1881 in the Miraflores District of Lima, Peru. It was an important battle during the War of the Pacific that was fought between Chile and the forces of Peru. The Chilean army led by Gen. Manuel Baquedano defeated the army commanded by Nicolas de Pierola guarding the second defensive line of the Peruvian capital city. Two days later, Lima, the capital city of Peru was occupied by Chilean troops. Gen. Baquedano's forces marched into Lima triumphant, while Peru's president and his officers fled into the interior, leaving the country without any government. Although the fall of Lima, the war continued between the occupation army and the troops of Andres Caceres for another three years. During the occupation of Lima, Peru's National Library was set on flames, while a number of other monuments were ransacked by Chilean forces and taken as war trophies. During the battle, Peruvian naval officer Captain Juan Fanning became a national hero for leading a spectacular infantry charge of marines that nearly outflanked the enemy.