Between 1821 and 1880, the Santa Fe Trail was primarily a commercial highway connecting Missouri and Santa Fe, New Mexico. From 1821 until 1846, it was an international commercial highway used by Mexican and American traders. In 1846, the Mexican-American War began. The Army of the West followed the Santa Fe Trail to invade New Mexico. When the Treaty of Guadalupe Hidalgo ended the war in 1848, the Santa Fe Trail became a national road connecting the United States to the new southwest territories. Commercial freighting along the trail continued, including considerable military freight hauling to supply the southwestern forts. The trail was also used by stagecoach lines, thousands of gold seekers heading to the California and Colorado gold fields, adventurers, fur trappers, and emigrants. In 1880 the railroad reached Santa Fe and the trail faded into history.