Buchanan became a successful lawyer before representing his state in the United States House of Representatives. He was elected to the Senate and later served as Minister (Ambassador) to Russia under President Andrew Jackson. He was also Secretary of State under President James K. Polk. Buchanan turned down an an appointment to the US Supreme Court. President Franklin Pierce appointed him Minister to the Court of St. James. His time in London seemed to distance him from the sins of the Pierce administration, and he was nominated by the Democratic Party as its candidate in the 1856 Presidential election.
Buchanan won the Presidency in a three-man race with John C. Frémont and Millard Fillmore. As President, he was often called a "doughface", a Northerner with Southern sympathies. He tried to maintain peace between the North and the South largely by giving in to the south, but in the process he only managed to alienate both sides. In the dying months of his administration, the Southern states declared their secession, leading to the Civil War. Buchanan's view of record was that secession was illegal, but that going to war to stop it was also illegal.
By the time he left office, the Democratic Party had split. Buchanan had once aspired to a presidency that would rank in history with that of George Washington and his biographer Jean Baker has written that no one ever became president with as impressive qualifications for the office as Buchanan. However, his inability to take any useful action to prevent the break-up of the nation has led to his consistent ranking by historians as one of the worst presidents in American history. In two separate polls of historians (in 2006 and 2009) his failure to deal with secession was selected as the worst presidential mistake ever made.
Buchanan is the only president to have been a bachelor. There is speculation that he may have been involved in a gay relationship with Senator (and later Vice-President) William Rufus King of Alabama. Many of his contemporaries spread such rumors and even went so far as to refer to King as "Mrs. B", but there is insufficient evidence on which to prove such a theory. The two men's nieces destroyed almost all of their correspondence.
After leaving office, Buchanan wrote an autobiography entitled Mr. Buchanan's Administration on the Eve of Rebellion, which attempted to justify his inaction against the seceding states. I've read it, it's not very convincing. Buchanan caught a cold in May 1868, which quickly worsened due to his advanced age. He died on June 1, 1868, from respiratory failure at the age of 77 at his home at Wheatland and was interred in Woodward Hill Cemetery in Lancaster.