Donald Trump promised a Brexit-style victory and he achieved just that.

The world woke up today to the shock news that the Republican candidate beat Hillary Clinton, the first female major-party candidate to run for the US presidency. In claiming this victory, Trump stumped the majority of pollsters and political commentators, who expected women to carry Clinton to the White House.

So, what exactly happened? Women did vote overwhelmingly to elect Clinton, but it was white women who helped hand Trump the presidency, according to Edison national election poll. Overall, 54% of women voted for Clinton, much higher than the 42% of women who voted for Trump. But when the women’s vote is divided by race, it becomes clear that black women actually largely drove the so-called gender gap against Trump.

The majority of non-college educated white women (64%) voted for Trump, while 35% backed Clinton. This figure is far higher than non-college educated black women, of which only 3% voted for Trump, and non-college educated Hispanic women, of which 25% voted for Trump. Black, Hispanic and other non-white women backed Clinton in far greater numbers.

Trump’s sexist rhetoric has been well-documented throughout the election; he dismissed a female moderator by suggested she must have had “blood coming out of her wherever,” called for women who have abortions to be punished (then backtracked), bragged about grabbing women “by the pussy”, and was dogged by allegations of sexual assault throughout the campaign. Yet, despite all of this, 45% of college-educated white women voted for Trump.

In comparison, only 28% of college-educated Hispanic women voted Trump, while only 6% of college-educated black women backed Trump.

The exit poll, based on a sample of 24,537 voters at 350 polling places, isn’t perfectly representative. As time passes, voter registration and census files will provide a more accurate picture of how Americans voted. Earlier this year, a New York Times analysis found that recent exit polls had overstated demographic shifts and that the electorate was whiter than expected.

In the end, it’s his white base that most benefited Trump. His most enthusiastic supporters were white men across the board, with 54% of college educated white men and 72% non-college educated white men backing him. These white men and women voted like a minority group, according to one electoral analyst, coalescing on a mission to put him in the White House.