https://www.history.com/topics/us-presidents/compromise-of-1877
The Compromise of 1877 was an informal agreement between southern Democrats and allies of the Republican Rutherford Hayes to settle the result of the 1876 presidential election and marked the end of the Reconstruction era.
Immediately after the presidential election of 1876, it became clear that the outcome of the race hinged largely on disputed returns from Florida, Louisiana and South Carolina–the only three states in the South with Reconstruction-era Republican governments still in power. As a bipartisan congressional commission debated over the outcome early in 1877, allies of the Republican Party candidate Rutherford Hayes met in secret with moderate southern Democrats in order to negotiate acceptance of Hayes’ election.