The Mexican–American War, also known as the Mexican War, the U.S.–Mexican War, the U.S.–Mexico War or the Invasion of Mexico, was an armed conflict between the United States of America and the United Mexican States from 1846 to 1848. It followed in the wake of the 1845 U.S. annexation of Texas, which Mexico considered part of its territory in spite of its de facto secession in the 1836 Texas Revolution.

In 1845, James Polk, the newly-elected U.S. president, made a proposition to the Mexican government to purchase the disputed lands between the Nueces River and the Rio Grande. When that offer was rejected, American forces commanded by Major General Zachary Taylor were moved into the disputed territory. They were then attacked by Mexican forces, who killed 12 U.S. soldiers and took 52 as prisoners. These same Mexican troops later laid siege to an American fort along the Rio Grande. This led to the war and the eventual loss of much of Mexico's northern territory.

The 1848 Treaty of Guadalupe Hidalgo ended the war and specified its major consequence: the Mexican Cession of the territories of Alta, California and Santa Fe, New Mexico to the United States. Mexico acknowledged the loss of Texas and thereafter cited the Rio Grande as its national border with the United States. The U.S. agreed to pay $15 million compensation for the physical damage of the war. In addition, the United States assumed $3.25 million of debt owed by the Mexican government to U.S. citizens.

More Info: en.m.wikipedia.org