Excerpts from Books and Wikipedia
"It followed in the wake of the 1845 U.S. annexation of Texas, which was not formally recognized by the Mexican government . . . In 1845, newly elected U.S. President James K. Polk, who saw the annexation of Texas as the first step towards a further expansion of the United States, sent troops to the disputed area and a diplomatic mission to Mexico. After Mexican forces attacked U.S. forces, the United States Congress declared war. U.S. forces quickly occupied the regional capital of Santa Fe de Nuevo México along the upper Rio Grande and the Pacific coast province of Alta California, and then moved south. Meanwhile, the Pacific Squadron of the U.S. Navy blockaded the Pacific coast farther south in lower Baja California Territory. The U.S. Army under Major General Winfield Scott eventually captured Mexico City through stiff resistance, having marched west from the port of Veracruz on the Gulf Coast, where the U.S. staged its first ever major amphibious landing. The 1848 Treaty of Guadalupe Hidalgo, forced onto the remnant Mexican government, ended the war and enforced the Mexican Cession of the northern territories of Alta California and Santa Fe de Nuevo México . . ." [Wikipedia]