FAIRFAX, Va. ― The Democratic Party romped to victories across the country Tuesday, gaining key state legislative seats, two governorships and full control of the state governments of New Jersey and Washington, where they’ll have wide power to enact their agenda.

In one sense, the wins should have been expected: President Donald Trump is extremely unpopular, and the party that holds the White House usually does worse in congressional, state and local elections in years when the president isn’t on the ballot.

And the victories were expected in some cases. In New Jersey, Democrat Phil Murphy, a former Goldman Sachs banker, consistently led in the polls and will now be the next governor. But elsewhere, outcomes were more uncertain.

Many Democratic activists were worried that the party was going to let the Virginia governor’s mansion slip from its grasp. Concern that Lt. Gov. Ralph Northam was failing to excite the base, along with a fear-mongering anti-immigrant campaign run by Republican Ed Gillespie, led to concerns it would be a repeat of the 2016 presidential race.

Win McNamee via Getty Images Democrat Ralph Northam celebrates his victory over Ed Gillespie to be governor of Virginia.

Northam, however, sailed to victory Tuesday, guaranteeing Democrats a seat at the table when state legislative and congressional districts get redrawn in 2020. The party won the races for lieutenant governor and attorney general, too.

The night was validation for the many activists around the country who joined the resistance after Trump’s win and have been feverishly working at the grassroots to mobilize the party’s base. There’s no doubt that the victories will provide a jolt of energy for what’s coming in the 2018 midterm elections.

“Today’s progressive victories in Virginia make one thing clear: A newly awakened grassroots movement is rising up to reject Trump’s politics of hate and reclaim political power,” said Maria Urbina, the political director of the progressive Indivisible movement, which has more than 180 active groups in Virginia.

Democrats also saw the wins as a rejection of the type of nationalism championed by Trump and his former aide, Breitbart News Executive Chairman Steve Bannon, who maintained that a win by Gillespie in Virginia would prove that “Trumpism without Trump can show the way forward.”

“Tonight, the message for Democrats and the country is that fear and division and hatred do not work,” Virginia Gov. Terry McAuliffe (D) said. “They don’t work here in Virginia, and they’re not going to work in Virginia.”

Trump attempted to distance himself from the crushing GOP losses Tuesday night, tweeting from South Korea that Gillespie “worked hard but did not embrace me or what I stand for.”

Almost no one expected Democrats to do as well as they did in the Virginia House of Delegates. Democrats targeted the 17 GOP-held districts where Democratic presidential rival Hillary Clinton defeated Trump. Winning all of the seats would swing control of the chamber, but few thought it was possible. Republicans have controlled the state’s house of delegates for nearly two decades and held a 66-34 majority.

The last time Democrats picked up more than one seat in the body was 2007, when they gained four. Last week, Virginia Democratic National Committeewoman Yasmine Taeb estimated that a pickup of six to eight seats would constitute a “success.”

But by 9:30 p.m., Democrats had already picked up 14 Republican-held seats in the House of Delegates, with eight more in play.

Northern Virginia, a Democratic stronghold, turned only bluer. Voters outside a polling location in Fairfax, which supported Clinton by a two-to-one margin in 2016, cited health care, education and Trump as top issues that drove them to the polls Tuesday.

“It seems like the other guy, Gillespie, he’s being supported by Trump, and [the president] tweeted about him,” Soleyman Ahmed, who voted for Northam, told HuffPost. “Northam seems like he’s a doctor, he’s served in the government, he’s got experience that could help.”

The electoral wave lifted the fortunes of even very left-wing candidates, including Democrat Lee Carter, a member of the Democratic Socialists of America and supporter of single-payer health care. He unseated GOP House Majority Whip Jackson Miller in Northern Virginia’s 50th District. Carter, a former Marine, failed to provide the state Democratic Party with daily updates about his campaign, prompting the party to deny him aid and go silent on his bid. The Washington, D.C., chapter of DSA stepped in to help with canvassing, and on Tuesday Carter won.

