After Lima was occupied by the Chileans, he marched to the sierra and was elected deputy from Alto Amazonas to the National Assembly meeting in Ayacucho, but he did not join it and preferred to take up arms, joining the resistance of the Sierra led by Andrés A. Cáceres. He participated in the battles of Marcavalle and Pucará, and Concepción. In the battle of Huamachuco he had under his command the 4th Army Division of the Center and died as a result of a shot that pierced his forehead.