During the Mexican–American War (1846–1848), Twiggs led a brigade in the Army of Occupation at the battles of Palo Alto and Resaca de la Palma. He was promoted to brigadier general in 1846 and commanded a division at the Battle of Monterrey. He joined Winfield Scott's expedition, commanding its 2nd Division of Regulars. He led the division in all the battles from Veracruz through Mexico City. He was wounded during the assault on Chapultepec. After the fall of Mexico City, he was appointed military governor of Veracruz. Brigadier General Twiggs was awarded a ceremonial sword by the Congress on March 2, 1849. He was an original member of the Aztec Club of 1847, a military society of officers who had served in the Mexican War.