On October 8, 1847, Lane sent out spies who learned that Santa Anna's force was waiting in Huamantla, 25 miles from Puebla. The next day, October 9, Lane's vanguard of Texas Rangers under Captain Samuel Walker reached the town and sighted roughly 2,000 Mexican lancers. At the head of his Rangers, Walker charged into the city to drive out the Mexicans, but Santa Anna led a counter attack and stopped the Rangers. Walker was mortally wounded and, for about an hour, the Rangers desperately fought to hold their position in the town, some of them seeking refuge in a church. The rest of Lane's infantry arrived, attacked and drove out Santa Anna's force. When Lane heard of Walker's death he turned his troops loose, who pillaged and burned Huamantla, the only instance in the war in which a sizeable U.S. force had sacked a city.
The battle was Santa Anna's last. The new Mexican government led by Manuel de la Peña y Peña first tried its power when it asked Santa Anna to turn over command of the army to General José Joaquín de Herrera. Three days after the battle, General Lane fought his way into Puebla and raised the siege. Lane continued raids against Mexican guerrillas to keep the supply route between the port of Veracruz and Mexico City clear.