PLEnlist

Battle of Yungay, 1839: the day the Peru-Bolivian Confederation fell

War of the Confederation · 20 January 1839 · United Restoration Army vs Peru-Bolivian Confederation · ~9 min read · Updated October 2026

Next anniversary: 20 January 2027, the 188th anniversary 20 January in history ›

Watercolor of a steep conical hill in a mountain valley with lines of troops attacking up its slopes and columns of infantry and cavalry on the plain below, with pale mountain ranges behind.

“Ataque del Pan de Azúcar,” watercolor view from the Plan de la batalla de Yungay, 1839, Library of Congress, via Wikimedia Commons, public domain.

At a glance

United Restoration Army (Chile and Peruvian restorers)General Manuel Bulnes
vs
Peru-Bolivian ConfederationProtector Andrés de Santa Cruz
Date
20 January 1839, from 10 a.m. to 4 p.m. by Bulnes's report
Location
Yungay, in the highlands of northern Peru
War
War of the Confederation, 1836 to 1839
Opening action
The storming of the Pan de Azúcar hill by Restoration infantry
Strength
Restoration Army 5,267 (Gonzalo Bulnes, Sotomayor Valdés) to about 6,000 (Encyclopedia of Latin American History and Culture); Confederation 4,052 (Santa Cruz's own figure) to 6,100 (Bulnes's report)
Losses
Confederation more than 1,400 killed and 1,600 men captured (Bulnes's report) or 2,054 dead counted (Placencia's diary); Restoration 215 dead buried (Placencia) to about 1,300 (Gonzalo Bulnes)
Outcome
Decisive victory for the United Restoration Army; Santa Cruz fled and the Confederation was dissolved
Quick answer

What happened at the Battle of Yungay?

On 20 January 1839, at Yungay in the Andean department of Ancash in northern Peru, the United Restoration Army of Chileans and Peruvian opponents of Andrés de Santa Cruz, led by the Chilean general Manuel Bulnes, defeated the army of the Peru-Bolivian Confederation. The fight opened with the storming of the Pan de Azúcar hill. Santa Cruz fled into exile and the Confederation he had created in 1836 was dissolved.1

Yungay is little known outside the Andes, but it decided the shape of three countries. The battle ended a three-year experiment that had joined Peru and Bolivia under one ruler, and in Chile it became a founding legend of the young republic, still remembered every 20 January.2

Who won the Battle of Yungay and why?

The United Restoration Army of Chileans and Peruvian opponents of Santa Cruz, under Manuel Bulnes, won. Its infantry stormed the Pan de Azúcar, the outpost Santa Cruz thought could not be taken, held on when a counterattack drove back its center, and broke the Confederation's army once fresh battalions and the cavalry crossed the Ancash ravine.3

Background: Santa Cruz's confederation

Peru won its independence in 1824 and Bolivia in 1825, and the idea of joining them was in the air from the start, the historian Joaquín Fernández of Finis Terrae University told BioBioChile. Andrés de Santa Cruz, a former royalist officer who had fought for independence under Bolívar and Sucre and became president of Bolivia in 1829, made it real. Using the Peruvian civil wars of 1835, he conquered Peru and divided it into a northern and a southern state, which together with Bolivia formed the Confederation, with himself as protector.4

The decree that created the office gave Santa Cruz a term of ten years as protector, with the right to be reelected, according to the Encyclopedia of Latin American History and Culture and Fernández. The northern Peruvian elites resented the new state, Fernández says, while highland regions such as Arequipa and Cusco favored it as a counterweight to Lima.5

Dark locator map of the Pacific coast of South America with a gold star in a glowing circle marking the approximate site of the Battle of Yungay in the Andes of northern Peru, with a small world map inset
Yungay, in the valley of the Santa river in the Andes of northern Peru: the star marks the approximate site, and the inset shows the area on a world map. Drawn for this article from Natural Earth data, with no modern borders. Location map: © Echoes of Battle (data: Natural Earth, public domain)

Why Chile went to war

Chile watched with alarm. The rivalry between the ports of Valparaíso and Callao was turning into a tariff war, Peru still owed Chile money from the wars of independence, and a powerful new state on the northern border threatened Chile's place on the Pacific. When the Chilean exile Ramón Freire sailed from a Peruvian port in an attempt to overthrow the government in Santiago, the minister Diego Portales had his pretext, and in 1836 the war began.6

Chile was not alone: Argentina also went to war with Santa Cruz, though its army was beaten in 1837. The first Chilean expedition, under Admiral Manuel Blanco Encalada, ended after some fighting in the Treaty of Paucarpata, which recognized the Confederation in all but name; the government in Santiago repudiated it. Portales himself did not live to see the outcome. In June 1837 he was killed by mutinous troops at Quillota, an event that shook a country already divided over the war.7

