Peru was heavily indebted, and political in-fighting was again on the rise. Peru embarked on a railroad-building program that helped but also bankrupted the country. In 1879, Peru entered the War of the Pacific which lasted until 1884. Bolivia invoked its alliance with Peru against Chile. The Peruvian Government tried to mediate the dispute by sending a diplomatic team to negotiate with the Chilean government, but the committee concluded that war was inevitable. Chile declared war on 5 April 1879. Almost five years of war ended with the loss of the department of Tarapacá and the provinces of Tacna and Arica,
First Upper Peru campaign He planned the reorganization of the Mines of Potosi, and a reform at the University of Charcas. He proclaimed the end of native slavery in the Upper Peru, canceling the tutelage and giving them political rights as neighbors, equal to those of the criollos. He prohibited as well the establishment of new convents and parishes, to avoid the common practice that, under the guise of spreading the Christian doctrine, the natives were forced into servitude by religious orders. He authorized free trade and redistributed land expropriated from the former workers of the mills. The decree was published in Spanish, Guarani,