I don't think they were really legal when introduced as they were ruled to be unconstitutional later. They were however introduced after Reconstruction period of the united states when the federal government withdrew federal soldiers from the southern states to enforce the constitution and the voting and other civil rights of African Americans. read more
Jim Crow laws were state and local laws that enforced racial segregation in the Southern United States. Enacted by white Democratic-dominated state legislatures in the late 19th century after the Reconstruction period, these laws continued to be enforced until 1965. read more