During the Mexican-American War from 1846 to 1848, the United States defeated Mexico and gained control over vast territories including California, Arizona, New Mexico, Nevada, Utah, Colorado, Wyoming, Kansas, Oklahoma, and parts of Montana, Nebraska, South Dakota, Texas, and Oregon.