The Battle of Huamachuco was fought on the 10 July 1883, and it was the last major battle of the War of the Pacific. The Chilean soldiers, led by Colonel Alejandro Gorostiaga, decisively defeated the Peruvian army commanded by General Andrés Avelino Cáceres near the town of Huamachuco. This Chilean victory effectively eliminated Cáceres' , ending any real threat or resistance in the Peruvian Andes. The Peruvian defeat paved the way for the Treaty of Ancón that finally put an end to the war. Also, one of Peru's greatest heroes, Colonel Leoncio Prado, died as a consequence of this battle.
Background
The defeats suffered by the Chilean Army at Marcavalle, Pucará and Concepcion, in addition to the decimation of their troops due to poor sanitation, convinced the Chilean High Command of the need to completely abandon the Central Andes. This retreat was made possible by the Chilean victory at Tarma Tambo on 15 July 1882. By that time, the occupation troops had been reduced to about half their original size. Peruvian General Andrés Cáceres controlled the Mantaro valley and had even briefly possessed the city of Huancayo. He established his command in Tarma and busied himself reorganizing his army. By January 1883, Cáceres had raised his troops to 3,200 well-armed and equipped men, and commanded central Peru.
Faced with this threat to the peace negotiations, Admiral Patricio Lynch, the Chilean Commander-in-Chief, decided to send a new force against General Cáceres. This new army comprised three divisions, under the command of Colonels García, del Canto and Arriagada. The Chilean army was well armed, and had learned the lessons of previous forays into the high Andes. Their plan was to surround and corner the Peruvians to force them into a conventional battle. Soon after they captured the strategic city of Jauja and on May 5 they reunited the forces in the city of Chiqlla. Faced with this grave threat, the Peruvian army retreated north.
On the 30 May the Peruvian army arrived at Cerro de Pasco, with the Chilean divisions under Colonels del Canto and García in close pursuit. Under those circumstances, the Peruvians continued to retreat into the high Andes. By the third week of June the Peruvians were in critical condition as the Chileans had almost cornered them. On June 22 General Cáceres ordered a retreat via the Llankanuku pass, located at an altitude of 3,850 meters and some 200 km (125 mi) north-west of Cerro de Pasco. Thanks to this risky maneuver he managed to evade the main Chilean force.
After many more hardships, on the 5 July the Peruvian army arrived at Tulpo, near Huamachuco, a further 120 km (75 mi) north of the Llankanuku Pass. The distances marched in the time taken—across some of the highest mountains in the world—by the Peruvians were astounding. Unfortunately, at Tulpo, General Cáceres learned that the Chilean Colonel Alejandro Gorostiaga was occupying the town. Whilst the colonel was isolated from the main body of the Chilean army, another Chilean group was advancing from the rear to reinforce him in the town and to help push the Peruvians towards Cajamarca. This second Chilean group carried an ammunition supply for Gorostiaga.
Cáceres decided to try to destroy this reinforcement before it could reach Gorostiaga's division, but Chilean scouts were on the alert and the planned surprise attack failed. At that point, the Peruvian general called a war council and the decision was taken to stop retreating and to try to destroy the Chilean forces occupying the town.
The battle
(This article needs revision and clear sources)
Forces deployment
On the 8 July 1883, the Peruvian forces - about 2,000 soldiers, plus a few hundred Indian guerrillas called montoneras - took positions on Cuyulga hill and on the facing Purrubamba hill, both overlooking the city. The Peruvians were armed with Peabody and Remington rifles, but didn't have much ammunition or bayonets. Originally General Cáceres divided his troops, with half on the Cuyulga hill and the rest on the left of it, to try to cut off the enemy from behind. However, Gorostiaga, as soon as he saw the Peruvians on the top of the hills, immediately gathered all his troops and evacuated the city, taking position in the Sazón hill, a perfect defensive position, with steep slopes and with a very difficult access facing the Cuyulga, a defensive position that in addition sported some Inca ruins that were to be used as parapets.