FAIRFAX, VA. — Democrat Ralph Northam has won the Virginia governor’s race, scoring the first big electoral victory of the Donald Trump era by defeating a candidate who ran hard on Trump-like culture war issues.

Northam, Virginia’s lieutenant governor, led former Republican National Committee Chairman Ed Gillespie by 54 percent to 45 percent with 99 percent of precincts reporting. The Associated Press called the race shortly after 8 p.m. ET.

The win is a huge psychic boost for Democrats who had grown nervous heading into Election Day, worried that a rough final week might have given Gillespie a chance — and suggests that his hardline racially charged ads on Hispanic gang violence, sanctuary cities and Confederate monuments had blown up in his face.

“Virginia has spoken — to end the divisiveness, that we will not condone hatred and bigotry, the politics that have torn this country apart. In Virginia it’s going to take a doctor to heal our differences, and I’m here to let you know that the doctor is in,” Northam declared to cheers.

Northam’s win was by a wider margin than Hillary Clinton’s five-point victory in the commonwealth last year, and larger than either of President Obama’s wins in Virginia, a sign both of Virginia’s continuing demographic trend towards Democrats and Trump’s toxic standing in fast-growing suburbs.

The big margin caught even Northam’s allies by surprise — many had expected a narrow win of three to four points and were still trickling into his election night party at George Mason University when the race was called. Many rushed into the room whooping when NBC announced Northam had won.

Northam’s long coattails appeared to be sweeping Democrats in across the state. Democrats swept the statewide races of lieutenant governor and attorney general, and make surprisingly strong pickups in the house of delegates, nearly retaking the chamber with some races still outstanding late Tuesday night. The prospect of winning that many seats was unthinkable heading into election night for even the most optimistic Democrats.

“Virginia showed the world something tonight,” Sen. Tim Kaine (D-VA) said.

“Pitting people against people is not the Virginia way, it’s not the American way,” he continued.

“What it says is people don’t respond to the kind of lowest common denominator approach that too often comes out of this White House and came out of a lot of the [Virginia GOP] candidates this year,” Sen. Mark Warner (D-VA) told reporters.

Republicans admitted they got crushed.

“They won. We lost,” Republican Party of Virginia Chairman John Whitbeck told TPM.

Whitbeck didn’t want to talk national implications, but admitted his party was in a deep hole after the results.

“Six months is an eternity in politics, but boy, we’ve got a lot of work to do in Virginia,” he said. “It’s looking like the urban areas are just a huge problem for us and I don’t know what the answer is yet.”

Josh Holmes, Senate Majority Leader Mitch McConnell’s (R-KY) former chief of staff, was more blunt:

Watch the margins in VA. As they grow, it would be suicidal for GOP not to go to school on what's happening here. — Josh Holmes (@HolmesJosh) November 8, 2017

“It’s pretty unprecedented, what’s happening here,” House of Delegates Democratic Leader David Toscano (D) told reporters shortly after the race was called for Northam.

A minute later, his eyebrows shot up in surprise as looked at a phone alert. Gleefully, he told aides that Kelly Fowler (D) had won a long-shot race — which one staffer repeated in grinning disbelief.

The new state delegates include the first transgender candidate ever to win a statehouse race, Danica Roem, who defeated hardline social conservative Bob Marshall.

“I’m hoping it puts an end to the politics of bigotry,” Virginia Delegate Charniele Herring (D) told TPM about Marshall’s defeat.

Another somewhat surprising winner: Former reporter Chris Hurst (D), whose girlfriend was gunned down on live TV in the state a few years back.

The results are the most concrete sign so far of a building Democratic resurgence in the Trump era. Northam’s margin and coattails — as well as other big Democratic wins Tuesday in New Jersey, New Hampshire, Maine, Georgia and New York — show that Democratic voters are more energized and turning out in stronger numbers across the country right now. That’s a good sign heading into crucial 2018 midterms — and will help Democrats, many of whom spent the last week watching the campaign with increasing trepidation, begin to put their 2016 election PTSD behind them.

“This is pretty nice, I won’t lie,” Robby Mook, the former campaign manager for Hillary Clinton and Virginia Gov. Terry McAuliffe (D), told TPM.

Gillespie, who once pushed the GOP hard to embrace a big-tent philosophy, went hard the other direction in this election — running dark Trump-like ads accusing Northam of being soft on gangs and tying him to a child pornographer in a closing ad. Trump never campaigned for Gillespie in the state but tweeted repeatedly to tout his campaign and recorded a last-minute robocall for Gillespie. The GOP candidate tried to walk a tightrope between Trump-like ads and a moderate-sounding message on the economy and inclusiveness in Northern Virginia.

Trump was quick to distance himself from the results.

Ed Gillespie worked hard but did not embrace me or what I stand for. Don’t forget, Republicans won 4 out of 4 House seats, and with the economy doing record numbers, we will continue to win, even bigger than before! — Donald J. Trump (@realDonaldTrump) November 8, 2017

Other Republicans weren’t so quick to dismiss Trump’s dismal numbers in the state, however — including Virginia resident and former National Republican Senatorial Committee top strategist Brian Walsh.

This is ridiculous but not surprising. Apparently the LG & AG candidates also losing & all the GOP House seats lost tonight have nothing to do his with low poll #s either. https://t.co/srYXJbQaoj — Brian Walsh (@brianjameswalsh) November 8, 2017

Democrats are going to have to compete in much tougher territory than a Democratic-trending state Hillary Clinton won by more than 5 points last fall. But this is a big early sign that the wind is at their backs heading into the 2018 midterms.