Armies and commanders

Manuel Bulnes commanded the second expedition. It was a joint force: Peruvian generals hostile to Santa Cruz, among them Agustín Gamarra and Ramón Castilla, marched with the Chileans, and the army called itself the United Restoration Army, restoring, as it claimed, Peru's independence.8 › Battle of Maipú, 1818

Full-length oil portrait of a heavy-set general in a dark blue uniform heavily embroidered with gold, with a red sash, white breeches and a plumed hat under his arm, standing before red curtains
General Manuel Bulnes, the victor of Yungay, painted by Raymond Monvoisin in 1843, when he was president of Chile. Museo Nacional de Bellas Artes, Santiago. Public domain, via Wikimedia Commons

Andrés de Santa Cruz commanded the Confederation's army in person. His line had General Ramón Herrera's Bolivian division on the right and General Trinidad Morán's division of Peruvian battalions on the left, with two cavalry regiments under General Pérez de Urdininea behind them; the protector took his own post behind the cavalry, where he could watch the whole field.9

The position and the numbers

Santa Cruz had chosen strong ground. General Quiroz held the steep cone of the Pan de Azúcar, in front of the main position, with about 600 men in five companies. Behind it the deep ravine of the Ancash stream cut across the valley, and beyond the ravine the Confederation's infantry stood behind a long stone parapet, its right against the mountains and its left on the Santa river.10

How many men fought is disputed. Gonzalo Bulnes, who went through the Chilean muster rolls in 1878, counted 4,467 Chilean officers and men and about 800 Peruvians in two battalions, 5,267 in all, and Ramón Sotomayor Valdés gives the same total; the Encyclopedia of Latin American History and Culture credits Bulnes with a combined force of 6,000. For Santa Cruz the figures run from the 4,052 men he admitted to in his manifesto from Quito to the 6,100 of Bulnes's official report, and both Chilean historians put his army at no fewer than 6,000.11

The commanders' decisions

Bulnes judged that the battle could not be fought until the Pan de Azúcar was taken: as long as it held out, its garrison could fire into his columns and cut their retreat. He also asked President Gamarra, who had come to the field in person, not to expose his life, and Gamarra stayed with the reserve on the near side of the Ancash. Santa Cruz, for his part, believed the hill could not be taken.12

Who really directed the victory was disputed decades later. In September 1863 a letter signed “A Peruvian” in the Lima newspaper El Comercio, which Gonzalo Bulnes attributes to the Arequipa canon Juan Gualberto Valdivia, claimed that around one o'clock Bulnes had ordered a retreat to San Miguel and that General Ramón Castilla had turned the troops back and won the battle. Gonzalo Bulnes dismissed the story, pointing to units in it that had never existed.13

The battle in phases

The campaign. After several campaigns in Peru, Bulnes's army met Santa Cruz's army at Yungay, in the valley of the Santa river in the highlands of Ancash, on 20 January 1839.14

The Pan de Azúcar. The battle opened with an attack on the Pan de Azúcar, a steep hill held by Confederation troops. Restoration infantry, Chileans and Peruvians together, climbed it under fire and after a hard fight drove the defenders off the top; both the retired officers' association UNOFAR and Chile's Museo Histórico Militar make its capture the first act of the battle.15

The assault column was made up of four companies of light infantry, from the Carampangue, Santiago and Valparaíso battalions and the sixth company of the Cazadores del Perú, under Comandante Jerónimo Valenzuela, with the Peruvian colonel Juan Antonio Ugarteche. They went up at about nine in the morning under fire and a hail of rolling stones, on slopes so steep that the men had to haul themselves up on their muskets and on one another.16

Valenzuela and his second, Major Andrés Olivares, were killed on the way up, and so were most of the officers; one company reached the top led by a sergeant. On the summit the fight was hand to hand. Bulnes's report, quoted by both historians, says the five companies holding the hill perished with General Quiroz, their commander.17

While the climb was still going on, the Bolivian 4th Battalion crossed the ravine to help the hill's garrison. Bulnes sent the Colchagua battalion against it; hidden in thick scrub, its men let the Bolivians come close and then fired a volley at short range. Companies of the Portales came up in support, the Bolivian battalion fell back across the Ancash, and in this fighting the Peruvian general Juan Bautista Eléspuru, at the head of the first division, was mortally wounded.18

