On 2 February 1848, the Treaty of Guadalupe Hidalgo ended the Mexican-American War and granted to the United States a huge swath of Mexican territory.