This isn't the first time this has happened.... 1824, 1876, 1888.
The United States presidential election of 1824 was the tenth quadrennial presidential election, held from Tuesday, October 26, to Thursday, December 2, 1824. John Quincy Adams (son of the 2nd President John Adams) was elected President on February 9, 1825. The election was decided by the House of Representatives under the provisions of the Twelfth Amendment to the United States Constitution after no candidate secured a majority of the electoral vote. It was the first (and only) presidential election in which the candidate who received the most electoral votes (Andrew Jackson) did not become President, a source of great bitterness for Jackson and his supporters, who proclaimed the election of Adams a corrupt bargain. The election also saw the first instance of a candidate winning a presidential election despite not receiving a majority of popular votes cast.
Prior to the election, the Democratic-Republican Party had won the last six consecutive presidential elections. In 1824 the Democratic-Republican Party failed to agree on a choice of candidate for president, with the result that the party effectively ceased to exist and split four ways behind four separate candidates. Later, the faction led by Andrew Jackson would evolve into the modern Democratic Party, while the factions led by John Quincy Adams and Henry Clay would become the National Republican Party (not related to the current Republican Party) and then the Whig Party.
Andrew Jackson
Democratic-Republican
Popular vote: 151,271 (41.4%)
Electorial vote: 99
John Quincy Adams
Democratic-Republican
Popular vote: 113,122 (30.9%)
Electorial vote: 84
William Harris Crawford
Democratic-Republican
Popular vote: 40,856 (11.2%)
Electorial vote: 41
Henry Clay
Democratic-Republican
Popular vote: 47,531 (13.0%)
Electorial vote: 37
Electorial votes needed to win: 131
Results by state in House of Representatives:
Adams votes: 87 (41%) Votes by state: 13
Jackson votes: 71 (33%) Votes by state: 7
Crawford votes: 54 (25%) Votes by state: 4
================================================
The United States presidential election of 1876 was the 23rd quadrennial presidential election, held on Tuesday, November 7, 1876. It was one of the most contentious and controversial presidential elections in American history. The results of the election remain among the most disputed ever, although there is no question that Samuel J. Tilden of New York outpolled Ohio's Rutherford B. Hayes in the popular vote. After a first count of votes, Tilden won 184 electoral votes to Hayes's 165, with 20 votes unresolved. These 20 electoral votes were in dispute in four states. In the case of Florida, Louisiana, and South Carolina, each party reported its candidate had won the state, while in Oregon one elector was declared illegal (as an "elected or appointed official") and replaced. The question of who should have been awarded these electoral votes is the source of the continued controversy concerning the results of this election.
An informal deal was struck to resolve the dispute which was the 'Compromise of 1877', which awarded all 20 electoral votes to Hayes. In return for the Democrats' acquiescence to Hayes's election, the Republicans agreed to withdraw federal troops from the South to end the Reconstruction era of the United States. The Compromise effectively ceded power in the Southern states to the Democratic Redeemers, who went on to pursue their agenda of returning the South to a political economy resembling that of its pre-war condition, including the disenfranchisement of black voters.
The returns accepted by the 15-man Electorial Commission put Hayes' margin of victory in South Carolina at 889 votes, the second-closest popular vote margin in a decisive state in U.S. history, after the election of 2000, which was decided by 537 votes in Florida (though in 2000, the declared margin of victory in the Electoral College for George W. Bush was five votes, as opposed to Hayes' one vote).
This was the first presidential election since 1852 in which the Democratic candidate won a majority of the popular vote. This is also the only election in which a candidate for president received more than 50 percent of the popular vote, but was not elected president by the Electoral College, and one of four elections (in addition to 1824, 1888, and 2000) in which the person who won the most popular votes did not win the election. To date, it remains the election that recorded the smallest electoral vote victory and the election that yielded the highest voter turnout of the eligible voting age population.
Rutherford B. Hayes
Republican
Popular vote: 4,034,142 (47.92%)
Electorial vote: 185
Samuel J. Tilden
Democratic
Popular vote: 4,286,808 (50.92%)
Electorial vote: 184
Electorial votes needed to win: 185
=====================================================
The United States presidential election of 1888 was the 26th quadrennial presidential election, held on Tuesday, November 6, 1888. It saw Grover Cleveland of New York, the incumbent president and a Democrat, try to secure a second term against the Republican nominee Benjamin Harrison, a former U.S. Senator from Indiana. The economy was prosperous and the nation was at peace, but Cleveland lost re-election in the Electoral College, even though he won a plurality of the popular vote by a narrow margin.
Harrison swept almost the entire North and Midwest (losing only Connecticut and New Jersey), and narrowly carried the swing states of New York (Cleveland's home state) and Indiana (Harrison's home state) by a margin of 1% or less to achieve a majority of the electoral vote. Unlike the election of 1884, the power of the Tammany Hall political machine in New York City helped deny Cleveland the electoral votes of his home state.
This election is notable for being the third of four U.S. presidential elections in which the winner did not win the popular vote. The first, in 1824, saw John Quincy Adams elected by the House of Representatives. The second occurred just 12 years earlier in 1876, while the fourth would occur 112 years later in 2000. It is also notable because only two states (New York and Indiana) switched parties in the electoral vote in comparison to the preceding election. It would not be until the election of 2012 that only two states (Indiana and North Carolina) would switch parties in consecutive elections.
Benjamin Harrison
Republican
Popular vote: 5,443,892 (47.80%)
Electorial vote: 233
Grover Cleveland (Incumbent)
Democratic
Popular vote: 5,534,488 (48.63%)
Electorial vote: 168
Electorial votes needed to win: 201