Smith served as a colonel of volunteers in the Seminole Wars from 1836 to 1838, before taking part in the Mexican–American War. He commanded the 2nd Brigade in Worth's Division at the Battle of Monterrey. He was brevetted brigadier general in September 1846 and joined Winfield Scott's army as commander of the 1st Brigade, 2nd Division. He led his brigade at the battles of Veracruz, Cerro Gordo and Contreras. He was brevetted major general for actions at Contreras and fought in the battles for Mexico City. He served on the armistice commission and then as military governor of Mexico City. He was an Original Member of the Aztec Club of 1847.