In 1846 the United States went to war with Mexico, and the defeated nation was forced to relinquish its northern territories by the Treaty of Guadalupe Hidalgo in 1848. This opened the Southern Rocky Mountains to American settlement, including what is now the lower portion of Colorado. The newly gained land was divided into the Territory of New Mexico and the Territory of Utah, both organized in 1850, and the Territory of Kansas and the Territory of Nebraska, organized in 1854. Most settlers avoided the rugged Rocky Mountains and headed for Oregon, the Deseret, or California, usually following the North Platte River and the Sweetwater River to South Pass in what is now Wyoming.