The American Civil War brought slavery in the United States to an end with the ratification of the Thirteenth Amendment in 1865. Following the war, the Fourteenth Amendment to the United States Constitution guaranteed equal protection under the law to all people and Congress established the Freedmen's Bureau to assist the integration of former slaves into Southern society. The Reconstruction Era brought new freedoms and laws promoting racial equality to the South. However, after the Compromise of 1877 ended Reconstruction and withdrew federal troops from all Southern states, many former slaveholders and Confederates were elected to office. The Fourteenth Amendment guaranteed equal protection to all people but Southern states contended that the requirement of equality could be met in a way that kept the races separate. Furthermore, the state and federal courts tended to reject the pleas by African Americans that their Fourteenth Amendment rights were violated, arguing that the Fourteenth Amendment applied only to federal, not state, citizenship. This rejection is evident in the Slaughter-House Cases and Civil Rights Cases.