From 1846 to 1848, the United States of America and Mexico fought the Mexican-American War. There were many causes of the war, but the biggest reasons were Mexico's lingering resentment over the loss of Texas and the Americans' desire for Mexico's western lands, such as California and New Mexico.
It stemmed from the annexation of the Republic of Texas by the U.S. in 1845 and from a dispute over whether Texas ended at the Nueces River (the Mexican claim) or the Rio Grande (the U.S. claim).