As a result of the U.S. annexation of Texas in 1845, hostilities between the two nations exploded. Although officials in Mexico wanted peaceful negotiations, vigorous demands from Mexican centralists pressured them to refuse. On April 25, 1846, Mexican soldiers attacked U.S. troops along the southern border of Texas. On May 13, president James K. Polk declared war on Mexico. Meanwhile, the Mexicans had attempted two other attacks on American soldiers near the Rio Grande. Both ended in failure. The failures were devastating to the Mexicans, who had a larger and better trained army than the Americans.
In a series of battles at Palo Alto and Resaca de Palma (near current-day Brownsville, Texas), the army of General, and future president, Zachary Taylor defeated Mexican forces and began to move south. In August of 1846, Taylor began formulating plans to attack the Mexican stronghold of Monterrey. Meanwhile, nearly 20,000 American volunteers had gathered near the Rio Grande. Sub-tropical diseases such as dysentery and malaria ravaged the makeshift American military forces. If Mexico would have attacked during this time (July or August), the Mexican War may have very well been won by the Mexicans. Unfortunately for the Mexicans, the country was in civil disarray and the collapse of their central government, combined with numerous militant rebellions in central Mexico, prevented them from organizing any serious offensives. The rebels even offered to help Zachary Taylor defeat the Mexican army. Antonio Lopez de Santa Anna, the same man who surrendered to the Texans, took over as president and commander of the Mexican army.
On September 21, 1846, General Zachary Taylor and 2,000 soldiers easily took Monterrey. Soon after, Saltillo and Parras, Mexico were also taken. In February of 1847, general Winfield Scott, who had taken Veracruz, Mexico, began an advance toward the Mexican capital of Mexico City. American forces led by future heroes Robert E. Lee, George McClellan and others, routed Mexican resistance under General Santa Anna at Cerro Gordo on their way to the Mexican capital. The Mexicans suffered 3,000 casualties. On May 14-15, American forces easily took Puebla. After routing Mexican forces at Churubusco, Winfield Scott and soldiers defeated Santa Anna’s army from the Mexican Military College on the fortified hill of Chapultepec in Mexico City. The Mexicans suffered terrible casualties and were forced to surrender. American forces would next occupy New Mexico and California amidst sporadic resistance. On March 10, 1848, the Americans and Mexicans signed the Treaty of Guadalupe Hidalgo which resulted in the addition of 1.2 million square miles of territory for the United States (virtually all of the American southwest and Texas). It also set the Rio Grande as the border between Mexico and the United States. America agreed to pay Mexico 15 million dollars.