The origin of this conflict was rooted in a dispute over the southern border of Texas and ended with the Treaty of Guadalupe Hidalgo whereby the Republic of Mexico ceded over half of its territory to the United States including California, New Mexico and most of Arizona.