Barack Obama spent his first year as president reaching out to Americans who hadn’t voted for him. Donald Trump spent his first year attacking and antagonizing everyone outside of his base. The difference showed up starkly in Virginia on Tuesday. Trump destroyed the Republican gubernatorial nominee, Ed Gillespie, by delivering hundreds of thousands votes to the Democrat, Ralph Northam.

Going into the election, Democrats worried that Trump might bolster turnout for Gillespie, who seemed to be making a late surge as he echoed Trump’s talking points. But in the end, Trump produced many more votes against Gillespie than for him. Gillespie received more votes than Bob McDonnell, the GOP’s victorious 2009 nominee for governor. What buried Gillespie was a 70 percent increase, nearly 600,000 ballots, in votes for the Democratic nominee.*

That’s a shocking number. Many factors could account for it, but the biggest is Trump.

Media exit polls weren’t conducted in Virginia’s 2001 and 2005 elections, when George W. Bush was president. So the best election we can use for comparison is 2009—when Obama, like Trump, had been in office for nearly a year. Obama had won Virginia the year before, but the voters who came out for the governor’s race were relatively conservative. In the 2009 exit poll, 51 percent of respondents said they had voted for Sen. John McCain for president in 2008; only 43 percent said they had voted for Obama. McDonnell trounced the Democratic gubernatorial nominee, Creigh Deeds, 59 percent to 41 percent. But Obama failed to give Republicans anything like the boost Trump has given to Democrats.

In 2009, 31 percent of Virginia voters said they strongly approved of Obama’s performance as president. This year, only 22 percent of Virginia voters said they strongly approved of Trump’s performance. When you take into account how these people voted, the baseline of strong Obama approvers who voted for Deeds was 7 percentage points higher, as a share of the total electorate, than the baseline of strong Trump approvers who voted for Gillespie. So Gillespie, thanks to Trump, started out with a relatively weak base.

Trump also lined up nearly half of the electorate against Gillespie. On Tuesday, 47 percent of Virginia voters said they strongly disapproved of Trump. That’s 12 percentage points higher than the percentage of Virginia voters who said in 2009 that they strongly disapproved of Obama. It translated, almost ballot for ballot, into a wave of strong Trump disapprovers voting for Northam, far in excess of the anti-Obama wave eight years ago.

In both years, exit pollsters asked voters whether “one reason for your vote for governor” was to express support or opposition for the incumbent president. The number who said they were voting to express support for the president came out the same, at 17 percent. But the level of opposition rose significantly. In 2009, only 24 percent of Virginia voters said they were voting to express opposition to Obama. This year, 34 percent said they were voting to express opposition to Trump.

To appreciate the magnitude of this shift, you have to consider how it affected the overall tally. Given the enormous surge in turnout between 2009 and 2017, Trump actually supplied more votes to Gillespie than Obama supplied to Deeds: slightly more than 400,000, compared to 300,000. So Trump’s benefit to his party, in terms of gross turnout, was about 100,000 votes better than Obama’s.

But this was dwarfed by Trump’s cost. In 2009, roughly 460,000 Virginians voted for McDonnell in part to express opposition to Obama. In 2017, roughly 860,000 voted for Northam in part to express opposition to Trump. That’s a difference of 400,000 ballots.

Subtract Trump’s 400,000-vote boost for Northam from his 100,000-vote boost for Gillespie, and you get a net loss of 300,000 for Republicans. That’s what Trump cost the GOP, above and beyond what Obama cost the Democrats. This 300,000-vote difference exceeded Northam’s margin over Gillespie. It was decisive.

The Trump–Obama gap can’t be dismissed as a product of Virginia becoming more liberal. Moderates accounted for the same percentage of ballots in both years—42 percent—but they shifted their votes dramatically. In 2009, they voted for Deeds, the nominee of the president’s party, 53 percent to 47 percent. This year, they went for Northam, the nominee of the opposition party, 64 percent to 33 percent. Moderates cast 340,000 more ballots for Northam than for Gillespie. If Trump’s candidate had done as well with moderates as Obama’s did, the GOP would have won.

The upshot isn’t just that Trump cost his party this election. It’s that he did it by behaving in a particularly incendiary way. Obama, too, hurt his party’s nominee in Virginia. But that degree of damage, commonly suffered by the gubernatorial nominee of the president’s party, wouldn’t have been enough to sink Gillespie. To kill him, Trump had to drive an extra 300,000–500,000 voters to the polls. And he did.

*Correction, Nov. 9, 2017: The article originally mischaracterized the increase in votes for the Democratic nominee between 2009 and 2017 as 700 percent. It was 70 percent. (Return.)