In Virginia’s 13th District, outside Fredericksburg, voters ousted Republican Del. Bob Marshall, the author of the state’s bill to ban transgender people from using the bathrooms of their choice, and replaced him with Danica Roem, a transgender woman who ran on a platform of fixing the area’s transit problems.

Virginia Democratic Del. Charniele Herring said Roem’s victory “sends a message to politicians that the politics of bigotry is over. It’s not acceptable to voters.”

CHRIS KEANE / Reuters Chris Hurst, a former TV anchor, beat a Republican incumbent for the 12th District seat in Virginia's House of Delegates.

Chris Hurst, a former Roanoke news anchor whose girlfriend was fatally shot by a colleague on-air in 2015, beat an incumbent Republican in the state’s 12th District, which stretches from Blacksburg, the home of Virginia Tech, to the West Virginia border.

“This isn’t a wave. This is a tsunami,” said David Toscano, the Democratic leader in the Virginia House of Delegates.

This isn’t a wave. This is a tsunami. David Toscano, Democratic leader of the Virginia House of Delegates

The wins in New Jersey, Virginia and Washington, where Democrats won a key Washington state Senate seat — and, with it, control of the only part of the state government they didn’t already run — will have real policy consequences in the short term. Northam will be able to veto Republican legislation in Virginia, and Democratic pickups in the Virginia House of Delegates will give him much more leverage in the legislature. New Jersey, where Murphy ran on promises to legalize marijuana and introduce public banking will be under full Democratic control for the first time in nearly a decade. In Washington, Democratic Gov. Jay Inslee and the Democratic-controlled legislature will have much more freedom to enact their agenda.

The election results will affect lives in other states, too. In Maine, voters approved a ballot measure expanding Medicaid to tens of thousands of people over the objections of Paul LePage, the state’s Republican governor. In New York City, Bill de Blasio — who achieved a longstanding liberal goal of creating a universal pre-kindergarten program — became the first Democratic mayor to win reelection since Ed Koch in 1985.

The big question for Democrats now will be whether they can translate wins in this year’s elections to victories in next year’s congressional midterm elections. The Virginia electorate in 2017 is not the same territory as the battlegrounds Democrats will face next year — for one thing, Trump is more unpopular in the state than he is in the nation as a whole. And, as FiveThirtyEight recently noted, Virginia’s off-year results “haven’t been so predictive” as a barometer of each party’s strength in the following midterm House races.

But what Democrats hope is that the GOP loss in Virginia ― where Gillespie played up the nativist message popularized by Trump ― will make Republicans rethink their strategy.

“I think the appeal to the bad side of human instinct ― which Donald Trump did when he ran, and now Republicans are adopting ― does not serve America well, but won’t serve them well either,” Senate Minority Leader Chuck Schumer (D-N.Y.) told HuffPost on Tuesday, before the results came in.

Next up: A Dec. 12 special election for a U.S. Senate race in deep-red Alabama, where Roy Moore, a controversial-but-Republican judge, is narrowly leading former U.S. attorney Doug Jones, a Democrat, in the polls.

But on Tuesday night, most Democrats were still focused on celebrating their victories, not preparing for the long slog ahead.

The Democrats are like “the field goal kicker who’s missed three kicks in a row,” said Jared Leopold, communications director for the Democratic Governors Association. “Now we’ve made a few, and we’ve got our groove back.”

“Welcome to the bounce-back,” said Paul Kent, an elated union member who attended Northam’s victory party on Tuesday. “People have been waiting for a day like today since Nov. 9. This was the real bellwether. The narrative is we’re coming. There is no apathy.”

Ariel Edwards-Levy and Daniel Marans contributed reporting.

CORRECTION: A previous version of this story misidentified Sen. Chuck Schumer as the Senate majority leader. He is the Senate minority leader.