Established in 1821 as a trade route between Franklin, Missouri, in the United States and Santa Fe, then part of Mexico, the Santa Fe Trail stretched 900 grueling miles and took up to two and one half months to travel. Pioneered by William Becknell in 1821, it preceded the great emigrant trails to the north by 20 years and, unlike those more northern trails, served as an international route of commerce with traffic moving in both directions. After Santa Fe effectively became part of the United States at the end of the Mexican-American War in 1848, trade barriers were removed and traffic increased, but the trail's role ended with the arrival of the railroad in 1880. Along the route, traders celebrated or loaded goods at Santa Fe Plaza, early travelers encountered the settlement at San Miguel del Vado Church, where a customs station collected tariffs from wagon trains headed to Santa Fe, and Kearny Gap marked the pass where William Becknell arrived in 1821 and the trail opened.