The Disputed Election of 1876
The election of 1876 between Rutherford B. Hayes and Democrat Samuel Tilden of New York was one of the most hostile, controversial campaigns in American history.
Tilden won the popular vote and led in the electoral college, but 19 votes from three Republican-controlled states (Louisiana, Florida, and South Carolina) remained disputed. Oregon's count was also challenged.
Allegations of widespread voter fraud forced Congress to set up a special electoral commission to determine the winner, composed of fifteen congressmen and Supreme Court justices.
The commission finally announced their decision only two days before the inauguration. The vote was 8-7 along party lines to award the disputed electoral college votes to Hayes, making him the winner.
https://www.rbhayes.org/hayes/disputed-election-of-1876/