Peruvian forces were decisively defeated in the battles of San Juan and Miraflores, and Lima fell in January 1881 to the forces of General Baquedano.