In the name of president Juan Antonio Pezet he signed the Vivanco–Pareja Treaty on 27 January 1865, which was one cause of the Chincha Islands War. From April to September 1865, he served as Prime Minister of Peru.