In the Mexican–American War, Smith served under General Zachary Taylor at the Battle of Palo Alto and the Battle of Resaca de la Palma. He served under General Winfield Scott later, and received brevet promotions to first lieutenant for Cerro Gordo and to captain for Contreras and Churubusco. His older brother, Ephraim Kirby Smith (1807–1847), who graduated from West Point in 1826 and was a captain in the regular army, served with him in the 5th U.S. Infantry in the campaigns with both Taylor and Scott. Ephraim died in 1847 from wounds suffered at the Battle of Molino del Rey.