Martin Van Buren was the eighth president of the United States from 1837 to 1841. A founder of the Democratic Party, he previously served as the ninth governor of New York, the tenth U.S. secretary of state, and the eighth vice president of the United States. He won the 1836 presidential election with the endorsement of popular outgoing President Andrew Jackson and the organizational strength of the Democratic Party. He lost his 1840 reelection bid to Whig Party nominee William Henry Harrison, due in part to the poor economic conditions of the Panic of 1837. Later in his life, Van Buren emerged as an elder statesman and important anti-slavery leader, who led the Free Soil Party ticket in the 1848 presidential election.