information:classification, stylistic:style_transfer, information:filtering, linguistic:translation
The Mexican–American War, also known in the United States as the Mexican War, and in Mexico as the United States intervention in Mexico, was an invasion of Mexico by the United States Army from 1846 to 1848. It followed the 1845 American annexation of Texas, which Mexico still considered its territory because it refused to recognize the Treaties of Velasco, signed by President Antonio López de Santa Anna after he was captured by the Texian Army during the 1836 Texas Revolution. The Republic of Texas was de facto an independent country, but most of its Anglo-American citizens who had moved from the United States to Texas after 1822 wanted to be annexed by the United States.

In the United States, sectional politics over slavery had previously prevented annexation because Texas, formerly a slavery-free territory under Mexican rule, would have been admitted as a slave state, upsetting the balance of power between Northern free states and Southern slave states. In the 1844 United States presidential election, Democrat James K. Polk was elected on a platform of expanding U.S. territory to Oregon, California (also a Mexican territory), and Texas by any means, with the 1845 annexation of Texas furthering that goal. However, the boundary between Texas and Mexico was disputed, with the Republic of Texas and the U.S. asserting it to be the Rio Grande and Mexico claiming it to be the more-northern Nueces River. Polk sent a diplomatic mission to Mexico in an attempt to buy the disputed territory, together with California and everything in between for $25 million (equivalent to $ 778 million in 2023), an offer the Mexican government refused. Polk then sent a group of 80 soldiers across the disputed territory to the Rio Grande, ignoring Mexican demands to withdraw. Mexican forces interpreted this as an attack and repelled the U.S. forces on April 25, 1846, a move which Polk used to convince the Congress of the United States to declare war.

Beyond the disputed area of Texas, U.S. forces quickly occupied the regional capital of Santa Fe de Nuevo México along the upper Rio Grande. U.S. forces also moved against the province of Alta California and then turned south. The Pacific Squadron of the U.S. Navy blockaded the Pacific coast in the lower Baja California Territory. The U.S. Army, under Major General Winfield Scott, invaded the Mexican heartland and captured the capital, Mexico City, in September 1847.

Although Mexico was defeated on the battlefield, negotiating peace was a politically fraught issue. Some Mexican factions refused to consider any recognition of its loss of territory. Although Polk formally relieved his peace envoy, Nicholas Trist, of his post as negotiator, Trist ignored the order and successfully concluded the 1848 Treaty of Guadalupe Hidalgo. It ended the war, and Mexico recognized the cession of present-day Texas, California, Nevada, and Utah as well as parts of present-day Arizona, Colorado, New Mexico, and Wyoming. The U.S. agreed to pay $15 million for the physical damage of the war and assumed $3.25 million of debt already owed by the Mexican government to U.S. citizens. Mexico relinquished its claims on Texas and accepted the Rio Grande as its northern border with the United States.

The victory and territorial expansion Polk envisioned inspired patriotism among some sections of the United States, but the war and treaty drew fierce criticism for the casualties, monetary cost, and heavy-handedness. The question of how to treat the new acquisitions intensified the debate over slavery in the United States. Although the Wilmot Proviso that explicitly forbade the extension of slavery into conquered Mexican territory was not adopted by Congress, debates about it heightened sectional tensions. Some scholars see the Mexican–American War as leading to the American Civil War. Many officers who had trained at West Point gained experience in the war in Mexico and later played prominent leadership roles during the Civil War.

In Mexico, the war worsened domestic political turmoil. Since the war was fought on home ground, Mexico suffered large losses of life from both the military and civilian population. The nation's financial foundations were undermined, and more than half of its territory was lost. Mexico felt a loss of national prestige, leaving it in what a group of Mexican writers, including Ramón Alcaraz and José María del Castillo Velasco, called a "state of degradation and ruin... the true origin of the war, it is sufficient to say that the insatiable ambition of the United States, favored by our weakness, caused it."