The United States presidential election of 1848 was an open race. President James Polk, having achieved all of his major objectives in one term and suffering from declining health that would take his life less than four months after leaving office, kept his promise not to seek re-election.
The Whigs in 1846-47 had focused all their energies on condemning Polk's war policies. They had to quickly reverse course. In February 1848 Polk surprised everyone with the Treaty of Guadalupe Hidalgo that ended the Mexican-American War and gave the U.S. vast new territories (including California, Nevada, Utah, and parts of Wyoming, Colorado, Arizona, and New Mexico). The Whigs in the Senate voted 2-1 to approve the treaty. Then in the summer the Whigs nominated the hero of the war, Zachary Taylor. While he did promise no more future wars, he did not condemn the war or criticize Polk, and Whigs had to follow his lead. They shifted their attention to the new issue of whether slavery could be banned from the new territories. The choice of Taylor was almost in desperation--he was not clearly committed to Whig principles, but he was popular for leading the war effort. The Democrats had a record of victory, peace, prosperity, and the acquisition of both Oregon and the Southwest; they appeared almost certain winners unless the Whigs picked Taylor. Taylor's victory made him one of only two Whigs to be elected President before the party ceased to exist in the 1850s; the other Whig to be elected President was William Henry Harrison, who had also been a general and war hero, but died a month into office.