The reasons behind the vast racial disparities in student discipline have plagued educators for years, but researchers from Stanford figured out how to design a study that laid bare the basic racism and racial stereotyping that controls the thoughts and behaviors of many white teachers.

The Stanford researchers, psychology professor Jennifer Eberhardt and Stanford psychology graduate student Jason Okonofua, were motivated by data showing that Black students in the U.S. were over three times more likely than white students to be suspended or expelled.

So they came up with a clever design that would demonstrate how teachers respond to Black students. The results were published in the journal Psychological Science in a study called “Two Strikes: Race and the Disciplining of Young Students.”

The researchers presented primary and high school teachers with school records describing two instances of misbehavior by a student. In the first study, the teachers were then asked questions about each infraction: how bad it was, how irritated it would make them feel, how severely the student should be punished, whether they viewed the student as a troublemaker.

In the second study, the teachers were asked whether they thought the misbehavior was part of a pattern and whether they could imagine themselves suspending the student in the future.

But here’s the catch: the researchers gave some of the students hypothetical names that sounded Black (such as DeShawn or Darnell) and others got names that sounded white (such as Greg or Jake).

It was after the second infraction that the researchers found that racial stereotypes went to work. Teachers were more troubled by a second infraction if they were led to believe it was committed by a Black student than if they thought it was committed by a white student.

They were more likely to see the Black students as troublemakers, more likely to want to discipline them more harshly, more likely to see the misbehavior as part of a pattern, and more likely to imagine themselves suspending that student in the future.

“We see that stereotypes not only can be used to allow people to interpret a specific behavior in isolation, but also stereotypes can heighten our sensitivity to behavioral patterns across time. This pattern sensitivity is especially relevant in the schooling context,” said Eberhardt, a 2014 recipient of the prestigious $625,000 MacArthur “genius” grant for her probing work on race.

Okonofua said he could easily see the implications of the findings beyond a school setting.

“Most social relationships entail repeated encounters,” he said. “Interactions between police officers and civilians, between employers and employees, between prison guards and prisoners all may be subject to the sort of stereotype escalation effect we have identified in our research.”

The researchers suggested it would be enormously helpful to hold interventions with teachers to show them that they needed to view student behavior as malleable, rather than as a permanent state, such as labeling a student a “troublemaker.”