(CNN)For months, the assumption has been that Ralph Northam would be elected Virginia governor on Tuesday night. Now, with just hours remaining before polls open in the commonwealth, the race suddenly looks like a toss-up between Northam, the Democratic lieutenant governor, and former Republican National Committee Chairman Ed Gillespie.

"It's hard to imagine a statewide candidate who was in the lead with three weeks left who has had a worse close to their campaign," said Glen Bolger, a GOP pollster who has worked extensively in Virginia.

And, by any objective measure, it's hard to argue with Bolger's assessment.

Northam absolutely botched his position on sanctuary cities in the closing weeks of the race -- insisting that despite his vote to kill a bill in the state Senate that would ban sanctuary cities (even though Virginia doesn't have any!), he actually would have voted in support of the legislation he killed if Virginia did have any sanctuary cities.

Uh, OK.

Northam's ads -- particularly those he is running in the Washington, DC media market -- feel defensive. In one, he insists that "if Donald Trump is helping Virginia, I'll work with him," an somewhat striking reversal from Northam's insistence that Trump was a "narcissistic maniac" earlier this year. And Northam's attack on Gillespie as "Enron Ed" feels like an ad from 10 years ago, not today.

Speaking of ads, it's one that Northam didn't sponsor that has caused him the most trouble over the final month of the race. The commercial in question was paid for the Latino Victory Fund and showed four minority children being chased by a man in a pickup truck with a Confederate flag and a Gillespie bumper sticker. The ad has generated massive controversy -- and Gillespie has seized on it as evidence that Northam and Democrats believe all Republicans to be racists.

Then there are the other intangibles in the race working against Northam. Northam is not the fierce anti-Trump liberal that many Democratic activists in the state want. That candidate was former Rep. Tom Perriello, who lost to Northam in a primary earlier this year. Northam is also from a part of the state --the eastern shore -- that is not terribly populated or a traditional source of statewide Democratic candidates."He is running a campaign that is true to him," said one Democratic pollster who has worked in the state for decades. "Mainstream, practical, continue Virginia's progress." Northam simply can't sell as a hard-line and aggressive anti-Trumper, the source argues, so he's been smart not to try.

The Democratic source also noted that Gillespie has shown an ability to close strong -- he came from nowhere to lose to Sen. Mark Warner, a Democrat, by just 18,000 votes in 2014. Plus, when Democrats have won the Virginia governorship (in 2001, 2005 and 2013) the races have been close (five points, six points and three points, respectively).

The problem for Northam in this race might well be expectations. Heading into this year, many Democrats viewed a win here as a no-brainer. Virginia has been transformed over the last decade from a reliably Republican state to a Democratic-leaning one; President Barack Obama carried it twice, Hillary Clinton won it by six points in 2016 and Democrats control the governorship and both US Senate seats. Trump is not terribly popular in the state -- especially in the highly populated northern Virginia suburbs that encircle DC.

A look at the aggregate of the polling -- and there's been lots of it -- done in the last week or so of this race shows Northam ahead, but by less than some people expected.

According to Real Clear Politics' poll of polls, Northam now has, on average, a lead of just over three points on Gillespie. Yes, that's down from the six-and-a-half point edge he held at this time last month. But given the disastrously bad closing week of the race for Northam, the fact he is still ahead at all is somewhat remarkable -- and may speak to the durability of his advantage.

Here's the thing: Excuses aside, if Northam loses the governor's race in Virginia tomorrow, it will set off a panicked blame game not just in the state but nationally, as liberals will insist that Perriello would have won had the party nominated him. (In that, it will echo the debate over whether Clinton or

Bernie Sanders would have been the better nominee against Trump -- a fight still happening within the Democratic Party despite the fact that the election ended almost a year ago.)

Given all of that, there's a tremendous amount riding on Northam on Tuesday night. Can he find a way to win even after enduring such a bad final month? And if he can't, what (if anything!) should we conclude about the state of the Democratic Party in Virginia and nationally?

With 77 percent of the vote in, Northam had 52 percent and Gillespie trailed with 47 percent.

Both national parties spent millions of dollars in the first major election since President Donald Trump's surprise victory last year and were closely watching the outcome as an early barometer of the political climate ahead of next year's midterm contests.

Play Virginia Gubernatorial Candidate: We've Hit Back at Gillespie Facebook Twitter Embed Virginia Gubernatorial Candidate: We've Hit Back at Gillespie 4:35Northam, an Army veteran and pediatric neurologist who serves as the state's lieutenant governor, had sometimes struggled to highlight his ad-ready biography as the race descended into a nasty culture war.

He likely got a major boost from popular term-limited Democratic Gov. Terry McAuliffe, who handed his successor a strong economy and an electorate that tends to tell pollsters they believe the state is on the right track.

Gillespie, a former lobbyist and Republican National Committee chairman, responded to a near-loss in the GOP primary against a Trump-aligned challenger earlier this year by taking a hard right turn on immigration and Confederate monuments.

Health care was the top concern among Virginia voters, with 37 percent citing it as the most important issue to their vote, according to the NBC News exit poll.

That seemed to help Northam: A large majority of people who voted for him — 57 percent — said that health care was their No. 1 concern in the race, while Gillespie's voters turned out for a variety of reasons, including immigration and taxes.

Despite maintaining narrow lead in the polls, Democrats headed into election night with white knuckles, still shaken by Trump's stunning win last year.

Image: Democratic Gubernatorial Candidate Ralph Northam waves as he arrives to speak during a campaign rallyDemocratic Gubernatorial Candidate Ralph Northam waves as he arrives to speak during a campaign rally in Richmond, Virginia on Oct/ 19, 2017. Jim Watson / AFP - Getty Images fileIn New Jersey, Democrat Phil Murphy bested Republican Kim Guadagno in the governor's race, according to an NBC News projection — letting the door hit Gov. Chris Christie on his way out of office as one of the least popular governors in the country.

Both parties expected Murphy, a former Goldman Sachs executive and Obama-era ambassador to Germany, to prevail, largely because Christie's anemic 14 percent approval rating dragged down Guadagno, his lieutenant governor.

Guadagno struggled throughout the campaign to escape Christie's shadow, along with lingering questions about the Bridgegate scandal, although she saw some positive movement in recent polls after adopting a sharper tone on immigration that echoed President Donald Trump.

Murphy's victory gives Democrats complete control of New Jersey government, where Christie often battled with the opposition-controlled state Legislature. That makes the state one of just seven nationwide where Democrats now control the governor's mansion and both chambers of the legislature, compared to a whopping 26 for Republicans

lol fake news cnn is in having a party that democrat won virgina governor lol the land of the terry criminal gang where that clintong ring member and goveornor terry mcaloaf was governor of..

I seriously do not think fake news cnn and msnbc understand the severity of the problem their communist party is having,, the reason they won a few is because the republicrats are just as hated.. they are being punished..

I told you that president Donald trump bring a revolution.. for that revolution we had to make good with one party so he could run and win.. now need to govern with their help but president Donald trump is not republicrats,,

fake news cnn do not understand that this is social and cultural problem what America and the west is going tru..

president Donald trump will keep on winning big weather he run as independent or use the republicrars as the party as the stage,,

I don't believe this is understood.. I do not believe fake news cnn understand how much the communist regulating surveilling criminal corrupt party of America is hated

they just don't get it lol

they simply do not! get it

barak Hussein Obama created a criminal party,, it used to be corrupt but under son of 1000 whores the Kenyan created a criminal! party.. the republicrats are no better until they do something positive and even then everyone must understand that president trump is true! independent

Gillespie ran on a Trump platform ....he campaigned on immigration, crime, football players taking a knee, confederate monuments etc.. and the voters said "no thanks"

He didn't do this until the end. THat is why he moved up so much at the end. If the dems would lose a state like Viginia that would be the end of the party. THis result is no suprise except that Gillespie did better than I thought he would.

He didn't do this until the end. THat is why he moved up so much at the end. If the dems would lose a state like Viginia that would be the end of the party. THis result is no suprise except that Gillespie did better than I thought he would.