Under the Compromise of 1877 Hayes was elected because he agreed to appointing a Democrat to his cabinet. In addition, he agreed to withdraw Republican troops from the southern states and the end the Reconstruction. It is said that this was the start of racial segregation and the Jim Crow laws.