[10]
He was a Freemason, and served as the Master of Masonic Lodge No. 43 in Lancaster and as a District Deputy Grand Master of the Grand Lodge of Pennsylvania.[11]

Military service
When the British invaded neighboring Maryland in 1814, he served in the defense of Baltimore as a private in Henry Shippen's Company, 1st Brigade, 4th Division, Pennsylvania Militia, a unit of yagers.[12] Buchanan is the only president with military experience who was not an officer.[13] He is also the last president who served in the War of 1812.[14]

Congressional career
Main article: Electoral history of James Buchanan
U.S. House service
In 1820 Buchanan was elected to the U.S. House of Representatives, though the Federalist Party was waning. As a young Representative, Buchanan was one of the most prominent leaders of the "Amalgamator party" faction of Pennsylvanian politics, named that because it was made up of both Democratic-Republicans and former Federalists. During the 1824 presidential election, Buchanan initially supported Henry Clay, but switched to Andrew Jackson (with Clay as a second choice) when it became clear that the Pennsylvanian public overwhelmingly preferred Jackson.