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' Ejército de la Breña, ending any real threat or resistance in the Peruvian Andes.
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.
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.
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.
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.
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.
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.
Cáceres' plan was to initiate the attack by destroying his enemy's most vulnerable position, southeast of Sazón hill.
Two companies of the Chilean Zapadores Regiment managed to get down the Sazón heading for the Peruvian positions on Santa Bárbara hill.
[1] For a moment both armies were on equal footing, while the Chilean right wing was defended by one company of the Talca Battalion[5] facing the troops of General Manuel Cáceres.
Many more died or were executed after the battle, among them one of Peru's greatest heroes, Colonel Leoncio Prado, due to failing to keep his word to stay out of the war.