On May 13, 1846, the United States Congress declared war on Mexico, starting the Mexican–American War. The conflict followed disputes over Texas, which the United States had annexed, and disagreements about the border. President James K. Polk argued that Mexican troops had attacked American forces north of the Rio Grande. Critics questioned this claim and worried about the expansion of slavery into new territories. The war ended with the Treaty of Guadalupe Hidalgo, which transferred large areas of land, including present-day California and much of the Southwest, to the United States. The conflict reshaped the map of North America and intensified debates over slavery and expansion.