Following the outbreak of war in April 1879, both sides focused on gaining naval superiority, since the extremely arid Atacama Desert was a formidable barrier for a land campaign.
After the Chileans seized the port of Antofagasta on February 14, 1879, and secured it with the following victory at Calama on March 23, the focus was to destroy the Peruvian fleet.
To achieve that goal, on April the Chilean government ordered Rear Admiral Juan Williams Rebolledo to sail to El Callao to sink the enemy ships on the docks or at anchor.
All this led to a simultaneous encounter at Punta Gruesa and Iquique on May 21, which proved decisive as the Peruvians lost one of their two modern ships -the ironclad Independencia-, to an old wooden schooner, the Covadonga; and the heroic death of Captain Arturo Prat and the loss of his old corvette, the Esmeralda, lifted the troops morale and ignited a nationalism among the Chileans which led a massive civilian enrolment.
The chase ended a week later with the decisive clash at Angamos on October 8, where Grau died and his ship was captured and later put under Chilean service.
Therefore, when the war started, the Chilean army had only 2,995 soldiers divided into four infantry regiments and another two of cavalry, which main experience was to patrol the frontier with the "araucanos", the Indians who held back the Spanish since the 1500s.
The navy was about five old wooden corvettes and schooners -among them the Esmeralda and the Covadonga, until during Federico Errázuriz Echaurren's administration two modern ironclads, the Blanco Encalada and the Cochrane were bought in England.
However, the Chileans had an advantage with the Belgian Comblain rifle, which was rear loaded allowing a superior rate of fire, and the cavalry had Winchester carbines.
Almost the entire Bolivian army was equipped with front-load muskets, with the only exception of Hilarión Daza's praetorian guard, the "Colorados" Battalion.
They had a navy in equal footing with the Chileans, with two modern vessels, the ironclad Huáscar and the frigate Independencia, plus a few ships like the corvette Unión.
The Army Commander in Chief, José Arteaga, and the Navy Admiral, Juan Williams, were veterans with more than forty years in service.
Besides, bitter disputes between the older and a younger generation of officers in both branches did nothing but to convince President Pinto to appoint a civilian -War Minister Rafael Sotomayor- to supervise their planning and the war effort development.
Sotomayor wanted to attack in a spot between the Allied strongholds of Arica and Iquique, cutting their communications lines and enabling the army to take them out one at the time.
After reviewing the terrain and weeks of preparations, it was decided to strike at Pisagua, a small port with a suitable bay for unloading troops and supplies.
With this difficulty in mind, on May 4 the Bolivian 3rd Division was embarked from El Callao to Pisagua, and established at Alto Hospicio, over the port's hill tops.
The Peruvian General Juan Buendía was in command of the Allied Southern Army at Tarapacá, who despite the importance of Pisagua didn't secure it as he should.
Following the rail road, the raids found a water dwell at Dolores saltpetre office, which was rapidly reinforced with 6,500 men within the week, under Colonel Emilio Sotomayor.
Since outnumbered, Colonel Emilio Sotomayor deployed his troops over the San Francisco and Sazón hills watching the Allied movements over the plain.
Buendía wanted to attack immediately, but was convinced otherwise by Col. Suárez, making him notice of the troops fatigue after a long march across the desert.
Sotomayor endured three attempts to overrun him which demoralised the Allies who fled from the battlefield in complete confusion, leaving all kinds of material and artillery.
However, his force grew considerably with Los Ríos' division, that left its post at Iquique when the Chilean blockade resumed, and Belisario Suárez -Buendía's Chief of Staff- soldiers.
Arteaga decided to attack dividing his force into three major columns, under Col. Ricardo Santa Cruz Vargas [es], Lt. Col. Eleuterio Ramírez and himself.