Despite being a veteran, he knew how to adapt to modern tactics and contributed to the organization, equipping and training of the army destined for the defense of Lima, overcoming great difficulties. He attended the battles of San Juan and Miraflores, on January 13 and 15, 1881 and acted directly on the battlefield. During the Battle of San Juan and Chorrillos, he ordered that the Huánuco battalion advance to the neck of the Cerro "Viva el Perú", that the Paucarpata battalion support it and that the Áncash battalion reinforce the Cáceres division; He also ordered the withdrawal of Belisario Suárez and that the cavalry moved in support of César Canevaro. All his measures delayed the advance of the enemy, showing initiative, despite the deficiencies of his troops in both training and war material.