Editor’s note: This piece is based on unofficial 2017 election returns.

Tuesday represented the best non-presidential election night Democrats have had since 2006. They swept the statewide ticket in Virginia for the second election in a row, and they picked up the New Jersey governorship. They also won a crucial, majority-making state Senate election in Washington state, so they won complete control of state government in two states (New Jersey and Washington).

Ever since the June primary, we thought Gov.-elect Ralph Northam (D) had a small edge in the Virginia gubernatorial race, which is why we rated it as Leans Democratic for the whole general election period even as Northam hit some seeming rough patches. But the size of his victory — nine points — was notable, and his ticket-mates, Attorney General Mark Herring (D) and Lt. Gov.-elect Justin Fairfax (D), won by smaller but still decisive margins.

But the big shock to us, and to anyone who is honest about their pre-election expectations, was the Democrats winning what could be a 50-50 tie in the Virginia House of Delegates. Democrats went into the election at a 66-34 deficit in the House, and while they were expected to win seats, the low double digits seemed like the absolute max. Instead they are on track to net 15 or more seats, with a chance of getting to a 50-50 split or even taking a slim majority (the canvass is ongoing and recounts loom in a few seats).

Democrats generally performed quite well across the country — it’s hard to find any silver linings for Republicans, although we’ll endeavor to do so (see the caveats section below).

There’s a single factor that links all of this: Donald Trump. This was a rebuke to the president and Trumpism generally.

Virginia polls were once again collectively off in this election — Northam was up by about three points in the RealClearPolitics average, and he won by nine — but this time instead of the Republican candidate outrunning his polling, as Republican Ken Cuccinelli did in 2013’s gubernatorial race and 2017 GOP gubernatorial nominee Ed Gillespie did in Virginia’s 2014 Senate race, the Democrat, Northam, beat his numbers instead. In fact, the poll average basically nailed Gillespie’s 45% share of the vote, but underestimated Northam’s share by half a dozen points. Undecideds may still be breaking away from the White House, it’s just that now they are breaking toward Democrats, not Republicans. In the exit poll, Northam won voters who said they decided in the last week, about a fifth of the electorate, by 24 points; he had a more modest lead of seven points among the larger universe of earlier deciders. And this was at a point when many thought he was kicking the race away (more on that below, too).

The political dynamics we got used to during Barack Obama’s presidency — polls underestimating Republicans, Democrats getting crushed in off-year elections — showed signs of a reversal on Tuesday. That all makes sense given what we know about off-year elections: The White House party often suffers, particularly when the Oval Office occupant is unpopular, as Trump is. Anger is a great political motivator, and anger animates the Democrats now, just like it agitated Republicans to action in the Obama years. That the Republican-run White House and Congress has largely failed on its big-picture promises so far surely isn’t helping the GOP overcome that intensity gap. And this was an intensity surge for Democrats more than it was a falloff for Republicans: while it’s not exactly an apples-to-apples comparison because there was a bigger third party vote in 2013, Gillespie got about 160,000 more votes than Cuccinelli did four years ago. But Northam got 335,000 more votes than outgoing Gov. Terry McAuliffe (D).

Last week, we asked five questions about what the results would tell us. Answering these questions will help us flesh out the story of what happened last night:

1. Will Ed Gillespie buck the typical anti-White House party pattern in Virginia?

No, he couldn’t. Republican gubernatorial nominee Ed Gillespie continued a trend in the modern era of two-party competition in Virginia state politics (starting in 1969) of the presidential party’s gubernatorial candidate running behind his party’s two-party presidential margin. Trump won 47.2% of the two-party vote in Virginia, and Gillespie won only 45.5%. The Old Dominion’s gubernatorial race is always one of the first big statewide races held after a presidential election, and it can be a nationalized race that serves as a referendum on the man on the other side of the Potomac. Clearly 2017 was that kind of election.

2. Will Phil Murphy outrun Hillary Clinton?

Not quite. Clinton won New Jersey by 14 points, and it appears as though Gov.-elect Phil Murphy (D) will come up just slightly short of that margin (which as of this writing is a little over 13). That’s still a solid victory, although it did not represent the kind of surge we saw in Virginia. Part of that may be the fact that the New Jersey race was much sleepier than Virginia’s contest: Murphy always led polls over Lt. Gov. Kim Guadagno (R) by double digits, and voters responded by turning out in about the same numbers (around 2.1 million votes as of publishing) as the uncompetitive 2013 contest in the Garden State. Whereas the total votes in the 2017 Virginia race fell by only a third from the 2016 presidential tally, the total votes in New Jersey shrank by almost half.

