Battle for Mexico City The Battle for Mexico City refers to the series of engagements from September 8 to September 15 , 1847 , in the general vicinity of Mexico City during the Mexican - American War . Included are major actions at the battles of Molino del Rey and Chapultepec , culminating with the fall of Mexico City . The U . S . Army under Winfield Scott scored a major success that ended the war . Background . The major objective of American operations in central Mexico had been the capture of Mexico City . After capturing the port of Veracruz in March , General Winfield Scott was able to secure a base and move inland and defeat a large Mexican force at the Battle of Cerro Gordo . After routing the Mexicans at the Battle of Churubusco , Scott ' s army was only five miles ( 8 km ) away from its objective of Mexico City . Although defeated at Cerro Gordo and Churubusco , General Santa Anna ' s army remained intact and totally outnumbered Scott . Order of battle . United States . US Army - Major General Winfield Scott Mexico . 7 August 1847 — 20 , 210 men and 104 artillery pieces acs Mexican Army General Antonio López de Santa Anna Chief of Artillery : General Martin Carrera Chief of Engineers : General Ignacio Mora y Villamil Alcaraz , Ramon " Apuntes para la historia de la guerra entre Mexico . . . † Battles . Molino del Rey . On September 8 , the fight for Mexico City began . Scott believed that a cannon foundry was located at the Molino del Rey , the " King ' s Mill " , located just over 2 miles ( 3 km ) outside the city . Scott sent the 1st Division under William J . Worth to seize and destroy the foundry . Worth wished to include Chapultepec Castle in his attack , and when Scott refused , a bitter rivalry began between Scott and Worth . In the ensuing battle , both sides suffered heavy casualties , and Worth drove the Mexicans from the mill , separating them from the forces at Chapultepec . The battle produced no significant military gains for the U . S . Chapultepec . The main assault on the city came a few days later on September 12 . Mexico City was guarded in part by Chapultepec Castle , which was being used as a military academy . Scott preceded infantry assault with an all day artillery barrage on September 12 . The next day , September 13 , the 4th Division , under John A . Quitman , spearheaded the attack against Chapultepec and carried the castle . Future Confederate generals George E . Pickett and James Longstreet participated in the attack . Serving in the Mexican defense were the cadets later immortalized as " Los Niños Héroes " ( the " Boy Heroes " ) . The Mexican forces fell back from Chapultepec and retreated within the city . Attacks on the Belén and San Cosme Gates . Quitman ' s Division made its way down the Belén Causeway towards the Belén Gate , defended by General Terres & Colonel Garay with the 2d Mexico Activos ( 200 men ) and 3 guns ( 1 - 12 lbs . & 2 - 8 lbs . ) , while Worth ' s Division further to the north made its way up La Verónica Causeway towards the San Cosme Gate , defended by General Rangel ' s Infantry Brigade ( Granaderos Battalion ( Adj . A . Manero ) , 1st Light ( Comdte . L . Marquez ) , part 3d Light ( Lt . Col . M . M . Echeagaray ) and parts of Matamoros , Morelia and Santa Ana Battalions ( Col . J . V . Gonzalez ) with 3 guns ( 1 - 12 lb , 1 - 8 lb . and 1 howitzer 24 lb ] s . Quitman was merely supposed to make a feint towards the city , but he pushed forward his whole division and broke through the defenses . Santa Anna arrived at the Belén Gate in a fury and relieved the front commander . Worth ' s Division in the meantime had a slow start against the Mexicans after beating off a Mexican cavalry attack . When he reached San Cosme , he found its defenses ill prepared , but the Mexicans defending it put up a good fight before falling back . Ulysses S . Grant found his way into the action along the causeway on Worth ' s front and helped in hoisting a cannon into the belltower of a nearby church . From this spot Grant fired into the defenders below . When the fighting subsided on all fronts , both gates had fallen and the Mexicans had withdrawn into the city . Other gates defended were : San Antonio by General M . Martínez ( 3d & 4th Ligero & 11th Line with 10 guns ) before withdrawing ; Nino Perdido by the National Guards and 2 guns ; and San Lázaro , Guadalupe and Villejo , which were defended by small infantry detachments . Other forces were stationed at la Piedad ( 1st & 2d Mexico Activos and Guanajunto Battalions ) , the Insurgente bridge ( Gen . Arguelles : Invalidos and Lagos Battalion ) and in the rear of these ( Gen . Ramirez with 2d Ligero and various pickets ) before withdrawing to the Citadel . Fall of Mexico City . The Junta ( Gens . Alcorta , Carrera , Lombardini & Fran . Pérez ) had withdrawn their army : 14 Guns , 4 , 000 Cavalry ( Quijano & Andrade Brigades ) , and 5 , 000 Infantry ( Four Sections : - 1 . ) Gov . Olaguibel : Toluca National Guards , - 2 . ) Cmdte . Arroyo : Lagos , Iturbide , & Tula Battalions , - 3 . ) Gen . Martínez : various pickets , and - 4 . ) Gen . Pérez : 11th Infantry & remnants of Light Regts . ) from the city during the night , and the U . S . forces , expecting another assault , found the city undefended . Worth and Quitman advanced cautiously . Quitman sent Lieutenant Pierre Beauregard to arrange the surrender of the ciudadela . Beauregard and Mansfield Lovell were met by a Mexican officer who asked for a receipt for the captured ciudadela . ( 15 Guns ) Beauregard exclaimed that " we give receipts at the point of their swords " . Scott gave the honor of formally entering the city to Quitman ' s Division . The conquering army was less than impressing , the troops wore ragged and bloodstained uniforms and Quitman only had on one shoe when he marched into the city . Worth personally took down the flag flying over the National Palace , and a U . S . Marine hoisted the U . S . flag in its place . Quitman marched into the Zócalo plaza in the center of the city in front of the National Palace where the formal surrender took place . As Worth ' s division entered the city the leading unit was John Garland ' s brigade . Stragglers from the Mexican army left in the city after Santa Anna ' s withdrawal climbed to the roofs of houses and began shooting at the American soldiers . General Garland was hit in the chest with the first shot and fell severely wounded . Before he evacuated , Santa Anna released 30 , 000 prisoners into the streets of the city , and these rooftop shots provoked the prisoners into similar acts . Worth did manage to get the sniping under control . William S . Harney ' s dragoons escorted General Scott into the city wearing his immaculate dress uniform and was greeted by patriotic music . Scott appointed the politically savvy Quitman as military governor , becoming the only American to ever rule from the National Palace . Notes . Lieutenant Colonel James S . McIntosh temporarily commanded Clarke ' s brigade at Molino del Rey ; Clarke returned to command after McIntosh was killed during the fighting .