He previously served as secretary of state from 1845 to 1849 and represented Pennsylvania in both houses of the U.S. Congress. He was an advocate for states' rights, particularly regarding slavery, and minimized the role of the federal government preceding the Civil War. Buchanan was the last president born in the 18th century.
Buchanan was a prominent lawyer in Pennsylvania and won his first election to the state's House of Representatives as a Federalist. He was elected to the U.S. House of Representatives in 1820 and retained that post for five terms, aligning with Andrew Jackson's Democratic Party. Buchanan served as Jackson's minister to Russia in 1832. He won the election in 1834 as a U.S. senator from Pennsylvania and continued in that position for 11 years. He was appointed to serve as President James K. Polk's secretary of state in 1845, and eight years later was named as President Franklin Pierce's minister to the United Kingdom.
Beginning in 1844, Buchanan became a regular contender for the Democratic party's presidential nomination. He was finally nominated in 1856, defeating incumbent Franklin Pierce and Senator Stephen A. Douglas at the Democratic National Convention. 