Battle of Yungay The Battle of Yungay ( or Yungai ) effectively destroyed the Peru - Bolivian Confederation created by Bolivian Marshal Andrés de Santa Cruz in 1836 . On January 20 , 1839 , the alliance formed Chilean Army led by Chilean General in Chief Manuel Bulnes and force of Peruvians opposed to Santa Cruz , decisively defeated the Confederate Army commanded by Santa Cruz after six hours of combat in the battlefield of Yungay , in northern Peru , 200 km north of Lima . The Chilean victory at Yungay effectively brought the Peru - Bolivian Confederation to an end , and Andrés de Santa Cruz exiled himself in Guayaquil , Ecuador . The Peruvian government paid the debt contracted with Chile due to Chilean aid on the restoring campaign , also giving decorations and awards to Chilean and Peruvian officials . Also , Peruvian officers who served under the Confederation - among them Guillermo Miller , Mariano Necochea , Luis José Orbegoso , Domingo Nieto – were banned from the Peruvian army . The victory of Yungay is remembered by the Chilean Army with the " Hymn of Yungay " , and by Peru with the creation of the Ancash Department . Prologue . Lead by Rear Admiral Manuel Blanco Encalada the first Chilean incursion into Peruvian territory , during the war between Chile and the Peru - Bolivian Confederation , this incursion was defeated at the Battle of Paucarpata by Andrés de Santa Cruz forces , Blanco ans Santa Cruz signed the Treaty of Paucarpata on November 17 , 1837 . By signing this pact , Chile agreed to resume the commercial trade and the Confederation would recognise and pay the Chilean efforts in the Peruvian independence war . Upon Blanco Encalada ' s return , however , the Chilean Parliament and the public opinion rejected the treaty and organised a second expedition of 5 , 400 soldiers under General Manuel Bulnes , along with 600 expatriate Peruvians under General Agustín Gamarra serving as reinforcements . Andrés de Santa Cruz , the Bolivian Marshal , responded immediately reinstating the hostilities . The second Chilean campaign had more success than the first one as the Restoring Army marched into Lima , after defeating confederate General Orbegoso at the battle of Portada de Guías on August 21 , 1838 . Also , the Chilean Fleet secured sea domination in the Battle of Casma . Despite this victory , and forced by the lack of supplies and disease , the Restoring Army marched to Huacho in the North Peruvian territory abandoning the capital city by November 1838 , as news arrived indicating that Santa Cruz was closing with an outnumbering army to Lima . Afterwards , Santa Cruz entered into the city under popular ovation , then proceeded to follow Bulnes ' forces . Both armies engaged in the Battle of Buin , on January 6 , 1839 , in the confluence of the Buin and the Santa rivers , with indecisive results , since Bulnes continued marching north and Santa Cruz resumed the persecution seeking to deliver a final blow to the Chilean expedition to cement Confederation ' s dominance in the region . Thus , Santa Cruz advanced to capture and occupy Yungay , intending to cut the Chilean supply lines and strangle the Chilean Expedition . His intention wasn ' t to obliterate the Restoring Army , but rather to force Bulnes to sue for peace , and surrender to a superior Peruvian force . Bulnes had other plans however , knowing that returning empty - handed was not an option after the failure of the previous force under Blanco Encalada . Contenders . Both armies had approximately 6 , 000 men , although the numbers favoured slightly the side of the Confederation and Santa Cruz . The Chilean Expedition , on the other hand , suffered the decimation of some battalions by plagues during its occupation of Lima , the capital of the North - Peruvian Republic . Comparably equipped , the main difference was in the preparation of the troops , the knowledge of the terrain , and the obvious differences between invaders and defenders . Confederation Army . The Confederacy Army was made up of veterans of internal battles from both Peru and Bolivia . It was generally supported by the population of Peru and possessed strong supply lines thanks to the site of the battle . Its commanding officer , General Andrés de Santa Cruz ; was regarded as a resourceful tactician and a capable leader . His army had about 6 , 000 men divided into three divisions , adding up nine infantry battalions and two cavalry regiments . Chilean Army . The Chilean Expedition had the experience of Gen . Manuel Bulnes . On the other hand , it was not popular with the locals and was hampered due to disease , bad morale , and some less experienced units . This army of 5 , 400 soldiers was conformed by nine infantry battalions and three cavalry regiments grouped into four divisions . Preliminary moves . Both armies marched under the rain , with the restoring force establishing near Tarar from where it marches towards San Miguel , while Santa Cruz after detaining in Tarhuaz , occupied the town of Yungay on January 13 . On the night of January 19 , Santa Cruz sent Colonel Rodriguez Margariños to observe the Chilean positions . Besides , ordered to Bolivian Colonel Anselmo Quiroz with 600 soldiers to assume positions on the Pan de Azúcar hill top , while Colonel Fructuoso de la Peña advanced to the Punyan summit with another 200 soldiers . On January 20 , with the sunrise , Gen Bulnes marched with his four divisions to Yungay , whilst Santa Cruz deployed his army by the Ancash river , with Herrera ' s division on the right wing , in the middle was set the artillery and behind it the cavalry led by General Perez de Urdinea . Finally , Moran ' s division was stationed on the left flank . Battlefield . Both forces were separated by a short valley formed by the Santa river and the mountains , with the Punyan , Ancash and Pan de Azúcar hill at the far end of this site , behind these highs lies the deep Ancash glen , followed by the confederate trenches . The battle . Confrontation on the Punyan and Pan de Azúcar hills . Bulnes decided to start attacking the Punyan confederate positions . In order to do so , the Aconcagua Battalion was dispatched to clear out the hill , who climbed and forced Peña ' s confederate companies to retreat . After them , Bulnes sent on the Portales , Valdivia and Huaylas battalions . At 09 : 00 , a column of 400 soldiers under Jeronimo Valenzuela and formed by companies of the Carampangue , Santiago , Valparaíso and Cazadores de Peru battalions , were sent to the Pan de Azúcar hill to assail Col . Quiroz ' positions . The restoring troops began the slowly climbing of the hill slope under heavy confederate fire . With the Carampangue Battalion company led only by a sergeant - a female officer , Candelaria Perez - because the unit had all its officers down , and with the other battalion companies decimated , finally the Chilean soldiers reached the summit and bayoneted the confederates out of the Punyan hill , annihilating Quiroz ' forces . All of the confederate soldiers and officers were killed , including Quiroz himself . Valparaíso Battalion Sergeant Jose Alegria raised the Chilean flag on the Pan de Azúcar summit . Manoeuvres on the Ancash Glen . Marshall Santa Cruz sent Col . Deheza ' s battalion to reinforce Quiroz at Punyan hill , marching through the Ancash glen , but in their route encountered and engaged the Colchagua Battalion led by Col . Urriola , forcing the Chileans to refold with a bayonet charge . Bulnes ordered the Portales Battalion to aid Urriola , manoeuvre that obliged the Bolivians to pull away from the glen to Herrera ' s positions with a third of it initial soldiers dead . With the Pan de Azúcar and Punyan hills conquered , Gen . Bulnes planned a frontal attack on Santa Cruz army , arranged in a line of trenches on the opposite side of the Ancash river . So , the Chilean forces converged on the river edge , and the Colchagua and Valdivia battalions were dispatched to engage the confederate right flank guarded by Herrera ' s division , while the Portales , Cazadores de Perú and Huaylas battalions were ordered to onset Col . Moran ' s division . The five cannon battery of Col . Marcos Maturana allocated on the Punyan heights began to fire and slowly to dismantle the confederate trenches . Due to the bridge over the Ancash had been destroyed , the restoring forces had to descend to the river shore and march across it . When the Restoring Army crossed the river , the battle was joined on the entire front line , with the restoring army in the open and the confederates firing upon them from the trenches . From this protected position , the confederate divisions thwarted the restoring attack . At 14 : 30 , Gen . Pedro Bermudez drove his 3rd of Bolivia Battalion in a bayonet charge upon the Portales Battalion , which started to cede under the Bolivian pressure , breaking the restoring line . Following , the cavalry was sent to cut the Chilean retreat while the infantry forwarded from their protecting positions to attack the restoring troops in the open field . Decisive blow . Having witnessed the Chilean retreat , Gen . Bulnes took command of the Valparaíso Battalion and crossed the Ancash heightening Col . Garcia ' s unit . Likewise , the Santiago and half Huaylas battalions strengthened the Chilean right wing , allowing the relieved units to gather up and resume the attack . A few confederate battalions managed to return to their trenches . Perez de Urdinea ' s cavalry crossed the river and collided with Baquedano ' s Cazadores a Caballo Cavalry Regiment . As a result of this clash , taking place near the confederate line , Baquedano was wounded and forced to retreat , only to attack again now with five cavalry squadrons , making Perez de Urdinea to regroup with the confederate infantry trying to retreat to their trench line . On a third massive charge , Baquedano broke Santa Cruz ' left flank and the entire confederate front collapsed . With both armies now engaging in the gap between the trenches and the water , the confederates tried to resist but were outflanked and completely vanquished . The disbanded troops were persecuted by the Chilean cavalry and killed . According to Gonzalo Bulnes , 277 confederate troops were found dead on the road between Manco and Yungay . Santa Cruz , followed by his generals Riva Agüero , Cerdeña and Miller , left the battlefield around 15 : 00 . Aftermath . This was a harsh defeat for the Peru - Bolivian Confederation . Santa Cruz had around 3 , 000 casualties , including 2 generals , 9 colonels , 100 officers and 2 , 500 soldiers , equivalent to a 50 % of its effective force . The Restoring Army lost 1 general , 39 officers and 622 soldiers . The Battle of Yungay brought as a consequence the end of the Peru - Bolivian Confederacy , with the Chilean Expedition reoccupying Lima in April . On August 25 , 1839 General Agustín Gamarra assumed the Presidency of Peru , officially declaring the dissolution of the Confederation and the Union of the North and South Peru . Santa Cruz was exiled , first to Guayaquil , Ecuador , then to Chile and finally to Europe , where he died in Beauvoir , France , on September 25 , 1865 . He was 72 .