The presidency of James Madison began on March 4, 1809, when James Madison was inaugurated as President of the United States, and ended on March 4, 1817. Madison, the fourth United States president, took office after defeating Federalist Charles Cotesworth Pinckney decisively in the 1808 presidential election. He was re-elected four years later, defeating DeWitt Clinton in the 1812 election. His presidency was dominated by the War of 1812 with Britain. Madison was succeeded by Secretary of State James Monroe, a fellow member of the Democratic-Republican Party.