Martin Van Buren ( ; born Maarten Van Buren ; December 5, 1782 – July 24, 1862) was an American lawyer and statesman who served as the eighth president of the United States from 1837 to 1841. A founder of the Democratic Party, he had previously served as the ninth governor of New York, the tenth United States 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 the Whig nominee, William Henry Harrison, thanks in part to the poor economic conditions surrounding the Panic of 1837. Later in his life, Van Buren emerged as an elder statesman and an important anti-slavery leader who led the Free Soil Party ticket in the 1848 presidential election.