President Polk had additional political problems with the war besides Mr. Wilmot's proposal. Both senior generals—Zachary Taylor and Winfield Scott—were Whigs, and the nation had already shown a propensity to raise successful generals to high office. But the demands of war outweighed the political issue, and both generals led American troops in the conflict. As mentioned above, opposition to and support for the war tended to divide along political lines, and the conduct of the war had strong political overtones.
Campaigns in Northern Mexico. After war was declared, General Taylor moved to relieve the besieged Americans at Fort Texas, which had been renamed Fort Brown in honor of its fallen commander. Along the way he fought two successful battles against numerically superior Mexican forces at Palo Alto and Resaca de la Palma. He then crossed the Rio Grande and occupied Matamoros, where he undertook to train several thousand volunteers who had recently joined his army. Meanwhile, General John Wool set out from San Antonio toward the Mexican town of Chihuahua, farther to the west. A third force under Colonel Stephen Kearny set out from Fort Leavenworth, Kansas, for California. A portion of Kearny's command under Colonel Alexander Doniphan was detached and sent across the Rio Grande at El Paso toward Chihuahua, where they defeated a force of Mexican militia. General Wool's force eventually joined Taylor's command.
With his army increased by volunteers, Taylor moved up the Rio Grande on the Mexican side and established a base for a march on the city of Monterrey. The city was well fortified on the north by a strong citadel. Taylor divided his army, sent troops to cut off the city from the rear and attacked from several directions while using artillery and mortars to attack the citadel. Fighting within the city was heavy, but following a four day-siege, the enemy surrendered. Although Taylor had been successful since the beginning of his campaign, he was still a long way from Mexico City. He proceeded to advance further into Mexico in the direction of San Luis Potosi, where General Antonio Lopez de Santa Anna was assembling a large army. Santa Anna had been released from exile by President Polk in the hope that the general would be willing to negotiate a truce. Santa Anna, however, accused of having betrayed his country to the Americans, chose to fight.
Santa Anna advanced northward with the intention of driving Taylor out of Mexico. Taylor wisely withdrew to a strong defensive position near Buena Vista. With his force of less than 5,000 men, he awaited the attack of Santa Anna's 15,000 soldiers. Santa Anna ordered an unconditional surrender, but Taylor refused. Though outnumbered, Taylor's army withstood repeated Mexican attacks, inflicting heavy casualties on their enemies, and on February 23,
Meanwhile, The U. S. Navy had captured the port of Tampico. General Winfield Scott was authorized to conduct a landing at Vera Cruz in anticipation of a march on Mexico City. Scott arrived in Mexico in December 1846 and detached several thousand of Taylor's troops and ordered them to march to Tampico to take part in the Vera Cruz operation. Taylor was outraged; he believed that Scott's plan was politically motivated. As Scott was the senior general, with service dated back to the War of 1812, Taylor had to follow his orders.
1847, Santa Anna began to withdraw toward Mexico City. The hardest battle of the war was won, the war in northern Mexico was over, and the area along the Rio Grande was secure.
General Scott's Vera Cruz Campaign. In February 1847 General Scott landed his force of about 10,000 men at a position south of Vera Cruz in a landing that was essentially unopposed. Assisted by naval batteries that shelled the city, Scott's army achieved the surrender of Vera Cruz with only light American losses. On April 8 Scott set off along the National Road toward Mexico City. Santa Anna had assembled a force of about 13,000 to block Scott's advance at Cerro Gordo. Using the skillful reconnaissance information gained by Captains Robert E. Lee and George B. McClellan, Scott flanked the Mexican force and routed Santa Anna. By May 15th Scott was 80 miles from Mexico
City, where he paused, awaiting fresh troops. Once reinforced, Scott continued his well-organized advance and defeated the Mexican army once more at the battles of Contreras and Churubusco, driving to within 5 miles of the capital.
President Polk, meanwhile, had sent Nicholas Trist, the chief clerk of the State Department, to accompany Scott's army with authorization to negotiate peace terms with the Mexican government. Scott was not especially welcoming to Trist, feeling that as commander on the ground, he himself was responsible for negotiations. Nevertheless, after some discussion, Trist was allowed by Scott to negotiate an armistice with the Mexican government. When the offer was rejected, Scott proceeded to march on the capital.
In their final assault on Mexico City, Scott's soldiers and Marines attacked the fortress of Chapultepec and eventually scaled the rocky walls and arrived at the summit. The Americans moved into the city, raised their flag over the National Palace, and a battalion of Marines occupied the "Halls of Montezuma."