Hand-drawn and watercolored plan of a battlefield in a river valley, with mountains, a road to Caraz and Yungay, a river marked Rio de Santa, and red and blue blocks for the two armies
The Plan de la batalla de Yungay, drawn after the battle in 1839, showing the valley with the road from Caraz to Yungay, the Santa river and the positions of the two armies; the view of the attack on the Pan de Azúcar above it on the same sheet appears as this article's hero. Library of Congress. Public domain, via Wikimedia Commons

The main battle. With the hill taken, the restorers advanced across the Ancash stream against the Confederation's main line. The fighting lasted for hours. Bulnes's own report, quoted by UNOFAR, called it "one of the most bitter and bloody battles ever seen in America," fought from ten in the morning to four in the afternoon, in which the enemy defended themselves "with extraordinary tenacity."19

Turning point: the cavalry on the flank

The crisis came in the afternoon. The Portales battalion, worn out after hours under fire in front of the parapets, began to give way, and the Bolivian 3rd Battalion leapt out of its trenches and charged it with the bayonet. Bulnes led the Valparaíso battalion across the ravine himself, and its arrival stopped the counterattack.20

The Museo Histórico Militar describes the decisive moment: after some four hours, when the Confederation's troops went over to the counterattack, Bulnes threw in his reserves, and his cavalry crossed the river and fell on the enemy's flank. A Chilean plan of the battle published in 1910 marks the same move, the squadrons that outflanked the enemy's left. Caught in front and rear, the Confederation's battalions broke, and the museum puts their losses in killed and captured at more than half their strength.21

The cavalry had a hard passage. The ravine could be crossed only in single file, and the first squadrons over, led by Colonel Fernando Baquedano, charged at once and were thrown back by Santa Cruz's escort and the Bolivian Lancers; Baquedano was wounded. He rallied them, charged again, and at the third attempt, with almost all the Chilean cavalry, drove the Confederation's horsemen back onto their own infantry. The restorers then went over the parapets with the bayonet.22

Printed plan of the battle in a river valley below the Andes, with the Santa river, the haciendas, the Pan de Azúcar and the lines of the two armies, and a lettered key underneath
Plano de la Batalla de Ancass, a Chilean plan of the battle published in 1910, with a key that marks the attack on the Pan de Azúcar, the order of battle of both armies, the squadrons that outflanked the enemy's left and the reserves. Biblioteca Nacional de Chile. Public domain, via Wikimedia Commons

Among those who won fame that day was Candelaria Pérez, a cantinera, or sutler, with the Carampangue battalion. UNOFAR calls her the first woman whose service in the army and in a war is recorded in some detail, and says she was made a second lieutenant for her services; Fernández calls her Sergeant Candelaria Pérez and names her, with the Indigenous lieutenant Juan Lorenzo Colipí, among the new national heroes the war gave Chile from groups that had been outside public life.23

Counting the losses

In his report Bulnes put the enemy's loss at two generals and more than 1,400 men killed, and three generals, nine colonels, 155 officers and 1,600 men taken prisoner, together with all the artillery; both Gonzalo Bulnes and Sotomayor Valdés quote these figures. A staff diary kept by Colonel Antonio Placencia, quoted by Sotomayor Valdés, counted 2,054 Confederation dead and 215 of the Restoration's own buried at the Ancash, while Gonzalo Bulnes puts the Chilean loss at about 1,300. The Museo Histórico Militar says the Confederation lost more than half its strength in killed and captured.24

Aftermath

Yungay broke Santa Cruz, and the Confederation was dissolved at once. Santa Cruz himself had left the field before the fighting ended. He fled first to Lima and then to Arequipa, hoping to rebuild his army, and from the port of Islay sailed away on a British frigate into exile in Ecuador, as Gonzalo Serrano del Pozo and the Encyclopedia of Latin American History and Culture both relate.25

He did not give up. When he later tried to return, he was caught: Serrano, working from the papers of the time, has him arrested at Tacna in southern Peru, while Fernández speaks of his capture by Chile. Either way he ended in Chilean custody, held at Chillán until 1846, and Serrano argues that President Bulnes treated his captive with marked care. Santa Cruz later left for Europe and died in France in 1865.26

In Peru, Agustín Gamarra became president. In 1841 he tried to bring Bolivia under Peru and was killed in battle at Ingavi, and both countries entered years of disorder. Fernández sees Bolivia gravely weakened and Chile the winner of the commercial rivalry between the Pacific ports.27

Legacy and memory

In Chile the war changed patriotism. The song of Yungay and the Day of the Chilean Roto, the common soldier, came out of it. Bulnes became a national hero in his lifetime and in 1841 was elected president of Chile. On the battlefield Gamarra had already hailed him as Grand Marshal of Ancash.28

