The Second Pacific War (Segunda Guerra del Pacífico in Spanish) was a conflict that took place in western South America from 1879 to 1880, in which Bolivia and Peru fought against Chile.
Recently, the South American Alliance formed by Bolivia, Chile, Ecuador and Peru had fought a war against the Kingdom of Spain over the control of the Chincha Islands, the First Pacific War or Chincha Islands War. The war had ended in 1865, but it wasn't until 1875 that the Treaty of Tallahassee was signed between Spain and the South American Alliance was signed. Spain, despite the defeat, managed to gain access to South America thanks to a commercial treaty with Peru and Bolivia, using the recently built Casas de España as headquarters to the trading missions.
The lack of a common enemy, however, meant that the South American Alliance would be driven apart. Ecuador chose to isolate itself from the other nations, while Chile on one side, and Peru and Bolivia on the other, started to face each other as both sides had opposing goals in regards to the domination of the South Pacific.
Antofagasta is a region that forms part of Bolivia, that lies on the Pacific coast. Its capital, Antofagasta, is Bolivia's only port. Due to the fact that, between the main part of Bolivia and Antofagasta, stand the Andes mountain chain and the Atacama Desert (the driest desert in the entire world) this region had been mostly settled by Chilean people that went to the region to work on its rich nitrate mines.
The main company in the region was the Chilean "Compañía de Nitratos y Ferrocarriles de Antofagasta" (Antofagasta Nitrate & Railway Company), which exploited many of the nitrate mines in the region without paying taxes, due to a deal made several years before with the Bolivian Government.
In 1878, the Bolivian Government decided to put a stop to this. Using a loophole in the fact that the deal had not been approved by the Bolivian Congress, the Government put a 10 cent per ton tax on the exploitation of nitrates. The Company complained to its parent government in Chile, which stated that, according to a treaty made in 1874, the Bolivian Government could not rise taxes on Chilean companies for 25 years. After several goings between the two governments and the company, Bolivia seized the company's assets and put them up for auctioning.
The war started with the invasion by Chilean troops of the city of Antofagasta on February 14th 1879, the same day the auction of the ANRC's assets was going to take place. The city's mostly Chilean population welcomed the soldiers, who occupied the region with little to no resistance. Bolivia delayed the official declaration of war for a month, trying to mobilize their troops while giving the Chileans an ultimatum, which gave them ten days from March 1st to abandon all Bolivian territory, an ultimatum that was ignored by the Chileans.
Peru, which was allied to Bolivia per a secret treaty made in 1873, attempted to mediate between the two nations, not wanting to get into a war that they were ill-prepared to fight. However, Chile, which knew of the Peruvian-Bolivian treaty, thought that Peru was just trying to gain time until they could finish their war preparations, and demanded that Peru declared its complete neutrality in the current conflict. As no official answer came forth, Chile declared war on Peru on April 5th, which was answered in kind on the 6th.
The Bolivian Navy was almost nonexistent, so most of the fighting in the seas was done between the Peruvian and Chilean ships. The Peruvian Navy's main ships were the ironclad Independencia and the monitor Huáscar, while the Chilean Navy's flagships were the ironclads Cochrane and Blanco Encalada.
The same day war was declared, the Chilean navy started the blockade of the Peruvian port city of Iquique, which lasted six weeks and ended in the Battle of Iquique, which was a pyrrhic Peruvian victory: the Huáscar, led by Captain Miguel Grau, managed to sink the Chilean corvette Esmeralda, but the Peruvian Independencia was lost in a stupid accident as it persecuted the schooner Covadonga.
This loss was, however, no obstacle for the Peruvian Navy: the Huáscar would manage to hold off the entire Chilean Navy, participating in several battles in the South American coast that always ended in stalemate or Peruvian victory. The great strike of luck happened on July 23rd, when the Huáscar managed to capture the steamship Rimac, which carried the entire Carabineros de Yungay cavalry regiment. This defeat provoked the fall of the Chilean government, and the replacement of Juan Williams Rebolledo with Galvarino Riveros Cárdenas as the Commander of the Chilean Navy.
This victory was sufficient to give Peru the chance to buy ships from foreign nations. Spain sold them two newly built ironclads, which were escorted to Iquique by a Spanish fleet and, once there, christened Independencia and Iquique. Led by the now Admiral Grau, the Peruvian Navy faced the Chilean Navy off Punta Angamos on October 8th, where the Chilean Blanco Encalada was sunk, giving victory to the Peruvians and turning the tables in the war against the Chileans.
The Peruvian naval superiority continued to increase, thanks to the ability of Admiral Grau, a superiority that became overwhelming with the victory in the Battle of Valparaiso of November 15th, where the Chileans lost their last ironclad, the Cochrane, making Chilean naval victories an impossibility.
Due to the disposition of the Antofagasta region, it took several weeks for the Peruvian-Bolivian armies to be able to launch an attack on the occupied region. This attack finally took place on October 20th, two weeks after the Battle of Punta Angamos. Peruvian troops landed near the city of Antofagasta and took the city after a brutal battle in which both sides lost more people to the ambient heat and humidity than to the enemy's bullets.
After securing Antofagasta, the Peruvian troops marched under a brutal sun through the Atacama desert, trying to take all the desert forts the Chileans had occupied before, while the Bolivians marched west from Bolivia proper. It was a difficult task that required two entire months to fulfil, but, by the end of that time, all Chilean soldiers had been killed or imprisoned, and the Bolivians were once more in control of the disputed region of Antofagasta.
The last event of the war was the occupation of the Chilean city of Copiapó by a mixed Peruvian-Bolivian army on January 20th 1880. To many Chileans, this was the last straw, and they demanded their government to end the war as soon as possible. An armistice was rapidly signed, and the three nations sat to determine the peace terms which would put an end to the war.
Treaty of Quito
On March 1st 1880, under British and US auspices, the three nations signed the Treaty of Quito, that officially finished the war betwee the three nations.
Fortunately for Chile, neither Bolivia nor Peru demanded the hand-over of territories to them, although they did not get out of the war unscathed: they were forced to renounce to all territories that were owned by Bolivia and Peru, to accept Bolivia's expropriation of the ANRC and the change of taxes determined by the Bolivian government before the war, and to pay 10 million pounds in compensation to both nations.
The war helped Peru to gain the supremacy in the South-Eastern Pacific, and created a climate of euphoria that would last many years. Miguel Grau Seminario, the hero of the war, would be proclaimed as a Hero of the Peruvian Republic, and, using his popularity, became the President of Peru in 1884, leading Peru towards the modernization of the society and industry and helping cement both the Peruvian-Bolivian alliance and the friendship ties with the Kingdom of Spain.