James Monroe's tenure as the fifth president of the United States began on March 4, 1817, and ended on March 4, 1825. Monroe, a member of the Democratic-Republican Party, took office after winning the 1816 presidential election by in a landslide against Federalist Rufus King. This election was the last in which the Federalists fielded a presidential candidate, and Monroe was unopposed in the 1820 presidential election. Monroe was succeeded by his Secretary of State John Quincy Adams.
Monroe sought to eliminate political parties, and the Federalist Party faded as a national institution during his presidency. The Democratic-Republicans also stopped functioning as a unified political party, and the period during which Monroe served as president is often referred to as the "Era of Good Feelings" due to the lack of partisan conflict. Domestically, Monroe faced the Panic of 1819, the first major recession in American history. He supported many federally-funded infrastructure projects, but vetoed other projects due to constitutional concerns. Monroe signed the Missouri Compromise, which admitted Missouri as a slave state but excluded slavery in the remaining territories north of the parallel 36°30′ north.