March 9 to September 14, 1847, he conducts the campaign by which the City of Mexico, is captured.
September 14, 1847, to February 18, 1848, he remains in charge of the military government in Mexico. By his enforcement of martial law that respects the persons and property of the Mexican people he gains the leaders’ confidence. He is proposed for dictator of the Mexican Republic, with a view to annexation to the United States, but declines.
February 18, 1848, he receives orders from President Polk to turn over his command to Major-General William O. Butler, and report for trial by a court of inquiry, on charges that he had unjustly disciplined Generals Quitman and Pillow, and Lieutenant-Colonel Duncan. He is acquitted.
March 9, by joint resolution of Congress, he is voted the National thanks for himself and his officers and men, and the testimony of a specially struck gold medal in appreciation of his “valor, skill and judicious conduct.”
May 20, 1848, he arrives home to his family at Elizabeth, near Philadelphia.
Is assigned to command of the Eastern Department of the Army, with headquarters in New York.
In 1850, after the death of President Taylor, he resumes his post in Washington as commander-in-chief of the Army.
In 1850 he is awarded the honorary degree of LL.D. by Columbia College (University).
June, 1852, he is nominated by the Whig party for President. He is opposed by President Fillmore and Secretary of State Daniel Webster, who had been candidates. Is badly defeated in the election by Franklin Pierce of the Democratic party.