The war fell into three main campaigns. The first, in Texas, started on 24 March 1846, when General Taylor with 3,500 men advanced to the Rio Grande, and established a fortified camp (Fort Texas) opposite the city of Matamoros, before marching with most of his force to his supply camp at the mouth of the Rio Grande. In his absence, General Mariano Arista with 6,000 crossed the Rio Grande and laid siege to Fort Texas (soon renamed Fort Brown, after Major Jacob Brown who was killed commanding the defence. Hearing of the Mexican attack, Taylor rushed back, and in two successive battles - Palo Alto on 8 May and Resaca de la Palma on 9 May routed the Mexican army, inflicted five times as many casualties as he suffered. Only at this point did the US declare war on Mexico (13 May). Five days later Taylor crossed into Mexico, but he was delayed for three months waiting for transport before he could continue towards the fortified city of Monterey where General Pedro de Ampudia had 10,000 Mexican troops, compared to Taylor's 6,000. On 20-24 September, Taylor led a determined attack on the city, and finally Ampudia surrendered. At this point the Americans were crippled by a political dispute. General Winfield Scott, the commander of the US Army, suggested an invasion of central Mexico from the sea, but President Polk, a political opponent of Scott, did not want him to gain the glory of a successful invasion, and suggested that Taylor march 300 miles across the desert to launch a land attack on Mexico City. Taylor refused, and Scott's plan was approved. By now, President Santa Anna of Mexico had learnt of this plan, and himself marched 20,000 men across the desert to attack Taylor, hoping to pre-empt the invasion. Taylor decided to fight, and over two days of the battle of Buena Vista (22-23 February 1847) managed to fight off the Mexican force, forcing Santa Anna to withdraw and ending fighting around the Rio Grande.
Soon after fighting started in the south, fighting began in California, with the occupation of Monterey by a naval force (24 June 1846). At the same time, a small force of 1,600 men under Brigadier General Stephen Watts Kearny was ordered to march overland from Fort Leavenworth to occupy California. At the end of September he had reached Santa Fe, and occupied New Mexico. Hearing that California was already pacified, he left most of his troops there, and marched on with only 120 men. However, his news was out of date, as a general revolt in California, where the US presence was unpopular, had gained control of most of the state. His path to San Diego, where the navy was in control, was blocked at San Pascual, where he fought an inconclusive battle against 500 Mexican cavalry on 6 December, before being met by the Marines four days later. The now combined Army and Navy force inflicted a decisive defeat on the Mexicans on 9 January at the battle of San Gabriel, ending any chance they had of saving California.
The final campaign of the war soon began. General Scott, with 10,000 troops, landed near Vera Cruz, on the coast east of Mexico City on 9 March.On 27 March he captured the city, and immediately marched inland to avoid yellow fever on the coast. His path was blocked by Santa Anna at Cerro Gordo (18 April 1847), who outnumbered him 12,000 to 8,500, but Scott found a mountain path that allowed him to envelop the Mexican force, and inflicted a heavy defeat on the Mexicans. By 15 May, Scott was at Pueblo, only 75 miles from Mexico City, but he was forced to stop here until August, waiting for reinforcements to restore his force to 11,000 men, but even then he was still outnumbered by Santa Anna, who had 30,000 men in the defence of the city. On 7 August, Scott left Pueblo, and marched on Mexico City. Finding the direct route blocked, he detoured around the south of Lake Chalco and Lake Xochimilco, only to find his route still blocked by strong Mexican forces at Contreras and Churubusco, south of the city. Once again he was able to find unmapped routes into the Mexican positions, and on 20 August 1847 fought two simultaneous battles, at Contreras and Churubusco. After these battles, Scott was reduced to 8,500 men, Santa Anna to 20,000. Two weeks of fruitless negotiations followed, after which Scott resumed his attack, winning the battle of Molino del Rey on 8 September and Chapultepec on 13 September, leaving him free to launch his assault on Mexico City, but overnight Santa Anna evacuated the city, leaving Scott free to occupy the city on 14 September. Although a Mexican force did attempt an attack on the American camp at Puebla, not abandoned until 12 October, this marked the effective defeat of Mexico, and negotiations began at Guadalupe Hidalgo.
The negotiations dragged on until 2 February 1848, when the Treaty of Guadalupe Hidalgo was signed, granting America California, Utah, Nevada, Arizona, New Mexico and the disputed portions of Texas, creating the modern US-Mexican border. In return, the United States paid Mexico $15 million dollars. Several of the soldiers of the Mexican war later went on to play a important part in the American Civil War, including Jefferson Davis, Robert E. Lee and U.S.Grant
Results of the Mexican War