In one of the first major primary races after the 2016 presidential election, a Republican candidate for governor who campaigned on a pro-Trump platform nearly pulled off an upset, while a Democrat candidate who cast himself in Bernie Sanders’ progressive mold lost. 

Candidates perceived by some as establishment won in both the Democratic and Republican primaries for Virginia governor Tuesday. But another takeaway is that the polls—which predicted a nail-biter for Democrats and a blowout on the Republican side—were as wrong as the polls for the Nov. 8 general election.

“The real national takeaway was on the Republican side more than the Democratic side,” said Quentin Kidd, a political science professor at Christopher Newport University who is director of the Wason Center for Public Policy.

A Washington Post poll in May showed a significant lead in the GOP governor’s race—37 percent to 12 percent—for Ed Gillespie, former chairman of the Republican National Committee, over Corey Stewart, chairman of the Prince William County Board of Supervisors, who was state chairman of President Donald Trump’s 2016 campaign. State Sen. Frank Wagner of Virginia Beach had 13 percent in the poll, actually outperforming Stewart.

“One candidate wrapped himself in a Donald Trump flag, running against an opponent with a huge advantage in polls,” Kidd told The Daily Signal. “Just as there were some shy Trump voters, I think there are also shy Stewart voters.”

Unofficial final results Tuesday night, though, had Gillespie only squeaking by Stewart, with 43.7 percent of the vote to 42.5 percent. Wagner finished with 13.8 percent.

Favorite Ed Gillespie only edged out Corey Stewart in Virginia’s GOP primary for governor. (Photo: Ed Gillespie for Governor Facebook)

On the Democratic side of the Virginia governor’s race, that same Post poll showed former U.S. Rep. Tom Perriello, a progressive with the active backing of Sanders, the democratic socialist senator from Vermont, leading Lt. Gov. Ralph Northam, 35 percent to 29 percent.

But in the end, Northam won 55.9 percent of the vote to Perriello’s 44.1 percent. The upstart’s loss came after Sen. Elizabeth Warren, D-Mass., did a TV commercial for him and several Obama administration alumni endorsed him.

Democrat Northam will face Republican Gillespie in the general election Nov. 7.

“The national implications are that the 37 percent or 40-something percent—whatever the Trump approval rating is on any given day—it’s real, and they do vote,” Kidd said. “Corey Stewart ran as Donald Trump’s right-hand man. … Ed Gillespie, I don’t know if he even uttered the words Donald Trump.”

Virginia Lt. Gov. Ralph Northam fended off Tom Perriello in Democrats’ primary for governor. (Photo: Lt. Gov. Ralph Northam Facebook)

Republican voters likely looked at the polls and thought Gillespie would win easily, said Stephen Farnsworth, a political science professor at the University of Mary Washington.

“There is a real dispute within the Republican Party about how close a candidate should be to Donald Trump,” Farnsworth told The Daily Signal.

The president was a key factor in both primaries, he said.

“It was a factor in the intensity for Stewart that made it a close race, and the intensity that forced Northam to move to the left and sharpen his attack on Trump in order to fend off Perriello,” Farnsworth said.

Phil Kerpen, chairman of American Commitment, a conservative advocacy group, noted while tweeting about the results that Trump was underestimated.

The Trump campaign last year fired Stewart, an early supporter, as its Virginia chairman after he participated in a protest outside Republican National Committee headquarters to complain that the RNC provided inadequate support for Trump.

The Democratic primary had some lessons.

Northam, known as a moderate Democrat in the Virginia state Senate, admittedly voted twice for Republican George W. Bush for president. For two years, Northam built a campaign based on pragmatism.

But Perriello pushed Northam to the left, to focus more heavily on issues such as maintaining Obamacare’s Medicaid expansion in Virginia and fighting for abortion rights. The lieutenant governor called Trump a “narcissistic maniac” in one campaign commercial.

“That ad was very effective in prompting progressive-minded voters who were hesitant about Ralph Northam to be more comfortable with him,” Kidd said. “Tom Perriello wanted a groundswell of progressive energy that didn’t materialize.”

Tom Perriello hoped to pull off an upset of fellow Democrat Ralph Northam. (Photo: Tom Perriello Facebook)

However, he said, Northam’s move to the left showed significant progressive energy was in play.

Kidd said the Northam-Perriello spread in the 2017 Democratic gubernatorial primary is closer, but still resembles the Hillary Clinton-Bernie Sanders split in the state’s 2016 Democratic presidential primary, when Clinton beat Sanders 64.3 percent to 35.2 percent.

“The progressive left and the moderate middle are still fairly static in Virginia. Those voting blocs are what they are,” Kidd said. “Northam was forced to be more progressive, but there weren’t the votes there for Perriello.”