Here are five of the closest presidential races in U.S. history since 1840 as compiled by Yahoo!.
5. Woodrow Wilson vs. Charles Evans Hughes (1916)
This race was close from the start.On election night, it looked as though the Republican challenger Hughes had won. But it all came down to California. Wilson won the state by just 0.3 percent, and won a second term as president.
4. James Polk vs. Henry Clay (1844)
Clay, a Whig candidate, ended up losing New York by just 5,000 votes, mostly because of a third party candidate opposed to the annexation of Texas due to the expansion of slavery that would follow. If Clay had remained opposed to the annexation, he might have won the state, which would have handed him the election as well.
3. Rutherford Hayes vs. Samuel Tilden (1876)
Similar to the 2000 election, the winner of the popular vote did not win this election. In fact, the contest was ultimately decided in Hayes' favor by a panel of administrators, much like how the Supreme Court decided the election of 2000. The panel's 8-7 decision was split down party lines, with the Republican Hayes declared the winner.
2. Grover Cleveland vs. James Blaine (1884)
This election was not assured until the final week. It was then that a Blaine supporter made a controversial statement that derided Roman Catholics, angering many New York voters. In the end, Cleveland ended up winning the state (and the election) by just 575 votes.
1. George W. Bush vs. Al Gore (2000)
Just as in 1876, the winner of the 2000 popular vote ended up losing the election, and again under controversial circumstances. Only about 500 votes separated Bush and Gore in must-win Florida, and after more than a month of lawsuits, bickering and recounts, the U.S. Supreme Court voted to stop the recounts in Florida and give Bush the win.