There was a big issue with the result in the election of 1876. Samuel Tilden was facing Rutherford B. Hayes. When the votes were counted there was a problem with the results in four states. This meant there was a total of twenty disputed electoral votes. Since Tilden was leading by 19 electoral votes, they had to resolve the issue in these four states. If Hayes won them all, he would win the presidency by one electoral vote.
To resolve this crisis, an independent commission was established. However, the commission was unable to resolve the dispute. Fortunately, Congress came up with the Compromise of 1877. In this compromise, the election would go to the Republican candidate, Rutherford B. Hayes. In return, federal troops that were enforcing reconstruction would leave the South. This is how the dispute was resolved.