At the polls Tuesday, Mr. Gillespie's backers said they hoped he could deliver a victory to a state Republican Party that has been on a losing streak. He energized many new-to-politics voters who oppose Trump but was ultimately unable to expand the universe of Democratic primary voters enough to counter Northam's advantages.
Polling leading into Tuesday had Perriello, who jumped in to the race in January, even with Northam, who locked down the entire statewide Democratic apparatus more than a year ago.
The Democratic primary contest has been a hard fought battle between Lt. Gov. Ralph Northam, the state party establishment's favorite, and insurgent candidate Tom Perriello.
Virginia and New Jersey are the only states set to elect governors this year, and the contest in the Old Dominion is attracting broad national attention as a possible early referendum on Trump ahead of the 2018 midterm elections.
"People ask me, 'Ralph, are you going to keep doing what Governor McAuliffe is doing?' I say, 'Damn right I am, ' " Northam said as the crowd roared.
On the Republican side, front-runner Ed Gillespie, a moderate Washington insider, is trying to fend off under-funded but spirited campaigns from avid Trump supporter Corey Stewart and state Sen.
Michael Phelps to swim in a race against a shark
The rather vaguely worded announcement says Phelps will take on "An event so monumental no one has ever attempted it before". "23 Olympic golds", Discovery Channel said in a press release . "Be in a cage and dive with great white sharks! ".
Democrats cast about 543,000 votes - a record for a Virginia gubernatorial primary in either party - with Northam aided by a strong performance in his Hampton Roads home base and among African-Americans and other Democratic regulars, particularly in Northern Virginia and the Richmond area.
Mr. Gillespie tried to steer clear of getting too bogged down in Trump-related controversies in Washington, running a more traditional Republican campaign that focused on his desire to slash taxes, pursue conservative pro-growth policies and strengthen ethics laws. "I think it's movements that change the world, and politicians who work as allies to that movement", he told supporters.
Mr. Perriello congratulated Mr. Northam in a phone call before taking the stage at his election night party, vowing to support his rival in the November election.
It is unclear if the defeat of Stewart or the narrowness of that defeat - when it was expected to be by a much larger margin - is a show of support for the president or a statement against him.
Interestingly, though, neither Northam nor Perriello is as true-blue Democrat as the campaign might have led voters to believe.
Northam said he'd do everything he could to reach out to Perriello backers.
"If I am entrusted with governorship of the Commonwealth we love, I will be an ethical, honest, hard-working, principled Governor", Gillespie continued. "I trust his dedication to all Virginians", Lee said of Northam. Smith added that he may vote for Gillespie, but won't campaign for him. Northam raised almost $6.5 million in the primary compared to Perriello's $4 million haul, which helped the lieutenant governor saturate Washington-area television stations with ads over the last few weeks. Smith viewed the results as a vindication of Trump. He believes that many of Stewart's voters believed in his message attacking the political establishment, noting that he likely "tapped into the same things that caused Trump's win".