I came of age in a Jersey shore community with high racial tension. A major road divided the town, and separated black homes from white homes. But we all met in the integrated schools, and that’s where I witnessed racial discrimination first-hand.

I vividly remember this one incident from eighth grade. Word spread one morning through the corridors that there would be a fight in the boys’ lavatory in the afternoon, between a black boy and a white boy. This was not uncommon, and we all crowded around to witness the event, but in the end hardly a punch got thrown. Our eighth grade English teacher had gotten wind of the coming fight, and immediately broke it up. He marched both boys to the principal’s office.

So the fight was not memorable, but the consequences were. By the end of the school day, the white boy was back in class, doing his lessons, with just a verbal reprimand. The black boy was suspended and sent home for two weeks.

I knew both these boys equally well, and I recall feeling embarrassed by the unfairness of the principal’s discipline. There was no aggressor or victim here, yet they were treated unequally. What I didn’t know at the time was how common such disparities were in the nation’s schools—and in fact still are. According to the U.S. Office for Civil Rights, black students are more than three times as likely as white students to be suspended or expelled from school. These racial disparities in discipline can have a cascading effect, contributing to the racial achievement gap and increasing the likelihood that black students will drop out of school—and later end up in prison.

Surprisingly, there has been little scientific study of the psychological processes underlying this discipline gap. What was going on in the minds of my teacher and principal that they could justify such uneven punishment?

Stanford University psychological scientist Jennifer Eberhardt has been trying to probe the prejudiced mind. Working with graduate student Jason Okonofua, she has been exploring how student race might influence teachers’ responses to classroom infractions. Specifically, they wanted to see if racial stereotypes make it more likely that teachers will detect a disturbing pattern of misbehavior among black students—but not white students—a perception that in turn leads to harsher discipline.

Here’s how they studied this idea. Since students are most commonly sent to the principal’s office for minor infractions like class disruption and insubordination, Eberhardt and Okonofua decided to study the influence of race on teachers’ responses to such minor misbehavior. They recruited experienced K-12 teachers from around the country, and showed them the school records of students who had violated school rules twice. In some cases, the teachers learned that the student’s name was Darnell or Deshawn, while in others they student was named Greg or Jake. These stereotypical black and white names were meant to suggest the students’ race. The teachers read about the students’ two infractions, and after each one they answered some questions: How severe was the student’s behavior? How irritated do you feel by the student? How severely should he be punished? How likely is it that the student is “a troublemaker?”

The findings were clear and troubling. When the student was white, the teachers felt no more troubled by the second incident than they were by the first. But if the student in question was black, the second infraction made a difference; the teachers felt more troubled by the second infraction, even though it was not serious. What’s more, teachers were much more likely to label black students as troublemakers, and—most disturbing—teachers thought that the black students (but not the white students) should be disciplined more severely following a second infraction.

Think about this. Racial disparities in discipline emerged after a mere two incidents, both of them minor. That is, in the teachers’ minds, two infractions constituted a pattern of troublemaking that called for disciplinary action—but only for the black students.

Eberhardt and Okonofua wanted to explore this pattern perception as a possible explanation for the discipline gap. They also wanted to focus in more on school suspension, a severe form of discipline. So they ran another study that used the same basic procedure as before, but this time they asked the teachers directly whether they saw the two incidents as part of a pattern. They also asked them how likely it was that they would suspend the student at some point down the road.

The results, described in a forthcoming issue of the journal Psychological Science, confirmed the scientists’ suspicions. Black students’ misbehavior was much more likely to be seen as part of a larger pattern. In other words, black students’ infractions are not only treated as more extreme than identical infractions by white students; they are also viewed as connected, one leading to another. And finally, although both infractions were minor, they were enough for teachers to predict school suspension in the future. But again, only for the black students.

Follow Wray Herbert’s reporting on psychological science in The Huffington Post and on Twitter at @wrayherbert.