He was adjutant-general of New York state in 1839-1843, and became a brigadier-general of volunteers in the Union army in 1861, commanded a division in Virginia in 1862-1863, and, being compelled by ill health to resign from the army, was U.S. minister to the Papal States in 1863-1867.