On May 13, 1846, the US declared war on Mexico, two months after fighting had begin. From the article:
"Mexican-American War
The Mexican-American War (1846-1848) marked the first U.S. armed conflict chiefly fought on foreign soil. It pitted a politically divided and militarily unprepared Mexico against the expansionist-minded administration of U.S. President James K. Polk, who believed the United States had a “manifest destiny” to spread across the continent to the Pacific Ocean. A border skirmish along the Rio Grande started off the fighting and was followed by a series of U.S. victories. When the dust cleared, Mexico had lost about one-third of its territory, including nearly all of present-day California, Utah, Nevada, Arizona and New Mexico.
Causes of the Mexican-American War
Texas gained its independence from Mexico in 1836. Initially, the United States declined to incorporate it into the union, largely because northern political interests were against the addition of a new slave state. The Mexican government was also encouraging border raids and warning that any attempt at annexation would lead to war.
Nonetheless, annexation procedures were quickly initiated after the 1844 election of Polk, who campaigned that Texas should be “re-annexed” and that the Oregon Territory should be “re-occupied.” Polk also had his eyes on California, New Mexico and the rest of what is today the U.S. Southwest. When his offer to purchase those lands was rejected, he instigated a fight by moving troops into a disputed zone between the Rio Grande and Nueces River that both countries had previously recognized as part of the Mexican state of Coahuila.
The Mexican-American War Begins
On April 25, 1846, Mexican cavalry attacked a group of U.S. soldiers in the disputed zone under the command of General Zachary Taylor, killing about a dozen. They then laid siege to an American fort along the Rio Grande. Taylor called in reinforcements, and–with the help of superior rifles and artillery–was able to defeat the Mexicans at the battles of Palo Alto and Resaca de la Palma.
Following those battles, Polk told the U.S. Congress that the “cup of forbearance has been exhausted, even before Mexico passed the boundary of the United States, invaded our territory, and shed American blood upon American soil.” Two days later, on May 13, Congress declared war, despite opposition from some northern lawmakers. No official declaration of war ever came from Mexico.
Mexican-American War: U.S. Army Advances Into Mexico
At that time, only about 75,000 Mexican citizens lived north of the Rio Grande. As a result, U.S. forces led by Col. Stephen W. Kearny and Commodore Robert F. Stockton were able to conquer those lands with minimal resistance. Taylor likewise had little trouble advancing, and he captured Monterrey in September.
With the losses adding up, Mexico turned to old standby General Antonio López de Santa Anna, the charismatic strongman who had been living in exile in Cuba. Santa Anna convinced Polk that, if allowed to return to Mexico, he would end the war on terms favorable to the United States. But when he arrived, he immediately double-crossed Polk by taking control of the Mexican army and leading it into battle. At the Battle of Buena Vista in February 1847, Santa Anna suffered heavy casualties and was forced to withdraw. Despite the loss, he assumed the Mexican presidency the following month.
Meanwhile, U.S. troops led by Gen. Winfield Scott landed in Veracruz and took over the city. They then began marching toward Mexico City, essentially following the same route that Hernán Cortés followed when he invaded the Aztec empire. The Mexicans resisted at Cerro Gordo and elsewhere, but were bested each time. In September 1847, Scott successfully laid siege to Mexico City’s Chapultepec Castle. During that clash, a group of military school cadets–the so-called niños héroes–purportedly committed suicide rather than surrender.
Treaty of Guadalupe Hidalgo Ends the Mexican-American War
Guerilla attacks against U.S. supply lines continued, but for all intents and purposes the war had ended. Santa Anna resigned, and the United States waited for a new government capable of negotiations to form. Finally, on Feb. 2, 1848, the Treaty of Guadalupe Hidalgo was signed, establishing the Rio Grande and not the Nueces River as the U.S.-Mexican border. Under the treaty, Mexico also recognized the U.S. annexation of Texas, and agreed to sell California and the rest of its territory north of the Rio Grande for $15 million plus the assumption of certain damages claims."