Battle of Maipú The Battle of Maipú ( Spanish : " Batalla de Maipú " ) was a battle fought near Santiago , Chile on April 5 , 1818 between South American rebels and Spanish royalists , during the Chilean War of Independence . The Patriot rebels led by José de San Martín effectively destroyed the Spanish forces commanded by General Mariano Osorio , and completed the independence of the core area of Chile from Spanish domination . Background . In 1817 , the Argentine General José de San Martín led an army across the Andes and defeated the Spanish at the battles of Chacabuco and Chalchuapa and captured Santiago . The Spanish viceroyalty sent a Spanish army to Santiago under General Mariano Osorio , which defeated San Martín at the Second Battle of Cancha Rayada . The drive for independence never diminished , however , and the following year San Martín launched a final offensive , which was to decide the outcome of the war . Despite being defeated at Cancha Rayada , the Patriot army regrouped again in less than two days , adding up to about 4 , 000 men , allowing San Martín to rebuild his units almost entirely . Hence , on April 2 , after leaving the Ochagavía camp to travel to the lower hills of Maipo , the Patriot army emerged organized in three infantry divisions with a total of 396 chiefs and approximately 5 , 000 lower - ranked officers and soldiers . The Royalist army meanwhile continued in its attempt to consolidate and defeat the Patriots , and after Cancha Rayada begun a persistent and extenuating persecution , which was resisted in every town and countryside , delaying its advance towards Santiago and giving the Patriots some time to reorganize and to plan the way to stop Osorio and to avoid his entrance into the capital city . Foreseeing this situation , General Bernardo O ’ Higgins employed some important measures which would serve the ultimate goal of defeating the Spanish , such as collecting the rifles and sabres given by Manuel Rodríguez to people after Cancha Rayada ; speeding up the incoming supplies from Los Andes ; acquiring or confiscating weapons held by individuals and merchants of Santiago to rearm the troops ; gathering up combatants from the population coming up from the south and organizing a training camp at Ochagavía . Meanwhile , Gen . Osorio , after passing through San Fernando by the end of March , realized that he had not defeated the Patriot army conclusively at Cancha Rayada , and moreover , that the latter was fit to fight and to win . Facing this fact , another encounter between the Patriots and Royalist army near Santiago became inevitable . Battle preparations . Both armies established their headquarters near each other in the south of Santiago , where San Martín and Osorio prepared for battle . At nightfall on April 4 , the Royalist army settled at Lo Espejo , about seven kilometres from the Patriot forces . At dawn the next day , San Martín occupied the lower hills over the southern edge which runs from west to east , with Las Heras ’ division to the right , Alvarado ' s division on the left and Quintana ' s division right behind them . The grenadiers were set on the extreme right and the Cazadores of the Dictatorial Army were arranged on the left flank . The artillery was divided into two brigades under Blanco Encalada and Borgoño , and protected by the infantry on the wings . Osorio arranged his army on a triangular ridge at north of Lo Espejo . Primo de Rivera ' s division was formed on the left wing , while the Dragones de la Frontera Regiment was deployed over the road to Valparaíso . Morla ' s Division was set on the western half of the triangular plateau , and the right flank was formed by the Ordoñez Division . The battle . The battle began when the Patriot artillery opened fire about 11 : 30 AM , being immediately contested by its Royalist counterpart , although inflicting no casualties upon each other whatsoever . After a half hour of useless shelling , San Martín ordered Las Heras and Alvarado to move forward . The infantry advanced in columns without retaliating fire , until Las Heras threw his troops against Primo de Rivera with the support of Blanco Encalada ' s artillery , while Alvarado did the same against Ordoñez being covered by Borgoño ' s batteries . The grenadiers under Zapiola were assailed by part of the Royalist cavalry , but managed to counterattack and chase the attackers to a little slope where were decimated by a dense infantry and artillery fire . Obliged to retreat , Zapiola was reinforced and attacked again , successfully dispersing the enemy ' s cavalry and securing the Patriot right flank . During the fray , suddenly the Patriot reserve emerged from behind Las Heras and Alvarado ' s lines and engaged Morla and Ordoñez divisions . Right after , the Cazadores squadrons led by Col . Ramón Freire dispersed the Spanish cavalry on the eastern flank . On this charge died Chilean Colonel Santiago Bueras . On the centre , both infantries attacked each other with intensity . Ordoñez division , reinforced with another two units – the Burgos and Arequipa battalions - charged the Patriot line , forcing it to cede a little . However , San Martín sent three battalions to the sector – The 1st and 3rd infantry battalions plus the 7th Battalion of Los Andes - , and these onsetted and split the Burgos Battalion , while the Arequipa Battalion is completely disbanded . The rest of the Royalist units formed in squares endured up to ten cavalry melees , but retreated after the centre and right wing withdrew to Lo Espejo . At this point Osorio deserted the field , leaving the Royalists under the command of Ordoñez . The latter gathered six companies of Primo de Rivera ' s division and the rest of the Royalist infantry and made a final stand on the farm , decimating the Coquimbo Battalion which recklessly made a frontal charge . Then , San Martín ordered Blanco Encalada and Borgoño to hammer the position with their cannons . Pushed by the Patriot infantry , Ordoñez ’ men garrisoned on the houses of Lo Espejo were forced to surrender , while the militias brought by O ’ Higgins captured the dispersed soldiers . Results . The battle left 2 , 000 Spaniards dead and 3 , 000 captured ; the patriots lost about 1 , 000 men . The victory produced tremendous results . The victory bought an end to major Spanish operations in Chile . It also allowed the united Chilean and Argentine patriots to launch a series of attacks against Spanish positions along South Americas Pacific coast climaxing with the liberation of large parts of Peru from Spanish rule . Order of battle . Patriots Commander : General José de San Martín Total : 5 , 000 men with 21 guns Royalists Commander : General Mariano Osorio Total : 5 , 000 men with 12 guns