Hillary Clinton’s 5-point victory in Virginia in the 2016 presidential election was enough to win the state’s electoral votes but wasn’t enough to declare it solidly blue. Barack Obama had won the state by a wider margin in 2008 — in an election that he won by a much wider margin nationally, certainly, but since 2008, the demographics of the state seemed like they had moved dramatically in the Democratic Party’s direction. So Republicans would be excused for thinking that the 2017 gubernatorial race in the state, held during an off year when consistently voting Republicans tended to be overrepresented in the voter pool, was an opportunity.

On Monday at this time, it seemed like the race was still within the GOP’s grasp. On Wednesday morning, we know just how far outside its grasp the governor’s mansion actually was.

Democrat Ralph Northam got more votes than any other candidate in the history of gubernatorial races in the state, by a quarter-million votes. Part of that dominance was a function of the growing population in the state; more people means more votes in general. But it’s also in part a function of massive turnout. In 2013, about 2.2 million people voted in the governor’s race. In 2017, 2.6 million did. Republican Ed Gillespie got more votes than any past candidate, too — it just didn’t do him any good. Northam got a larger percentage of the vote than any Democrat since 1985.

In the wake of Northam’s victory, President Trump argued on Twitter that Gillespie should have embraced his party’s president more closely. But it’s not clear that would have helped.

For one thing, a third of voters who came to the polls said that part of their reason for voting was to send a message of opposition to Trump. For another, most Virginians view Trump’s job performance negatively, and they overwhelmingly backed Northam. But comparing 2016 exit polling to preliminary exit polling from the Virginia gubernatorial race, we see swings that suggest Gillespie’s ties to Trump were already a disadvantage.

Here’s the change in support and turnout for various demographic groups between last November and Tuesday. Those groups that saw big shifts in either how they voted or how much of the electorate they made up are highlighted.

Notice the bottom-right corner. Both conservatives and Republicans supported Gillespie by wider margins than they did Trump in 2016. As a percentage of the electorate, each group declined from last November, but not by very much.

In the D.C. suburbs, there was a big increase in the density of the vote relative to last year. (More on this below.) Northam also did much better with most demographic groups than did Clinton, including massive gains with married men, late deciders, those with middle incomes, young people and non-married women. Northam did 5 points better with college graduates than Clinton on net, and 6 points better with white men with college degrees. He did 10 points better with white women with college degrees.

As a result, Northam did better across the state than did Clinton. (The circles on the graph below indicate the number of votes cast in the county or city on Tuesday.)

In the D.C. suburbs, Northam generally did far better than Clinton. He did slightly worse than Clinton in Fairfax County — but he still won it by more than 30 points. In Loundon County, where more than 110,000 votes were cast, he won by 20 points. In the past two decades, no Democratic gubernatorial candidate had won it by more than 6 points.

In the rural counties out west, Northam outperformed Clinton, but Gillespie still won them easily. Unfortunately for him, there just aren’t that many votes there. Northam also did well in the southeastern part of the state, where he’s from.

The picture, then, isn’t terribly complicated. Northam wasn’t Clinton, which was certainly to his benefit. 2016 exit polls showed that only 46 percent of voters viewed Clinton favorably; in mid-October, 63 percent of those with an opinion of Northam had a favorable view of him, according to Quinnipiac polling. Eighty percent of those who viewed Trump negatively last year voted for Clinton. On Tuesday, 87 percent of those who disapproved of Trump’s job performance voted for Northam.

Gillespie also wasn’t sufficiently not Trump. The surge in the D.C. suburbs was almost certainly driven to some extent by frustration with the president. Gillespie, a more moderate Republican, was expected to do better there than did Trump. Instead, he did worse.

There were a lot of reasons to think that Northam would win, including that polling suggested it was possible. But the extent of his victory, powered by strong turnout and improvements over Clinton nearly across the board, suggests that something more was at play. More than 2 million Virginia voters came out in the rain to vote for Northam and to erase the Republican majority in the House of Delegates. Exit polling suggests that Trump was more of a factor in that than he’d like to admit.