In 1821, Mexico, after an 11 year fight, won its independence from Spain and granted Stephen Austin the right to colonize Texas. Mexico was a cultural mix of the Native Americans and Spanish conquerors after the 300 year occupation. While the freedom was welcomed, difficulties in organizing the new government resulted in 25 years of searching for the correct solution. Between 1821 and 1847, four types of government were tried: a monarchy in 1822, a federal republic in 1824, and two forms of a centralized republic, one of which was in 1836 and the other in 1843.
In 1835, Texas declared independence from Mexico and Santa Anna led his army in to crush the rebellion.
1836 brought the battle at The Alamo. Santa Anna was captured by Sam Houston and released. In 1841, Santa Anna became President of Mexico.
In 1844, Morse tapped out the first message over the telegraph between Washington and Baltimore:"What hath God wrought". Coast to coast communications were finally a reality.
In 1845, James Knox Polk, who supported expanding our territory to accommodate the growing population and to build the transcontinental railroad, was elected as our 11th President. The United States had grown from a population of 5 million in 1800 to one of 23 million in those years due to immigration. Western sea ports along the California coast as well as the mineral wealth it promised made it a desirable addition. Dreams of transportation from the Atlantic to the Pacific made a continuous corridor of land between the coasts desirable and plans to gain it were being plotted. In the meantime, the British claimed the Pacific Northwest and had developed uncomfortably close ties to Mexico. The situation was ripe for war.
The sparsely populated areas of Arizona, New Mexico, Utah and Nevada were populated with Native Americans and Mexicans. Rugged terrain and desert environments really didn't appeal to people until the invention of air conditioning in the mid 1950's but the access between California and the East Coast for railroads made acquiring it attractive. One of the original ideas for a transcontinental connection was south of our present borders.
"This was an extraordinarily remote area of the Mexican Republic. In those days, the population centers were actually the reverse of the way they are today. In 1821, when Mexico became independent of Spain, California was sparsely populated with something like 3,200 Mexicans. New Mexico, on the other hand, had a population of about 40,000 and was the dynamo of the northern frontier. Texas was also sparsely populated with about 2,500 Mexicans. The folks who lived in this frontier zone essentially lived in islands -- enclaves unconnected to one another. There were no horizontal lines of communication across the Southwest. People who lived in San Antonio were more apt to think of Saltillo, Monterrey, and Mexico City than they were Santa Fe. People who lived in Santa Fe were unlikely to communicate with people living in San Francisco. The gulf between them was enormous."
The presence of a large number of graduates from the United States Military Academy worked in favor of the U.S. Army. These officers, mostly lieutenants and captains, formed a tight knit corps whose leadership ability and training helped offset the initial shortage of manpower. Historians point out that their ranks included men such as George G. Meade, Ulysses S. Grant, George B. McClellan, P.G.T. Beauregard, Braxton Bragg, Joseph E. Johnston, and Robert E. Lee, officers who later went on to command the great armies of the Civil War.
Two battles at Monterray and Palo Alto were won by the US Army in California leaving only Los Angeles to conquer.
On May 13, 1846, Congress authorized President Polk to raise 50,000 12-month volunteers.
Polk appointed a man named John Sidwell as the emissary whose mission was to purchase the necessary land for $10 million dollars. He was systematically ignored by the Mexican government.
1847 saw the defeat of Mexican troops in Los Angeles and the surrender of California to the US. General Winfield Scott led troops to Veracruz and eventually captured Mexico City. The war ended with the Treaty of Guadalupe-Hidalgo which lead to the Gadsden Purchase.