as an artillery battalion commander he distinguished himself in the mexican–american war, serving under both zachary taylor and winfield scott, at palo alto, resaca de la palma, monterrey, and churubusco. he received brevet promotions from major through colonel for his service in these battles and ended the war as a lieutenant colonel in the regular army. in mexico city, he was in charge of the police guard from the end of the war until 1848. during this time he became an original member of the aztec club of 1847.