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. The first came late in 1810, following the death of Associate Justice William Cushing. As Supreme Court justices of the time had to ride circuit, Madison had to find a replacement for Cushing who lived in Massachusetts from New England, but there were few qualified potential nominees who were compatible ideologically and politically. At Jefferson's recommendation, Madison first offered the position to former Attorney General Levi Lincoln Sr., but he declined due to ailing health.