After building a successful law practice in Tennessee, Polk was elected to the state legislature (1823) and then to the United States House of Representatives in 1825, becoming a strong supporter of Andrew Jackson. After serving as chairman of the Ways and Means Committee, he became Speaker in 1835, the only president to have been Speaker. Polk left Congress to run for governor of Tennessee; he won in 1839, but lost in 1841 and 1843. He was a dark horse candidate for the Democratic nomination for president in 1844; he entered his party's convention as a potential nominee for vice president, but emerged as a compromise to head the ticket when no presidential candidate could secure the necessary two-thirds majority. In the general election, Polk defeated Henry Clay of the rival Whig Party.