Unrelated to Murphy’s win, there was another big political development in the Garden State on Tuesday: Long-serving Rep. Frank LoBiondo (R, NJ-2) announced he would not run for another term. LoBiondo held down this swing seat with ease for more than two decades, but it should be much more competitive as an open seat: We immediately moved the race all the way from Safe Republican to Toss-up. However, Trump won this seat by about 4.5 points, a big improvement on a comfortable eight-point win for Obama there in 2012. Will such districts swing back to Democrats? There is some evidence that they could based on legislative election results from races this year, although the Virginia House of Delegates sweep came in bluer ground. Speaking of…

3. How will state legislative performance compare to last year’s presidential results?

The Democratic gains in the Virginia House of Delegates were nothing short of extraordinary. Even the most bullish Democrats would have been thrilled with a low double-digit gain. As of this writing, a 51-49 GOP edge or a 50-50 split seem like the likeliest outcomes (if it is 50-50, the two parties will have to come up with a power-sharing agreement. The state Senate, where all 40 seats are up in 2019, features a slim 21-19 GOP majority).

However, this was also a gain that was almost entirely predicated on winning seats Hillary Clinton carried last year. Republicans went into the election holding 17 House seats that Clinton had carried, and it looks like they will lose at least 14 of them (additionally, a Republican incumbent holds a 12-vote lead in Clinton-won HD-94, so expect a recount there). The Virginia situation was unusual because Republicans drew themselves this map at the start of the decade not thinking that some of these seats that lean blue in presidential elections could be competitive with lower off-year turnout. Six years after these maps were first used in state legislative elections, it seems they were mistaken; if the GOP had been a little less selfish in redistricting several years ago and had drawn a few extra safe Democratic seats, they might not have been so overextended in this election.

We also have been keeping tabs on special legislative election results across the country to see if a recent pattern of Democratic overperformance in such races would persist. There were 18 such races featuring two-party competition at the state level, and also a special congressional election in UT-3, where Rep.-elect John Curtis (R) won easily. Still, Democrats flipped party control in three of the 18 state legislative specials (Republicans didn’t flip any), and they ran ahead of Hillary Clinton’s presidential margin in nine of the 19 based on the most recent results (that is, the 18 state legislative specials and the UT-3 House special). That last point is a big caveat — five of the 19 specials were in Washington state, where there is vote by mail and results take a long time to finalize. The Democrats are running behind Clinton’s margin in all five districts, including the aforementioned 45th District Senate race they carried to win total control of Washington state government, but the margins may change. As it stands now, Tuesday’s special election results slightly eroded the Democrats’ average gain on Clinton’s margin in the specials featuring two-party competition so far — the average gain is about nine points, and the median is about 10 (the numbers are about the same in the two-party vote). And also keep in mind that four of the five Washington state races featured appointed incumbents, so they were not exactly open seats like the other races.

In Georgia, Democrats also picked up an additional two races not listed here because they won them in the first round, all-party primary. A Democrat carried HD-119 w/ 57% of the vote, thus avoiding a runoff, and in SD-6, two Democrats advanced to the runoff thanks in large part to a larger field of GOP opponents.

In the regular elections in New Jersey (where all 40 state Senate and 80 General Assembly seats were up for election) and in Virginia (where all 100 House of Delegates races were up), Democrats made only modest gains on Clinton’s performance on average in New Jersey and actually ran slightly behind in Virginia.

In New Jersey, 37 of 40 state Senate seats featured two-party competition, and nearly every seat featured an incumbent (so these are different than most of the special elections). On average, the Democratic margin was 3.5 points better than Clinton’s margin (with a median of 3.8 points), and they ran ahead of Clinton’s two-party margin in 25 of the 37 seats. So there was a small pro-Democratic shift in New Jersey, but not on par with the specials in other states. (We’re leaving the analysis of the New Jersey General Assembly performance for another day — two members are elected from each district there).

In Virginia, 60 of the 100 House of Delegates races had both a Democrat and a Republican, and 54 of those contests featured an incumbent. On average, the Democratic margin in those races was actually 1.1 points worse than Clinton’s two-party margin, and Democrats ran behind Clinton in 37 of the 60 races. And Democrats ran behind Clinton in 11 of the 15 seats that they appear set to win, with some races still uncertain. Many districts were fairly Democratic-leaning, though, because Democrats still managed to win that many seats while running behind Clinton.

