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,
Flag of Peru on battleships, usually with the ensign of the highest-rank officer on board above it. During the Viceroyalty of Peru, the colonial-era Spanish flag flew over Peru. In 1820, during the struggle for independence, British-born General William Miller hoisted in Tacna the first flag that represented the emerging country. Though the original flag itself is now lost, it was described as navy blue, defaced with a golden sun representing Inti. The first flag of the Republic of Peru was created by General José de San Martín, and officially decreed on 21 October 1820. It is diagonally quartered, with white upper and