Treaty of Guadalupe Hidalgo
The war ended on February 2, 1848, with the signing of the Treaty of Guadalupe Hidalgo. Mexico ceded claims to Texas, and the border was set at the Rio Grande.