The Mexican–American War, also known as the First American Intervention, the Mexican War, or the U.S.–Mexican War, was an armed conflict between the United States and Mexico from 1846 to 1848 in the wake of the 1845 U.S. annexation of Texas, which Mexico considered part of its territory despite the 1836 Texas Revolution.
The Mexican government had long warned the United States that annexation of Texas would mean war. Because the Mexican Congresshad refused to recognize Texan independence, Mexico saw Texas as a rebellious territory that would be retaken. Britain and France, which recognized the independence of Texas, repeatedly tried to dissuade Mexico from declaring war. When Texas joined the U.S. as a state in 1845, the Mexican government broke diplomatic relations with the U.S.
American forces invaded New Mexico, the California Republic, and parts of what is currently northern Mexico; meanwhile, the American Navy conducted a blockade, and took control of several garrisons on the Pacific coast of Alta California, but also further south in Baja California. Another American army captured Mexico City, and forced Mexico to agree to the cession of its northern territories to the U.S.
American territorial expansion to the Pacific coast was the goal of President James K. Polk, the leader of the Democratic Party. However, the war was highly controversial in the U.S., with the Whig Party and anti-slavery elements strongly opposed. Heavy American casualties and high monetary cost were also criticized. The major consequence of the war was the forced Mexican Cession of the territories of Alta California and New Mexico to the U.S. in exchange for $18 million. In addition, the United States forgave debt owed by the Mexican government to U.S. citizens. Mexico accepted the Rio Grande as its national border, and the loss of Texas. The political aftermath of the war raised the slavery issue in the U.S., leading to intense debates that pointed to civil war; the Compromise of 1850 provided a brief respite.