The Mexican-American war began in 1846 over a border dispute between the United States and Mexico. When the U.S. annexed Texas in 1845, a common border had not yet been agreed upon. This resulted in both countries considering the land between the Nueces and Rio Grande rivers as their own territory.
Meanwhile, President Polk had not been successful in his negociations with Mexico to aquire California, so he began looking for a way to start a war without being seen as the aggressor. In 1846 he sent a unit of American soliders into the disputed territory, which Mexico interpreted a an invasion, and the bloodshed that followed resulted in a declaration of war by congress. Mr. Polk had gotten his war.
The Americans immediately sent Gen. Stephan Kearny, along with naval units under the command of Sloat and Stockton, to capture California. Although sparatic resistance was met in southern california, the U.S. easily captured California, New Mexico and Arizona, and would hold them for the rest of the war.
At the same time, the real fighting was occurring down south. Gen. Zachary Taylor made a diversionary attack on Monterrey, and when Santa Ana arrived with 20,000 men, a protracted battle began. Fearing his army would be destroyed, Santa Ana retreated, and Taylor gave chase.
In Vera Cruz, Gen. Winfield Scott arrived with another force, and this one marched on Mexico City itself, capturing the capital in 1848. The Mexican government soon sued for peace.
The Treaty of Guadalupe Hidalgo ended the war and gave the Americans the territory they had captured. The U.S. in return provided Mexico with $15 million for the territory.