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,
Brazil–Peru border infrastructure, cooperation (mainly in social and security issues), border integration and economic-trade integration. In the field of physical integration, once the Interoceanic Highway, which connects the State of Acre with the Pacific and inaugurated in 2011, the two countries started to study a Bioceanic Railroad project, object of a Brazil-Peru-China Memorandum of Understanding signed In May 2015. These projects are strategic for the integration of the economies of the North and the Midwest of Brazil to Peru and the Pacific. Brazil–Peru border The Brazil–Peru border is the line, located in the Amazon Rainforest, that limits the territories of Brazil and