[235]

Post-presidency (1817–1836)
Portrait of James Madison after the completion of his two terms as president c. 1821, by Gilbert Stuart
When Madison left office in 1817 at age 65, he retired to Montpelier, not far from Jefferson's Monticello. As with both Washington and Jefferson, Madison left the presidency a poorer man than when he came in. His plantation experienced a steady financial collapse, due to price declines in tobacco and his stepson's mismanagement.[236] In his retirement, Madison occasionally became involved in public affairs, advising Andrew Jackson and other presidents.[237] He remained out of the public debate over the Missouri Compromise, though he privately complained about the North's opposition to the extension of slavery.[238] Madison had warm relations with all four of the major candidates in the 1824 presidential election, but, like Jefferson, largely stayed out of the race.[239] During Jackson's presidency, Madison publicly disavowed the Nullification movement and argued that no state had the right to secede.[240] Madison also helped Jefferson establish the University of Virginia.[241] In 1826, after the death of Jefferson, Madison was appointed as the second rector of the university. 