 In the campaign of November 1879 the Peruvian Navy lost their two most important warships, the iron clad Independencia was sunk by a corvette called Covadonga and the iron clad Huascar was captured by the iron clad Cochrane and Blanco Encalada, which had been supplied to Chile and Peru by British shipyards; the southern department of Tarapacá was overrun; and the professional Peruvian army was broken.Subsequently, Iglesias's friend, Nicolás de Piérola, launched a successful coup d'état, declaring himself Supreme Commander in Chief, and on December 23, 1879 he replaced President Prado who was considered to have mismanaged the conduct of the war thus far.One of the battalions lending their armed support to Pierola was Iglesias's "Vencedores de Cajamarca" and Pierola appointed Iglesias as Secretary of War in his new government.