However, the Democratic down-ballot performance in New Jersey and Virginia was predictably a lot better than it was in 2013, when their candidates ran well behind Obama’s 2012 showing in both states on average (Sean Trende wrote about this in 2013 for RealClearPolitics).

4. How much variation will there be in the Virginia’s three statewide races?

This was, for the most part, a straight-ticket kind of election, Northam did the best, winning by about nine points, but Herring (6.7 points) and Fairfax (5.4) were not that far behind. Calculating based on the two-party vote, the standard deviation of the Democratic ticket was just 0.8 percentage points in performance, the lowest standard deviation for any race going back to 1969, as displayed in Table 1. That is, there was very little variation in the performance of both parties’ tickets on Nov. 7, relatively unsurprising given the high rates of straight-ticket voting in our highly polarized political environment.

Table 1: Two-party election results for Virginia’s three statewide offices and variation in performance, 1969-2017

Notes: ^Indicates that while there was technically no Democratic nominee for governor in 1973, then-Lt. Gov. Henry Howell (I) had previously been a Democratic state senator and the Democratic State Central Committee “commended” Howell to the voters in his election against former Gov. Mills Godwin (R), a former Democrat. 2017 results are unofficial.

Source: Virginia Department of Elections

The one marginal surprise was that it was Northam, not the incumbent Herring, who led the ticket. Regardless, all three statewide Democrats turned in strong performances. Presumably, Herring is next in line to run for governor in four years, and he did defer to Northam this time by opting to run for reelection (Virginia, alone among the states, does not allow governors to seek reelection). However, just because Herring may be next up, another candidate could decide to crash the party, as former Rep. Tom Perriello (D) attempted to do in the Democratic primary against Northam and Cuccinelli successfully pulled off against then-Lt. Gov. Bill Bolling (R) for the 2013 GOP nomination (Bolling had deferred to then-Attorney General Bob McDonnell in 2009 and then got pushed out of the race by Cuccinelli in 2013). Moreover, as the Cuccinelli and Bolling example shows, a potential future intraparty clash between Herring and Fairfax for the top job also can’t be written off.

5. What are some Virginia trends to watch out for on Election Night?

We speculated last week about what changes we could see from previous elections. Here’s what happened, comparing the two-party vote margin in 2017 to both the last gubernatorial race, in 2013, and last year’s presidential race.

Map 1: Change in two-party vote margin by Virginia locality, 2017 gubernatorial election compared to the 2016 presidential election

Source: Virginia Department of Elections. 2017 results are unofficial.

Map 1 shows the change in two-party vote margin from 2016 to 2017. Interestingly, Northam actually performed slightly worse than Clinton in much of Northern Virginia and in the city of Richmond by that measure (though he did do better than Clinton in raw percentage in those places — there was a larger third-party vote in 2016). It is worth noting that while Northam’s two-party margin wasn’t quite at Clinton’s level in places like Fairfax County (Clinton won it by 38.5 points, Northam by 36.7), Northam actually outperformed Clinton’s two-party margin in the Urban Crescent — the three major metro areas of Northern Virginia, Greater Richmond, and Hampton Roads. Meanwhile, Gillespie wasn’t able to win many parts of rural Virginia by quite as much as Trump in the two-party vote, as indicated by the blue shading in much of the western part of the state. Northam also improved on Clinton in Hampton Roads, his home base in the southeastern part of the state.

While Map 1 shows some changes, it masks the large shifts that have taken place in just a short time in Virginia. Map 2 shows just how much things changed between the 2013 and 2017 gubernatorial contests.

Map 2: Change in two-party vote margin by Virginia locality, 2017 gubernatorial election compared to the 2013 gubernatorial election

Source: Virginia Department of Elections. 2017 results are unofficial.

Northam won most parts of the Urban Crescent by larger margins in the two-party vote than McAuliffe, in some cases — such as Loudoun County in Northern Virginia (Northam by 20 points, McAuliffe by five) — far larger ones. In the meantime, parts of Southwest Virginia and Southside shifted more toward the GOP.

A couple of caveats

The silver lining for Republicans in Tuesday night’s results is that Gillespie actually improved on his own showing in his 2014 Senate challenge to Sen. Mark Warner (D-VA) and Cuccinelli’s 2013 performance in western Virginia, a red-trending area (as noted above). Gillespie didn’t quite match Trump there, though, but remember that Democrats have to defend a lot of turf in dark red areas, such as Sen. Joe Manchin’s (D) Senate seat in West Virginia, the only state that is classified 100% Appalachian by the federal government and a state Trump won by 42 points. Manchin will have incumbency in his favor, but it is possible that he and other red state Senate Democrats could fall to Republicans even in a great Democratic national environment because of the way that places like Appalachia are changing. Many parts of the United States look like Appalachian western Virginia — rural, white, blue collar, and supportive of Trump.

