The Peruvian-Chilean War (also known as the War of Upper Peru) was a military conflict between Chile and Peru between 1857-1859, fought over border disputes, foreign debt, a desire of many in southern Peru to join with Chile due to political instability in Lima, and unsettled issues dating back to the independence of both countries from Spain. Despite initial Peruvian victories in 1857, Chile reorganized after President Bulnes personally took command of the army and launched a daring counterattack in the spring of 1858, defeating three Peruvian government armies in four months and greatly aiding the Andean rebels. The Treaty of Alta Real was signed in 1859, ending the conflict largely in Chile's favor, with much of Upper Peru being added to Chile as a result.
The war was a major cultural moment in both nations. In Chile, the war established the country as a regional power and significantly lowered the threat of an invasion by Argentina or England, both of which were risks in the early 1860's. His domestic and military leadership elevated Manuel Bulnes to hero status in Chile and largely paved the way for him and his successors to have free reign over government policy for the next two decades. It also kickstarted the "Good Years," more than half a century of economic and cultural prosperity in Chile widely regarded as the country's golden years. In Peru, however, the war continued instability and decline within the country, including civil wars, military and personal dictatorships, and widespread poverty for decades.