Martin Van Buren ; December 5, 1782 – July 24, 1862) was the eighth President of the United States . A member of the Democratic Party, he served in a number of senior roles, including eighth Vice President and Secretary of State , both under Andrew Jackson. Van Buren's inability as president to deal with the economic chaos of the Panic of 1837 and with the surging Whig Party led to his defeat for re-election in 1840.