In 1819, Spanish Governor Facundo Melgares ordered the construction of a military fort near Sangre de Cristo Pass to block a possible invasion of Santa Fe de Nuevo México from the United States. The Sangre de Cristo Mountains and Sangre de Cristo Pass divide the Rio Grande basin from the Arkansas River basin, a part of the greater Mississippi River basin. The fort was occupied by a detachment of approximately one hundred soldiers who patrolled the area in search of Ute Indians and foreigners. The fort was abandoned in 1821 after the Adams-Onís Treaty took effect redefining the border between Louisiana and New Mexico. The new border was defined as the 100th meridian west from the Red River (the border between Spanish province of Tejas and the U.S. Territory of Arkansaw) north to the Arkansas River, then west along the river to its headwaters (at the Continental Divide of the Americas), thence directly north to the 42nd parallel north, then west along the parallel to the Pacific Ocean. On August 24, 1821, Ferdinand VII of Spain finally recognized the independence of Mexico with the signing of the Treaty of Córdoba. Governor Melgares and other Spanish officials in New Mexico declared their allegiance to the new Mexican government. On January 12, 1828, the United States and Mexico signed the Treaty of Limits affirming the boundaries set by the Adams-Onís Treaty. The region would remain at peace until May 13, 1846, when the United States declared war on Mexico.