This article extends existing explanations of racial conflict by suggesting how legislation and court rulings instigate processes of legitimation and competitive exclusion, which in turn affect the likelihood of racial violence. We argue that federal legislation and court cases that reinforced the white-nonwhite racial boundary stigmatized nonwhites and prompted whites to attack nonwhites. However, legislation and court rulings that dismantled segregation and eradicated discrimination against racial minorities also instigated racial violence, as whites mobilized efforts to contain competition. A final argument suggests that when legislation successfully restrains competition from a specific population, collective violence against that group will diminish. Using data on collective violence against Asians and African Americans from the 76 largest cities in the U.S. from 1869 through 1924, we find support for these three claims. In particular, we find that while immigration and economic competition raise levels of racial conflict, state policies concerning race also increase the rate of racial violence significantly.