
The United States had just come through the War of 1812, a war it was ill-prepared for, and a war which ended with the nation being virtually in the same position that it was before it began. The peace that was reached seemed to be satisfactory to the American people, and the Democratic-Republican party received the credit for its conclusion. Although the war had began badly, leading to the British invasion and the burning of much of Washington D.C., late victories had restored American pride, and had led to national contempt for the Federalist Party. They were discredited nationally because of their opposition to the war and their secessionist rhetoric from members of the party. The Hartford Convention of 1814-15 was an effort by some Federalists to capitulate and the party was now paying the price for their actions.
Incumbent President James Madison had completed two terms in office. He following the precedent set by George Washington and by Thomas Jefferson and did not seek a third term. He had succeeded in achieving some of the measures favored by the Federalists, including the creation of a national bank and of protective tariffs. This also gave former Federalist voters a reason to abandon their party. Things got so bad for the Federalists that their caucus did not even bother to formally nominate a candidate for president, although many Federalists supported New York Senator Rufus King, who had been defeated twice before as the Federalist vice presidential candidate. Former Senator John Eager Howard of Maryland was the principal Federalist candidate for vice president.
In those days, before universal suffrage, candidates for president were selected by the caucuses of the major political parties. It helped if the incumbent President gave his blessing and in 1816, Secretary of State James Monroe had that advantage. Monroe was the favorite candidate of both retiring President Madison as well as former President (and elder statesman) Thomas Jefferson. He also had a pretty impressive resume. He had fought in the Revolutionary War, where he was wounded in the Battle of Trenton with a musket ball to his shoulder. After studying law under Thomas Jefferson from 1780 to 1783, he served as a delegate in the Continental Congress. As an anti-federalist delegate to the Virginia convention that considered ratification of the United States Constitution, Monroe had opposed ratification, arguing that it gave too much power to the central government. He had run against Madison for a seat in congress and lost, but the campaign is a textbook study in how to disagree without being disagreeable. (This story is ably told in author Christ DeRose's terrific 2012 book Founding Rivals: Madison vs. Monroe, The Bill of Rights, and The Election that Saved a Nation, reviewed here in this community.) In 1790 Monroe was elected to the Senate of the first United States Congress. He later served on two different occasions as the Governor of Virginia as well as the Minister (ambassador) to France, where he helped negotiate the Louisiana Purchase in 1803. During the War of 1812, Monroe held the critical roles of Secretary of State and later did double duty as the Secretary of War in Madison's cabinet.
Despite the support of two Virginia icons, Monroe faced stiff competition for the nomination from Secretary of War William H. Crawford of Georgia. There was widespread sentiment, especially in New York, that it was time to end the Virginia dynasty of presidents. (All presidents thus far except one, John Adams, hailed from Virginia). Crawford never formally declared himself a candidate, because he believed that he had little chance against Monroe and he was afraid that such a contest might deny him a place in the new cabinet. But this did not deter Crawford's supporters. In March 1816, the Democratic-Republican congressmen voted in caucus for their party's choice of a nominee for President in the upcoming election. The vote was not a slam-dunk for Monroe. He defeated Crawford for the nomination by a vote of 65 to 54. Governor Daniel Tompkins of New York was selected as the party's candidate for Vice-President by a vote of 85 to 30.

In the election campaign, only 10 of the 19 states held a popular vote. In those states Monroe received 76,592 votes (68.2%) compared to 34,740 for Federalist candidate Rufus King. In the electoral college, Monroe received 183 electoral votes, compared to 34 for King. On February 12, 1817, the House and Senate met in joint session to count the electoral votes. The count proceeded without incident until the roll came to the last state to be counted, Indiana. At that point, Representative John W. Taylor of New York objected to the counting of Indiana's votes. He argued that Congress had acknowledged the statehood of Indiana in a joint resolution on December 11, 1816, whereas the ballots of the Electoral College had been cast on December 4, 1816. His opponents argued that the joint resolution merely recognized that Indiana had already joined the Union by forming a state constitution and government on June 29, 1816. They noted that both the House and Senate had seated members from Indiana who had been elected prior to the joint resolution, which would have been unconstitutional had Indiana not been a state at the time of their election. Representative Samuel D. Ingham then moved that the question be postponed indefinitely. The House agreed almost unanimously, and the Senate was brought back in to count the electoral votes from Indiana. Even if the issue had gone against Monroe, he would still have won the election.
Monroe went on to serve two full terms. He was not challenged for re-election in 1820 and one electoral vote was cast against him only so that the honor of a unanimous victory would be reserved for George Washington. Monroe largely ignored old party lines in making many political appointments. This reduced political tensions and brought about a time of political peace known as the "Era of Good Feelings". He made two long national tours in 1817 in an effort to heal national wounds and was warmly received even in federalist New England. I'm often surprised that Monroe doesn't rank higher in rankings of the presidents.