Sent as a lieutenant of engineers to the Mexican War, he took part in the battles under General Scott, and by his gallantry won the brevets of first-lieutenant at Contreras-Churubusco and captain at Chapultepec; he was afterwards detailed as assistant-instructor at West Point, and employed in explorations in the South-West and in Oregon.
He received the brevets of major for Cerro Gordo, lieut.- colonel for Contreras-Churubusco and colonel for Chapultepec. After the war he was employed in engineer work at Washington and Baltimore, during which time, as before the war, he resided on the great Arlington estate, near Washington, which had come to him through his wife.
He was, however, employed to the end of the war, and in 1867 received the brevets of brigadier-general U.S.A. and major-general U.S.A. for his services at Fredericksburg and Gettysburg respectively.
His services were recognized by the brevets of brigadiergeneral and major-general in the regular army.
Enlisting in a Michigan cavalry regiment in September 1861, he rose from captain to colonel, distinguished himself in the Gettysburg campaign and under Sheridan in the Shenandoah Valley, and in 1864 and 1865 respectively received the brevets of brigadier-general and major-general of volunteers.