Historians have long seen the victory as a building block of Chilean national identity. Serrano cites Mario Góngora, for whom Yungay and similar battles helped form a truly national consciousness, and Ricardo Krebs, who saw the war as a means of preserving and realizing the nation. He also notes critics, such as Jorge Núñez, who called it a war decided by a narrow conservative circle around Portales.29

Frequently asked questions

When was the Battle of Yungay?

On 20 January 1839, in the department of Ancash in northern Peru.

Who fought at Yungay?

The United Restoration Army of Chileans and Peruvian opponents of Santa Cruz, under the Chilean general Manuel Bulnes, against the army of the Peru-Bolivian Confederation led by its protector, Andrés de Santa Cruz.

How many soldiers fought at Yungay?

The figures are disputed. The Restoration Army had 5,267 men by Gonzalo Bulnes's count of the Chilean muster rolls, or about 6,000 by another estimate; the Confederation had between the 4,052 men Santa Cruz admitted to and the 6,100 of Bulnes's report.

What was the Pan de Azúcar?

A steep hill held by the Confederation's troops. Its storming by Restoration infantry opened the battle.

Why did Chile fight the Peru-Bolivian Confederation?

Because of rivalry between the ports of Valparaíso and Callao, unpaid Peruvian debts, Santa Cruz's support for Chilean exiles under Ramón Freire, and fear of a powerful new state on Chile's northern border.

Who was Candelaria Pérez?

A cantinera with the Carampangue battalion who fought at Yungay and was honored for it, one of the first women whose military service in Chile is recorded in some detail.

What happened to Santa Cruz after Yungay?

He fled into exile in Ecuador, was caught when he tried to return, was held in Chile until 1846 and died in France in 1865.

Notes

A number in the text points to a note; each note names the works that paragraph draws on, listed in full under Sources.

  1. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Yungay, Battle of”. ↩
  2. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”. ↩
  3. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto; Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”. ↩
  4. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Santa Cruz, Andrés de (1792-1865)”. ↩
  5. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Peru-Bolivia Confederation”. ↩
  6. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “War of the Peru-Bolivia Confederation”. ↩
  7. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Peru-Bolivia Confederation”; Encyclopedia of Latin American History and Culture, “War of the Peru-Bolivia Confederation”; Encyclopedia of Latin American History and Culture, “Portales Palazuelos, Diego José Pedro Víctor (1793-1837)”. ↩
  8. Encyclopedia of Latin American History and Culture, “Bulnes Prieto, Manuel (1799-1866)”; Encyclopedia of Latin American History and Culture, “Yungay, Battle of”; Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  9. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  10. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  11. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto; Encyclopedia of Latin American History and Culture, “Yungay, Battle of”. ↩
  12. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  13. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; “Un peruano” [attributed to Juan Gualberto Valdivia], letter to General Bulnes, El Comercio. ↩
  14. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Yungay, Battle of”; Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”. ↩
  15. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”. ↩
  16. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  17. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  18. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  19. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”. ↩
  20. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto; Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”. ↩
  21. Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”; Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  22. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  23. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”. ↩
  24. Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto; Museo Histórico Militar de Chile, “Batalla de Yungay - 20 enero 1839”. ↩
  25. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Peru-Bolivia Confederation”; Gonzalo Serrano del Pozo, “Andrés de Santa Cruz y su cautiverio en Chile (1844-1846)”; Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  26. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Santa Cruz, Andrés de (1792-1865)”; Gonzalo Serrano del Pozo, “Andrés de Santa Cruz y su cautiverio en Chile (1844-1846)”. ↩
  27. BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Yungay, Battle of”. ↩
  28. Unión de Oficiales en Retiro de la Defensa Nacional, “Batalla de Yungay (20 de enero de 1839). Día del Roto Chileno”; BioBioChile, “La vez que Perú y Bolivia fueron un solo país y Chile lo disolvió”; Encyclopedia of Latin American History and Culture, “Bulnes Prieto, Manuel (1799-1866)”; Gonzalo Bulnes, Historia de la campaña del Perú en 1838; Ramón Sotomayor Valdés, Historia de Chile bajo el gobierno del jeneral D. Joaquín Prieto. ↩
  29. Gonzalo Serrano del Pozo, “Andrés de Santa Cruz y su cautiverio en Chile (1844-1846)”. ↩

Sources

Battle honors of your homeland

The turning points of history

Marathon, Gaugamela, Cannae, Constantinople, Waterloo, Stalingrad: the days the world changed course.

Based on your country, which we do not store · why? ·

Storm the Pan de Azúcar

Echoes of Battle brings the great battles of history to life, scene by scene on the real map. Enlist below and we will send word to your inbox the day it launches.

Or supply the campaign on Ko-fi ›