Civil Rights Act of 1875 outlaws segragation. In 1883, an all-white Supreme Court would declare the act unconstitutional.
The doctrine was confirmed in the Plessy v. Ferguson Supreme Court decision of 1896, which allowed state-sponsored segregation. Though segregation laws existed before that case, the decision emboldened segregation states during the Jim Crow era, which had commenced in 1876 and supplanted the Black Codes, which restricted the civil rights and civil liberties of African Americans during the Reconstruction Era. 18 states had segregation laws.
In practice the separate facilities provided to African Americans were rarely equal; usually they were not even close to equal, or they did not exist at all.
The doctrine of separate but equal was overturned by a series of Supreme Court decisions, starting with Brown v. Board of Education of 1954. However, the overturning of segregation laws in the United States was a long process that lasted through much of the 1950s, 1960s, and 1970s, involving federal legislation (especially the Civil Rights Act of 1964), and many court cases.