Virginia Democrats were able to make huge gains in the state House of Delegates by effectively winning only Clinton-won seats (they only won a single Trump-won seat, and it was a marginal one at that). Democrats cannot get to a House of Representatives majority exclusively through Clinton-won seats. They need to net 24 seats next year to win the House, and there are only 23 Republicans in Clinton-won seats. It’s also impractical to think Democrats could flip all 23 of these seats: Many of them are held by skilled incumbents. So Democrats will need to win some Trump-won territory to capture the House — the median U.S. House seat, the 218th most Democrats and Republican seat by presidential performance, is Rep. Scott Taylor’s (D, VA-2) Hampton Roads-based district, which Trump won by 3.4 points, which makes it more than five points more Democratic than the nation (because Clinton won the national popular vote by about 2.1 points). This is a long way of saying that the national House playing field is more Republican-leaning, at least on paper, than the Virginia House of Delegates slate was. So, as we usually advise, don’t overinterpret and overproject these results, impressive though they are for the Democrats.

Conclusion

While the Democratic wave in the Old Dominion and elsewhere was bigger than we and many others expected, there’s a key point to remember: The results made sense, historically. As we’ve been noting throughout the year, a party traditionally pays a price in off-year elections for holding the White House. That’s a trend we’ve seen throughout history, and vividly so in the three most recent midterms: 2006, 2010, and 2014. That effect is exacerbated by an unpopular president, and Donald Trump’s approval rating is under 40%.

In other words, the old laws of politics seem to still apply — even, or perhaps especially, in a world with Donald Trump as president.

The midterm is a year away, and we wouldn’t make any predictions so far in advance. But if Trump’s approval remains poor, and Democrats maintain a lead on the House generic ballot in the high single digits or more, as many polls now indicate, the Republican majority in the U.S. House of Representatives is in serious jeopardy, and Democrats should also be able to pick up several governorships and many state legislative seats. Only the lopsided Democratic disadvantage on next year’s Senate map could prevent Democrats from gaining ground in the upper chamber as well.

So the Republicans have a lot of work to do to prevent Election Night 2018 from looking a lot like Election Night 2017.

One final thought, on the campaign by the Commonwealth’s new governor-elect, Ralph Northam and his opponent, Ed Gillespie.

On one hand, Northam’s chances of victory looked shaky before both the primary and the general election, and yet he clearly outperformed the polls in both races and ended up turning in dominant performances. That is a tribute to him and his team.

However: We have been hearing complaints for months from Democrats about Northam’s campaign, and we do think he allowed Gillespie to dictate the terms of the race down the stretch. Gillespie’s campaign was more aggressive, and Northam did make mistakes: For instance, he got totally spun around by the question of sanctuary cities last week and throughout the campaign. Gillespie clearly wanted to make this race about social issues like Confederate statues, illegal immigration, and felon voting rights. Now, it’s possible that Gillespie went overboard on these attacks and that he generated blowback in the urban areas and suburbs that powered Northam. Indeed, the pollster Latino Decisions argued exactly that on Wednesday: “Voters were very aware that the campaign had become heavily racialized and this moved them away from Gillespie and towards Northam,” according to the group’s Matt Barreto.

Whatever their ultimate effect, Gillespie’s preferred issues — racially-charged ones, to be sure — did dominate the final weeks of the race, and Democrats were worried sick that Northam would lose. Trust us: They had no idea his win would be by so much and that the party would make such huge gains in the Virginia House of Delegates.

So: Is it possible Gillespie did in fact run the tighter campaign, but that it didn’t matter because Democrats are so much more energized in the Time of Trump than Republicans are?

This is an impossible thing to prove, and the question of who ran the more effective campaign is an inherently subjective one. Given how Gillespie finished, one could just as easily say he ran a bad campaign. After all, the results are what they are: Northam and the Democrats romped.

But if you’re a Republican, isn’t it disconcerting to consider that Gillespie may have run the more skillful race and been the more skillful candidate — and still was beaten decisively?

There are only so many things a candidate can control in a bad environment, as Democrats learned over and over in the Obama years. Now Virginia Republicans know what it feels like — and Republicans in other places might find out, too.