Virginia Gov.-elect Ralph Northam and his wife take the stage at his victory rally on Tuesday. (Michael Robinson Chavez/The Washington Post)

Rachel Bitecofer is a lecturer in political science and assistant director of the Wason Center for Public Policy at Christopher Newport University. Quentin Kidd is the dean of the College of Social Sciences and director of the Wason Center.

There is really only one way to look at the election of Democrat Ralph Northam in the Virginia governor’s race on Tuesday: It was an overwhelming repudiation of President Trump and Trumpism.

In 2016, Virginia was the only Southern state to vote for Hillary Clinton, in effect, politically seceding from the South. On Tuesday, Virginia voters affirmed that decision and added a large exclamation point at the end of it.

What drove Tuesday’s vote was an impressive coalition of moderate and progressive voters who were angry with Trump and chomping at the bit to show their displeasure. Walking out after casting their ballots, 34 percent of voters told exit pollsters that their vote was an expression of opposition to Trump. We found evidence of this strong antipathy toward Trump driving a potential surge of voters in our late September and early October polls of the race, when nearly a third of likely voters told us their vote choice was a message of disapproval of the president.

To put this into some perspective, according to Tuesday’s exit poll, health care was the most important policy issue in deciding how people voted in the governor’s race, coming in at 39 percent. Gun policy came in next at 17 percent, and it’s worth noting that those who cited gun policy split their vote evenly between Northam and Republican Ed Gillespie. Thus, expressing opposition to Trump — at 34 percent — was essentially the second most important issue driving voters in Virginia.

Even if he didn’t campaign in the state, Trump cast a long shadow over the commonwealth during the entire election, a shadow that affected the coalitions of both candidates.

A quintessential establishment Republican and a policy wonk at heart, Gillespie did not want to run as either an acolyte of Trump or on Trumpism. He wanted to run on the economy. He issued 21 detailed policy papers during the campaign, focusing on everything from the economy and taxes to coastal flooding in Hampton Roads.

But he prevailed in a narrow win over Corey Stewart — a Trumpian politician before we knew there was such a thing as Trumpism — in the June primary. And as summer turned into autumn, Gillespie’s team began to realize that while establishment Republicans were drawn to him, base Republicans who had supported Stewart in the primary weren’t. From that point on, the Gillespie that voters saw depended increasingly upon what kind of voters they were. Establishment-friendly voters heard ideas about taxes, criminal justice reform, agriculture renewal and mental health reform. Trumpists got a dark and pessimistic Gillespie, who stoked racially-tinged fears about immigration and the violent MS-13 gang, and who warned against a wild-eyed Northam who wanted to take “our” confederate statues down.

What emerged was an inauthentic mess. In the end, establishment Republicans were disappointed that Gillespie embraced racially-tinged Trumpian scare tactics, and Trumpian Republicans felt he didn’t embrace their man fully enough.

If Gillespie found it impossible to fully run on his coalition, Northam had only to hold on and ride the wave of his.

Northam announced in February 2015 that he was running for governor — an early move intended to block any potential primary challengers. It seemed to work. Northam started lining up the necessary endorsements. But the election of Trump shifted the landscape. Days before Trump’s inauguration, progressive Tom Perriello announced he would challenge Northam in the Democratic primary.

The knock on Northam at the time was that he was too moderate, both politically and in personality, to excite the resistance movement that was quickly emerging as a new force in grass-roots Democratic politics. The Perriello challenge injected a sense of urgency in the Northam campaign and forced him to adopt a more progressive posture on the trail. At one point, Northam famously called Trump a “narcissistic maniac,” a signal to the resistance that he was willing to fight fire with fire.

When Democrats rewarded Northam with a comfortable primary win in June, Perriello quickly endorsed him and spent the rest of the election cycle actively campaigning for him (something Stewart never did for Gillespie). Perriello’s support did two critical things for Northam. First, it signaled to the progressive grass roots that Northam was worth working hard to elect. Second, it gave Northam the cover to step back into his more natural and comfortable Virginia Way approach to campaigning.

Virginia’s gubernatorial elections holds lessons for both parties as they look to 2018.

For Democrats eyeing 2018, the lesson from Virginia is that the grass-roots progressive frustration with Trump is big, and it can be mobilized, even around a moderate candidate like Northam. The basic geographic structure of the Virginia electorate didn’t change: Most red areas voted red, and all blue areas voted blue. Only six of Virginia’s 133 cities and counties switched between 2013 and 2017 — that is, they voted for Republican Ken Cuccinelli in 2013 and then for Northam in 2017 — the most notable of those being Virginia Beach.

But in the blue areas, Democratic performance surged. In Fairfax County, the Democratic margin went from 22 percent in 2013 to 37 percent in 2017. In Loudoun County, it went from 4 percent to 20 percent. In Prince William County, it went from 8 percent to 21 percent. In Richmond, it went from 57 percent to 65 percent. And in Norfolk, it went from 40 percent to 48 percent. This surge can’t be explained by demographic shifts in the past four years. Virginia’s population has been growing at its slowest pace since the 1920s.

For Republicans, the lesson that Trump and Stewart immediately drew from Tuesday’s loss is that Gillespie didn’t adopt Trumpism fully enough. Trump tweeted within minutes of the election being called that “Ed Gillespie worked hard but did not embrace me or what I stand for . .. ” Stewart criticized Gillespie for keeping Trump at a distance. And Stewart seems poised to double down on Trumpism as he challenges Democrat Tim Kaine in the 2018 U.S. Senate race.

But that takeaway isn’t so clear for Republican Reps. Barbara Comstock in Northern Virginia and Scott Taylor in Hampton Roads, who will be seeking reelection in 2o18, but whose districts went for Northam. Taylor, perhaps recognizing the changed political landscape of his own district, called on the president to engage in “self reflection” on Tuesday night

One sure lesson is that Trump is certain to cast a long shadow over many races in 2018, whether the candidates want him to or not. Democrats might have figured out how to win in that shadow. Republicans are still struggling with it.