The Mexican-American War was a conflict between the United States and Mexico, fought from April 1846 to February 1848. ... 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).