Tensions rose between the United States and Mexico in the 1840s following the annexation of Texas by the US. The US claimed the border of Texas was the Rio Grande river, while Mexico claimed it was the Nueces river further north. In 1846, Mexican forces attacked US troops along the Rio Grande, which President Polk used to convince Congress to declare war, seeking to expand US territory. Under the leadership of generals Zachary Taylor and Winfield Scott, US forces defeated Mexican armies and captured key cities like Mexico City. The Mexican War ended in 1848 with the US gaining control of Texas, New Mexico, Arizona, California, Utah, and parts of Colorado and Wyoming.