Treaty of Guadalupe Hidalgo
With the 1848 defeat of Mexico, California and other Mexican territories were ceded to United States rule (the Mexican Cession) under the terms of the Treaty of Guadalupe Hidalgo, which ended the war.