September, 1847 - June, 1848
Mexico City was the first foreign capital to be occupied by U.S. armed forces. On September 14, 1847, General Scott's army entered Mexico City, where it was greeted with violent public demonstrations. For three days angry mobs resisted the U.S. occupation, prompting Scott to declare martial law.
While some Mexicans collaborated with U.S. forces, sporadic, unpremeditated violence, as well as more generalized and organized forms of anti-American resistance, continued long after the surrender of the Mexican army. The letters and diaries of U.S. troops stationed in the capital record frequent attacks on solitary or small groups of U.S. soldiers, as well as armed U.S patrols.
The occupation dragged on for the next nine months. Although the Treaty of Guadalupe Hidalgo was signed in a suburb of the city on February 2, 1848, the document signed by U.S. and Mexican peace commissioners would not be formally accepted by both governments until May. The occupation ended on June 12, 1848 when the last U.S. troops marched out of the capital.