An informal, "back-room" deal was struck to resolve the votes: the Compromise of 1877. In the deal, the Democrats conceded the 20 contested electoral votes to Hayes, resulting in a 185-184 victory; in return, the Republicans agreed to withdraw federal troops from the South, marking the end of Reconstruction.