After the war and in poor health, he retired to Miraflores, Lima where he married the young Limenian, Juana Valle Riestra. But his civilian life was short. When Gran Colombia–Peru War broke out in 1829, he was asked to take command of the Peruvian Navy. Appointed Vice-Admiral, his fleet captured Guayaquil but he was killed by a sniper during the battle.