FAIRFAX, Va.—The commonwealth’s soon-to-be 73rd governor, Ralph Northam, was buoyant as he took the stage in a crowded ballroom in George Mason University’s student center Tuesday night.

Hours earlier, Northam, the placid lieutenant governor with a southern twang, had beaten former RNC Chair Ed Gillespie. And not in a squeaker that many had expected. The margin of victory was trending towards nearly nine percentage points— a stunning victory for Democrats but, perhaps, an even more stunning rebuke for President Donald Trump.

"It's going to take a doctor to heal our differences and I'm here to tell you that the doctor is in," Northam said before devoting his speech to a message of unity after a contentious and ugly race. The country, he added, is “getting more diverse every day and it’s that diversity that makes this country great.”

Northam is, in many respects, the antithesis of the president. He is a physician and veteran, known best for his ho-hum demeanor on the trail and, secondarily, for his service in government. He is not a populist, though he embraced a liberal platform. More than anything else, he’s far from flashy.

Down the final stretch, this style led many to speculate that Northam would ultimate stumble. Democrats were increasingly worried that he had not been tough enough on Trump, had failed to adequately explain his position on immigration policy, and was leaving voters otherwise uninspired.

Those fears were stoked in part by a controversial ad that many believed would backfire—a spot run by the Latino Victory Fund that depicted a confederate flag bearing Gillespie supporter chasing down immigrants in his pickup truck. But they also were derived from the perpetual paranoia and internal griping that has gripped Democrats since the 2016 election, which was kicked off once again last week by former Democratic National Committee Chair Donna Brazile, who suggested that the 2016 primary was rigged in Hillary Clinton’s favor.

“If Gillespie were to pull off an upset there, it would basically ensure that Republicans would spend the next year running Trump-style campaigns that give in to race baiting because they will be convinced it is a successful strategy in the Trump era,” former Clinton spokesman Brian Fallon told The Daily Beast last week in urging Democrats to not “lose sight of the bigger picture.”

In the end, Northam overcame these hurdles. His approach proved wiser than his detractors had predicted. But his victory was also owed, in part, to the toxicity of Trump among Virginia’s voters. It wasn’t just the governor’s race, after all, that went in the Democratic direction Tuesday. The party also appeared close to an unthinkable flipping of control of the House of Delegates in the state. And operatives and observers spoke excitedly about a “wave” throughout the night, scrolling through their phones and giddily predicting a potential bloodbath for Republicans in next year’s midterm elections.

Even before the race was called, current governor Terry McAuliffe was bullish on his fellow Democrat’s odds, stalking the tiled floors of the ballroom. He told reporters that the election would be a “rejection of Donald Trump” as well as “a rejection of Eddie Gillespie and their bigoted campaign.”

“We are rejecting that tonight, that is the message we are sending the country,” McAuliffe said.

Even McAuliffe, however, could not have predicted the evening ahead. The race was called so early that the ballroom was nowhere near full by the time CNN made its projection. A few streams of confetti hung in the air as the sparse crowd realized what had happened.

Tom Perriello, Northam’s former primary opponent bounded jovially into the room, corralling a circle of reporters around him and barely suppressing a mile-wide grin.

“When Gillespie decided to run on the Trump agenda, that was certainly something where Virginians had soundly rejected Trump last year, they rejected that kind of racially divisive politics this year. And it was also about a positive agenda for the Democrats,” Perriello told reporters at the victory party.

As he got updates about delegate leads in unexpected places, Perriello was visibly taken aback, surprised that they were outperforming even the rosiest of projections. In his excitement, he accidentally knocked a reporter’s phone out of his hand. Others soon joined him in the victory lap. DNC Chairman Tom Perez’s voice broke as he screamed at the top of his lungs at the podium. “The Democratic Party is back my friends,” he boomed, seemingly trying to convince himself that that was true as well.

Speaking with reporters after his speech, Perez said Tuesday’s elections showed a model of success for the future. He also told The Daily Beast that it was indicative of the fact that any talk of a rift among national Democrats was overblown.

“I didn’t hear a word in my last four days in Virginia from anybody about Donna Brazile,” Perez said. “They were looking forward.”

Brazile may not have been on voters’ minds. But Trump surely was. While the president did not appear alongside Gillespie during the campaign, he was still omnipresent in the race. Gillespie put a heavy focus on illegal immigration, in particular by emphasizing the emergence of MS-13 gangs in northern Virginia and the possibility of “sanctuary cities” popping up in the state. Trump recorded robo-call advertisements on Gillespie’s behalf and tweeted his support for the candidate multiple times.

Immediately after the results came in, the president did his best to distance himself from them. Gillespie, he tweeted, barely ran on the Trump agenda.

That is revisionism, in large part. But also somewhat irrelevant. Because with Northam having won by such margins, the playbook has been laid out for every Democrat to follow.

When Rep. Gerry Connolly (D-VA) took the stage, he actually thanked the president effusively.

"Ralph Northam was the perfect anecdote to that orange guy in the White House" Connolly declared.

With reporting by Andrew Desiderio