In 1876, Rutherford B. Hayes won the presidential election despite losing the popular vote. The election was decided by the House of Representatives after no candidate received a majority of electoral votes. Hayes and Samuel J. Tilden were the main contenders, with disputes over votes in Florida, Louisiana, South Carolina, and Oregon. The Compromise of 1877 resolved the crisis, giving Hayes the presidency in exchange for withdrawing federal troops from the South.