[57][58]

Mexican–American War
Main article: Mexican–American War
In anticipation of the annexation of the Republic of Texas, which had established independence in 1836, Taylor was sent in April 1844 to Fort Jesup in Louisiana, and ordered to guard against attempts by Mexico to reclaim the territory.[59][60] More senior generals in the army might have taken this important command, such as Winfield Scott and Edmund P. Gaines. But both were known members of the Whig Party, and Taylor's apolitical reputation and friendly relations with Andrew Jackson made him the choice of President James K. Polk.[61] Polk directed him to deploy into disputed territory in Texas, "on or near the Rio Grande" near Mexico. Taylor chose a spot at Corpus Christi, and his Army of Occupation encamped there until the following spring in anticipation of a Mexican attack.[62][63]

General Zachary Taylor rides his horse at the Battle of Palo Alto, May 8, 1846
When Polk's attempts to negotiate with Mexico failed, Taylor's men advanced to the Rio Grande in March 1846, and war appeared imminent. Violence broke out several weeks later, when Mexican forces attacked some of Captain Seth B. Thornton's men north of the river.