In the Mexican-American War, Hardee served in the Army of Occupation under Zachary Taylor and won two brevet promotions (to brevet major for Medelin and Vera Cruz, and to lieutenant colonel for St. Augustin).
After his wife died in 1853, he returned to West Point as a tactics instructor and served as commandant of cadets from 1856 to 1860.