Legislation seeking to direct relations between racial or ethnic groups in the United States has had several historical phases, developing from the European colonization of the Americas, the triangular slave trade, and the American Indian Wars. The 1776 Declaration of Independence included the statement that "all men are created equal", which has ultimately inspired actions and legislation against slavery and racial discrimination. Such actions have led to passage of the 13th, 14th, and 15th Amendments to the Constitution of the United States.

The first period extended until the American Civil War and the Reconstruction era, the second period spanned the nadir of American race relations period until the early 20th century, and the last period began with World War II and the civil rights movement, which led to the repeal of racial segregation laws. Racial legislation has been intertwined with immigration laws, which sometimes included specific provisions against particular nationalities or ethnicities, such as the Chinese Exclusion Act and the 1923 United States v. Bhagat Singh Thind case in the US Supreme Court. Race remains an active area of contention with police killings disproportionate to the racial distribution of the US population; whites are under-represented and blacks are over-represented.Paull, John (2019). The Use of Lethal Force by Police in the USA: Mortality Metrics of Race and Disintegration (2015-2019), Journal of Social and Development Sciences. 5 (4): 30-35

Until American Civil War and Reconstruction

Until the American Civil War, slavery was legal. After the American Revolutionary War, the US Congress passed the Naturalization Act of 1790 to provide a way for foreigners to become citizens of the new country. It limited naturalization to aliens who were "free white persons" and thus left out indentured servants, slaves, free African Americans, and later Asians. In addition, many states enforced anti-miscegenation laws (such as Indiana in 1845), which prohibited marriage between whites and non-whites: blacks; mulattoes; and, in some states, Native Americans. After an influx of Chinese immigrants to the West Coast, marriages between whites and Asians were banned in some Western states.

After the Revolutionary War, most northern states abolished slavery, even if a gradually. Congress enacted fugitive slave laws in 1793 and 1850 to provide for the return of slaves who had escaped from a slave state to a free state or territory. Black Codes were adopted by several states, generally to constrain the actions and rights of free people of color, as slaves were controlled by slave law. Although most northern states had abolished slavery, several tried to discourage freedmen from settling in the state. In some states, the Black Codes were incorporated into or required by state constitutions, many of which were rewritten in the 1840s. For instance, Article 13 of Indiana's 1851 constitution stated, "No Negro or Mulatto shall come into, or settle in, the State, after the adoption of this Constitution." Illinois's 1848 constitution led to one of the harshest Black Code systems in the nation before the Civil War. The Illinois Black Code of 1853 completely prohibited black immigration to the state.

Native Americans The Indian Removal Act of 1830 legalized deportation of Native Americans to the West and was passed primarily to extinguish Native American tribal claims to territory in what became known as the Deep South. It effectively allowed the federal government to remove the Five Civilized Tribes to Indian Territory. The Indian Intercourse Act of 1837 created the Indian Territory, now in Kansas and Oklahoma, where the tribes would be resettled. While the tribes retained self-government and territory, their peoples were generally not considered US citizens.

The largest federal establishment of Indian reservations began with the Indian Appropriations Acts in the 1850s. The Dawes Act of 1887 registered members of the so-called Five Civilized Tribes and included the privatization of common holdings of Indians. Blood quantum laws determined membership in Native American groups. Some of the measures were repealed by the 1934 Indian Reorganization Act, which allowed a return to local self-government. Citizenship was not granted to Native Americans until the Indian Citizenship Act of 1924, but two thirds of Native Americans had already become citizens because of other laws.

Abolition of slavery and extension of citizenship In 1857, Dred Scott v. Sandford, a "freedom suit" that was appealed to the US Supreme Court, was settled with the ruling that the US Constitution had not included people of African descent, enslaved or free, and so could not be US citizens and thus had no standing to file freedom suits or other legal cases.

The victory of the North during the Civil War led to the abolition of slavery by the passing of the Thirteenth Amendment and the expansion of the civil rights of African Americans by the adoption of the Fourteenth Amendment. The Fifteenth Amendment prohibited disfranchisement on the basis of race. The Naturalization Act of 1870 allowed people of African descent to become naturalized US citizens.

Census The first census was conducted in 1790 and had three racial categories: free whites, blacks, and all other free peoples. Over time, the categorizations evolved to reflect a more complex understanding of race, but the development of new categories often served a political purpose. Issues such as the true whiteness of Southern European immigrants could not be addressed in the census, but anti-black and anti-Native American sentiment were supported by the racial categorization in the census.

