 During the War of the Pacific, the Chilean army invaded Peru and attacked the Miraflores District outside Lima on January 15, 1881.Fanning's unit was redeployed from the port and ordered to mount a counter-offensive.Fanning led a gallant charge which drove back the enemy.