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,
Japan–Peru relations Japan entered the Meiji period and began fostering diplomatic relations with several nations, after decades of isolation. Prior to establishing formal diplomatic relations; in June 1872, Japan and Peru had a diplomatic incident when a Peruvian ship called the "María Luz" set sail from Macau to Callao carrying 232 Chinese indentured labourers for Peruvian plantations. On the way to Peru, the ship encountered a severe storm which caused some damage to the ship and called on the Japanese port of Yokohama for repairs. At port, one Chinese laborer managed to escape and jumped to shore. Once on shore, the laborer