In 1846, President Polk declared war on Mexico and sent troops to New Mexico and California under General Kearny. This began the military era in New Mexico, which lasted for about 50 years. At this time, Mexican troops were garrisoned in Mesilla. By 1848 the war had ended and most of the state had been ceded to the United States by the Treaty of Guadalupe Hidalgo.
According to the treaty, the boundary between the United States and Mexico was to extend from the Gulf of Mexico and follow the Rio Grande to a point eight miles north of El Paso and then continue west to the first branch of the Gila River. The boundary was established from a map drawn by J. Disturnell of New York. When the United States sent men to survey the boundary, they found that the Disturnell map was in error. El Paso was actually located 40 miles north of its position on the map and the Rio Grande was actually 130 miles to the west. A settlement was made between the two countries known as the Gadsden Purchase, but diplomatic tension followed. In 1853, the United States negotiated with Mexico to resolve the boundary dispute which resulted at the termination of the Mexican War and to purchase the land in question. This was known as the Gadsden Purchase. The treaty was consummated by the raising of the United States flag in the Mesilla Plaza by Fort Fillmore troops. With the protection afforded by the forts in the Southwest, north-south and east-west traffic along the trails increased and Mesilla found itself in an optimum location for economic growth. It became an important stop on two stagecoach, mail and trade routes-- the El Camino Real, which reached from Chihuahua to Santa Fe and the Butterfield stage route, which extended from San Antonio to San Diego. The Butterfield Stage Stop was located east of the Mesilla Plaza, between Calle de Guadalupe and Calle de Principal.