Born on 23 April 1791 to hardworking Scotch-Irish parents near Mercersburg, Pennsylvania, Buchanan graduated from Dickinson College in 1809. After a successful legal career in Lancaster, Pennsylvania, and a term in the state legislature, he spent forty years, with brief interruptions, as congressman, senator, secretary of state under James K. Polk, and minister to Great Britain under Franklin Pierce.
Probably eyeing the presidency from the beginning, Buchanan carefully and shrewdly maneuvered his way through numerous controversies and crises, and usually either emerged on the popular side or avoided any public commitment at all. Some historians have considered him indecisive and weak, but his decisions and actions usually served a clear-cut purpose. In 1824 he strongly supported Henry Clay for president, but even after contradicting Andrew Jackson publicly, he was on Old Hickory's winning side by 1828. As a representative and senator, he was regularly elected first as a Federalist and then as a Democrat in a state where each party was usually divided bitterly on both issues and personalities. As secretary of state, he opposed President Polk's demand for 54°40' as the boundary of Oregon; prepared a brilliant argument for 54°40' refused to support his own argument and advocated a compromise; and, finally, on the grounds that 54°40' was correct, refused to help prepare the message submitting 49° to the Senate. During the Mexican War he advocated only limited annexations, opposed Polk's effort to send a prestigious peace commission for fear it would not demand enough territory, and finally opposed the actual peace treaty because it did not annex more territory to the United States. Perhaps he was indecisive, but he emerged from the bitterly controversial Polk administration with no serious political scars.
Buchanan, however, was not without strong feelings and convictions. As a young man he had vowed to remain a bachelor when his fiancée died shortly after an unexplained estrangement. He was an extrovert who craved affection and companionship, and as a congressman and senator he formed close personal friendships with southern colleagues who often left their wives at home and tended to dominate Washington's boardinghouse society. His dearest friend and longtime roommate was Senator and later Vice President William R. King of Alabama, and Howell Cobb of Georgia and Jefferson Davis also occupied strong places in his affections. Buchanan was also the patriarch and chief financial supporter of an enormous brood of orphaned cousins, nieces, and nephews and could appreciate the southern defense of slavery as a paternalistic institution. He ultimately accumulated a fortune of some $300,000 as a lawyer and investor, but his most cherished possession was Wheatland, a manorial estate near Lancaster. He could understand the psychic rewards of a marginally profitable plantation because he shared them. For these and perhaps other reasons, James Buchanan by 1857 had thoroughly identified himself emotionally with the South and its fears and ambitions. He occasionally expressed a dislike for slavery, but at no time did he publicly oppose its expansion or express any repugnance against such a possibility. In 1826 he denounced slavery as a political and moral evil that could not be remedied without the "introduction of evils infinitely greater." Emancipation, he opined, would turn the slaves into masters, and "who could for a moment indulge in the horrible idea of abolishing slavery by the massacre of the high-minded, and the chivalrous race of men in the South? . . . For my own part I would, without hesitation, buckle on my knapsack, and march . . . in defense of their cause."
In 1850 Buchanan supported the Compromise and condemned the Wilmot Proviso, which would have forbidden slavery in the territories taken from Mexico. Serving as minister to England from 1853 to 1857, he avoided the bitter debates over the Kansas-Nebraska Act, which repealed the Missouri Compromise ban on slavery north of 36°30'. With the U.S. ministers to France and Spain (both southerners), however, he co-authored the Ostend Manifesto, which urged the annexation of Cuba by force if necessary to protect American slavery against the threat of abolition in Cuba.