During the Mexican–American War, Beauregard served as an engineer under General Winfield Scott. He was appointed brevet captain for the battles of Contreras and Churubusco and major for Chapultepec, where he was wounded in the shoulder and thigh. He was noted for his eloquent performance in a meeting with Scott in which he convinced the assembled general officers to change their plan for attacking the fortress of Chapultepec. He was one of the first officers to enter Mexico City. Beauregard considered his contributions in dangerous reconnaissance missions and devising strategy for his superiors to be more significant than those of his engineer colleague, Captain Robert E. Lee, so he was disappointed when Lee and other officers received more brevets than he did.