But there was one glaring exception this year: College-educated voters became a lot more Democratic and non-college educated voters became a lot more Republican.

These patterns were particularly pronounced among white voters. The right-hand side of the Pew Research Center’s graph below shows that college-educated whites were 10 percentage points more Democratic in 2016 than they were in 2012, while non-college whites were 14 percentage points more Republican. The upshot was a historic “diploma divide” in white support for Trump.

There are, of course, several plausible reasons for this growing education gap. No one factor explains everything.

That said, a major factor was racial attitudes. Here is the evidence.

Racial and ethnocentric attitudes were deeply implicated in Donald Trump’s remarkable rise to the White House. Racial resentment, anti-Muslim attitudes, and white identity, were all much stronger predictors of support for Trump in the 2016 primaries than they were for prior Republican nominees.

Donald Trump made racial attitudes more important in the general election, too. I showed earlier that racial resentment, unfavorable opinions of African-Americans and ethnocentrism were significantly stronger predictors of whites’ preferences for Trump or Clinton than they were in hypothetical match-ups between Clinton and Ted Cruz or Marco Rubio.

It turns out that this relationship between education and racial attitudes explains a very large portion of the education gap in white support for Trump. Indeed, the graphs below show that the negative effects of education on white support for Trump vanishes after accounting for attitudes about both African Americans and immigrants.

Graph by Michael Tesler. Numbers at the bottom represent the sample sizes for each education category.

The left-hand graph is based on data from the September wave of RAND’s Presidential Election Panel Survey. The red line shows that whites who did not attend college were about 30 points more likely to support Trump than were whites with a college degree. But after controlling for both racial and immigrant resentment, though, the black line shows that less educated whites were no more likely to support Donald Trump than their better educated counterparts.

The exact same pattern occurred in YouGov’s 2016 Cooperative Campaign Analysis Project. The right-hand graph shows that the 25-point “diploma divide” in Trump support faded away after accounting for the fact that less educated whites tend to have more negative views of African-Americans and immigrants than better educated whites.

In fact, no other factor explained the education gap in white support for Trump as well as racial and ethnocentric attitudes — not partisanship, not ideology, not authoritarianism, not sexism, not income, not economic anxiety.

Simply put, the education divide in white support for Trump is largely a racial attitude gap.

Again, that doesn’t mean that race is the only reason for the education gap in white support for Trump. Factors that aren’t quantifiable in these two surveys — such as anti-elitism and rural resentment — likely contributed to the education gap as well.

Moreover, these same surveys show that education affected support for Trump in the Republican primary even after controlling for racial and immigrant resentment. In the primary, there was clearly more to Trump’s popularity among working-class whites than just race.

Nevertheless, race clearly has a starring role.

And it’s a starring role that began before Trump announced his presidential candidacy. In the next post, I will show that racially resentful whites who did not attend college were moving away from the Democratic Party in response to Barack Obama’s presidency even before Donald Trump burst onto the political scene.