Piérola ordered what was left of the Army to protect the capital, Lima, together with poorly armed citizens which were called to the fight. Cáceres was then put at the command of the 5th division of the Reserve. With no reinforcements available, and with the Chilean assault force deploying from the south, Peruvian forces were defeated in the battles of San Juan and Chorrillos and Miraflores. Cáceres was wounded in the latter combat and taken to Lima. When the city fell in January 1881, he escaped to Jauja in the mountainous hinterland of Peru.