Battle of Chacabuco The Battle of Chacabuco , fought during the Chilean War of Independence , occurred on February 12 , 1817 . The Army of the Andes of the United Provinces of the Río de la Plata led by General Captain José de San Martín defeated the Spanish force led by Rafael Maroto . It was a defeat for the Captaincy General of Chile , the Spain - controlled government established after the division of the Viceroyalty of Peru . Background . In 1814 , having been instrumental in the establishment of a popularly elected congress in Argentina , José de San Martín began to consider the problem of driving the Spanish royalists from South America . He realized that the first step would be to drive them from Chile , and , to this end , he set about recruiting and equipping an army . In just under two years , he had an army of some 6 , 000 men with 1 , 200 horses and 22 cannons , and , on January 17 , 1817 , he set out with this force to cross the Andes and liberate Chile . He found himself allying with Chilean patriot Bernardo O ' Higgins , who commanded his own army . Careful planning on his part had meant that the Royalist forces in Chile were deployed to meet threats that did not exist , and his crossing went unopposed . At the beginning of February 1817 the troops of San Martín finished his crossing of the Andes and prepared to put an end to Spanish dominion in Chile . The Army of the Andes ( as San Martin ' s force was called ) had suffered heavy losses during the crossing , losing as much as one - third of its men and more than half of its horses . The Royalist forces had rushed north to respond to their approach , and a force of about 1 , 500 under Brigadier Rafael Maroto blocked San Martin ' s advance at a valley called Chacabuco , near Santiago . In the face of the disintegration of the royalist forces , Maroto proposed abandoning the capital and retreating southward , where they could hold out and obtain resources for a new campaign . The military conference called by Royal Governor Field Marshal Casimiro Marcó del Pont on February 8 adopted Maroto ' s strategy , but the following morning the captain general changed his mind and ordered Maroto to prepare for battle in Chacabuco . The night before the combat , Antonio Quintanilla , who would later distinguish himself extraordinarily in the defense of Chiloé , confided with another Spanish official regarding his views on the ill - chosen strategy and that , given the position of the insurgents , the royalist forces ought to retreat a few leagues towards the hills of Colina : " Maroto overheard this conversation from a nearby chamber and either couldn ' t or refused to hear me because of his pride and self - importance , called on an attendant with his notorious hoarse voice and proclaimed a general decree on pain of death , to whoever suggested a retreat . " Although all Maroto and his troops had to do was delay San Martin , as he knew that further Royalist reinforcements were on the way from Santiago , San Martin was well aware of this as well , and opted to attack whilst he still had the advantage of numbers . The royalists fought with valor , but the battle turned into a complete defeat for them . Maroto , who succeeded in escaping thanks to the speed of his horse , was slightly injured during the retreat . Prelude . San Martín received numerous reports of the Spanish attack plans from a spy dressed as a " roto " , a poverty - stricken peasant of Chile . The " roto " told him that the Spanish general , Marcó , knew of fighting in the mountains and told his army to " run to the field " , which refers to Chacabuco . He also told San Martín the plan of General Rafael Maroto , the leader of the Talavera Regiment and a force of volunteers of up to 2 , 000 men . His plan was to take the mountainside and launch an attack against San Martín . On February 11 , three days before his planned date of attack , San Martín called a war council to decide a plan of attack . Their main goal was to take the Chacabuco Ranch , the Spanish headquarters , at bottom of the hills . He decided to split his 2 , 000 troops into two parts , sending them down two roads on either side of the mountain . The right flank was led by Miguel Estanislao Soler , and the left flank under O ’ Higgins . The plan was for Soler to attack their flanks while at the same time surrounding their rear guard in order to prevent their retreat . San Martín expected that both leaders attack at once so the Spanish had to fight a two - front battle . Battle . San Martín sent his troops down the mountain starting at midnight of the 11th to prepare for an attack at dawn . At dawn his troops were much closer to the Spanish than anticipated , and fought hard and heroically . Soler ' s troops had to go down a tiny path that proved long and arduous , and took longer than expected . General O ’ Higgins , supposedly seeing his homeland and being overcome with passion , defied the plan of attack and charged along with his 1 , 500 . What exactly happened in this part of the battle is fiercely debated . O ’ Higgins claimed that the Spanish stopped their retreat and started advancing towards his troops . He said that if he were to lead his men back up the narrow path and retreat , his men would have been decimated one by one . San Martín saw O ’ Higgins early advancement and ordered Soler to charge the Spanish flank , which took the pressure off of O ’ Higgins and allowed his troops to stand their ground . The firefight then ensued into the afternoon , and the tides turned for the Patriots as Soler captured a key Spanish artillery point . At this point , the Spanish set up a defensive square around the Chacabuco Ranch . O ’ Higgins charged the center of the Spanish position , and Soler got into place behind the Spanish forces , effectively cutting off any chance of retreat . O ’ Higgins and his men overwhelmed the Spanish troops and they attempted to retreat but Soler ' s men cut off their retreat and pushed towards the ranch . Hand to hand combat ensued in and around the ranch until every Spanish soldier was dead or taken captive . 500 Spanish soldiers were killed and 600 taken captive . The Patriot forces only lost twelve men in battle , but an additional 120 lost their lives from wounds suffered during the battle .