Americans feared that mixed-race citizens would be able to reap the benefits of being white and so instituted laws to prevent that. Mixed-race citizens could legally categorize themselves as white because of their ability to self-report race to the census bureau, the requirement of choosing only one racial category, and the ability of those who were only marginally black to appear white. By 1890, people were required to report any degree of African or Native American ancestry. The idea that a single drop of African or Indian blood qualified someone as officially black or Native American was a generally obeyed legal principle although the so-called one-drop rule was never codified federally. That qualification prevented mixed-race individuals from ever obtaining the benefits of whiteness.

Nadir of American race relations

After the end of the Reconstruction era, southern whites reasserted political and social supremacy with the violence and the discrimination that caused the nadir of American race relations. There were increasing racial violence, lynchings, and attacks to intimidate blacks and to repress their voting in the South. After regaining power in the state legislatures in the 1870s, white Democrats passed legislation to impose electoral requirements that effectively disfranchised black voters. From 1890 to 1910, Southern states ratified constitutional amendments or new constitutions that increased requirements for voter registration, which resulted in disfranchising most blacks and many poor whites (as in Alabama). With political control in what was effectively a one-party system, the South passed Jim Crow laws and instituted racial segregation in public facilities. In 1896, the Supreme Court ruled in favor of the defendants in the Plessy v. Ferguson case, which established the "separate but equal" interpretation for the provision of services. Without the vote, however, black residents in the South found their segregated facilities consistently underfunded and were without recourse in the legal system, as only voters could sit on juries or hold office. Blacks were closed out of the political process in most states. In 1899, Cumming v. Richmond County Board of Education legalized segregation in schools.

Anti-miscegenation laws

Anti-miscegenation laws prohibited marriages of European Americans with Americans of African descent, even those of mixed race. Some states also prohibited marriages across ethnic lines with Native Americans and later Asians. Such laws had been first passed during the Colonial era in several of the Thirteen Colonies, starting with Virginia in 1691. After the American Revolutionary War, several of the newly independent states repealed such laws. However, all slave states and many free states enforced such laws in the Antebellum era.

During Reconstruction, when biracial Republican coalitions controlled the legislatures, several Southern states repealed anti-miscegenation laws. As Democrats returned to power, between 1870 and 1884, legislatures passed anti-miscegenation laws in all the states of the Confederacy to re-establish white supremacy.

Western states that were newly admitted to the Union after the Civil War passed anti-miscegenation laws which were often directed against marriage between Europeans and the increasing Asian immigrant population in addition to prohibiting marriage with blacks and Native Americans. For instance, Utah's marriage law had an anti-miscegenation component passed in 1899. Until it was repealed in 1963, it prohibited marriage between a white and anyone considered a Negro (Black American), mulatto (half black), quadroon (one-quarter black), octoroon (one-eighth black), "Mongolian" (East Asian), or member of the "Malay race" (a historic racial classification that included Filipinos). No restriction was placed on interracial marriages between non-whites.Utah Code, 40-1-2, C. L. 17, §2967 as amended by L. 39, C. 50; L. 41, Ch. 35.

Sundown towns and housing discrimination

In the late 19th century, sundown towns began to post warnings against blacks who stayed overnight. Some passed laws against minorities; others erected signs, such as one posted in the 1930s in Hawthorne, California, which read, "Nigger, Don't Let The Sun Set On YOU In Hawthorne."Laura Wexler, "Darkness on the Edge of Town", The Washington Post, October 23, 2005, p. BW03, Accessed online 9 July 2006 Discrimination was also accomplished through restrictive covenants in residential areas that were agreed to by the community's real estate agents. In others, the policy was enforced by intimidation, including harassment by law enforcement officers.

In addition to the expulsion of African Americans from "sundown towns", Chinese Americans were driven out of some towns. For example, in 1870, ethnic Chinese made up one third of the population of Idaho, where they had worked on railroads and in mines. Following a wave of violence and an 1886 anti-Chinese convention in Boise, almost none remained by 1910.Loewen 2005, Sundown Towns: A Hidden Dimension of American Racism. New Press. (page 51). The town of Gardnerville, Nevada, blew a daily whistle at 6 p.m. to alert Native Americans to leave by sundown.Loewen 2005, page 23 Jewish Americans were excluded from living in some sundown towns.Loewen 2005, page 257.