America and Mexico were in dispute over the U.S. annexation of Texas and its threats to other 'Mexican' territory. Mexico suffered a series of defeats. The war ended with the Treaty of Guadalupe-Hidalgo signed on the 2 February 1848. America gained Texas, New Mexico, Arizona, Utah, and California.