Capture of Oaxaca ( 1812 ) The Capture of Oaxaca was a battle during the War of Mexican Independence that occurred on 25 November 1812 at Oaxaca de Juárez , Oaxaca . It was fought between the royalist forces loyal to the Spanish crown , commanded by General Antonio Pío González - Saravia Mollinedo , and the Mexican rebels fighting for independence from the Spanish Empire , commanded by José María Morelos y Pavón . The battle resulted in a victory for the Mexican rebels . Context . While José María Morelos was in Tehuacán , Puebla , he discovered that loyalist Spanish troops were en route to attack him . He decided to regroup his forces and abandon Tehuacán . The organization of the rebel army under Morelos was under the following of his generals ; Hermenegildo Galeana , , Nicolás Bravo , , Mariano Matamoros y Guridi , and his colonels ; Vicente Ramón Guerrero Saldaña ( future president of Mexico ) , and José Miguel Ramón Adaucto Fernández y Félix . All of his forces were able to join together creating an army of over 5 , 000 soldiers and 40 pieces of artillery . This army proceeded to march to Oaxaca on 10 November 1812 . Before departing for Oaxaca , Morelos named the substitute for who had fallen prisoner to royalist troops . He decided to promote Mariano Matamoros to Bravo ' s former position , naming him marshal of the army and Morelos ' direct second in command , having to take control of insurgent forces in the event of Morelos ' capture or killing . After his arrival at Villa de Etla , Oaxaca , Morelos developed a plan to attack the state capital at Oaxaca de Juarez . He sent an ultimatum to the Spanish defender of the city , General González Saravia asking for his immediate surrender . The message went unanswered and Morelos decided to take the city by force . The Battle . On 25 November 1812 , the insurgent forces took position and began their assault . Colonel Manuel Montaño marched up the surrounding mountainside to the Cerro de la Soledad to cut the town ' s water supply and to impede any retreat in that direction by way of Santo Domingo Tehuantepec . General Hermenegildo Galeana took command of the vanguard ; took command of the center column ; Mariano Matamoros y Guridi commanded the rearguard . For his part , Morelos himself commanded a section of cavalry . A good portion of the infantry remained in reserve to be used if necessary later in the battle . The fort at Cerro de la Soledad , which was at that time in Spanish loyalist control , was able to check the main advance for some time with its artillery cover barrages . Morelos , thinking that his position was unfavorable for attack , sent the colonels Ramón Sesma and Manuel de Mier y Terán to take the fort on the mountain . They attempted to move a cannon close to the fort to assist in their attack but soon discovered that they were under heavy fire from two sides and abandoned the gun . Morelos thereafter decided to simply reinforce the main advance by Mier and Terán until their objective was at last completed . Once that position had been taken by the insurgents , the main attack on Oaxaca began supported by an eight - pound cannon . The royalist troops initially returned fire but as the battle progressed , they were unable to sustain the firepower until the town ' s defender ordered a retreat . The last skirmish , referred to as the " Juego de Pelota " ( literally : ball game ) , was the taking of a fortified position that was surrounded by a moat and trenches . Insurgent forces were initially hesitant to advance on the well fortified position until Guadalupe Victoria hurled his sword across the pit exclaiming - " ¡ va mi espada en prenda , voy por ella ! " ( " There goes my sword , I will go and get it ! " ) . Swimming across the moat , he incited his comrades to follow him , eventually taking the position successfully . The loss of Oaxaca was a significant strategic victory for the rebel insurgents and a severe setback for the Viceroyalty of New Spain . For the insurgents , it signified the military prestige and prowess of Morelos as an effective battle commander and gave the insurgents a viable geographic position from which to control the surrounding area .