The Mexican-American War (1846-48) was fought primarily to enable the United States to expand at the expense of Mexico. Texas became the focal point of hostilities between an expansionist United States and a recently independent Mexico. Increasingly dominated by white immigrants from the United States, Texas gained independence from Mexico in 1836. This short-lived Texas republic sought U.S. protection against Mexico and possible interference from the British or other European powers.
At the urging of President James K. Polk, Congress approved the annexation of Texas on March 1, 1845. Polk also sent representatives to Mexico to negotiate the purchase of what are today New Mexico and California, but the Mexicans refused and both sides sent troops to the Texas-Mexico border. U.S. forces, led by future President Zachary Taylor, provoked an incident with the Mexican Army, and Polk quickly obtained a declaration of war from Congress on May 13, 1846. In August 1847, after 15 months of fighting, the Mexican Government accepted a temporary armistice and began to negotiate a permanent peace settlement with Polk's personal representative, Chief Clerk of the Department of State Nicholas P. Trist. After the Mexican delegation rejected U.S. proposals for a settlement, the armistice was terminated on September 7. The war was won decisively by the United States, culminating with the capture of Mexico City about 1 week later.
Although ordered by Polk to return to Washington, Trist remained in Mexico and carried out unauthorized talks with Mexican representatives in late 1847. These meetings formed the basis for the final peace treaty, also negotiated by Trist. Although Polk refused to acknowledge or compensate Trist, he grudgingly accepted the agreement and submitted it to the Senate for ratification. The February 1848 Treaty of Guadalupe Hidalgo (named for a town outside Mexico City) signaled Mexico's surrender and finalized the purchase of New Mexico and California for $15 million.
This conflict had several long-term results: First, it largely completed the continental republic; other than the Gadsden Purchase in 1854, the borders of what would become the lower 48 states were set in 1848. Second, the war spawned a legacy of antagonism between the United States and Mexico that exists even today. Third, through the protests of Henry David Thoreau (of Walden Pond fame) and others, the conflict with Mexico sparked one of the early anti-war movements in the United States. It also helped revive contentious debates over the expansion of slavery into the American West.