The Virginia gubernatorial contest has unexpectedly become a test case of the explosive politics of race in the Donald Trump era. The outcome could tug the Republican Party much further toward Trump-style racial provocation and polarization next year. Or it could warn the GOP that such positioning carries too high a political price among white swing voters and minorities.

Republican nominee Ed Gillespie, a party operative and former lobbyist once considered a relative centrist, has built his campaign around a succession of racially infused attacks against his Democratic opponent, Ralph Northam, the current lieutenant governor. Gillespie has besieged Northam on his opposition to Confederate monuments, and on his support for so-called sanctuary cities, which don’t fully cooperate with federal immigration enforcement and which Gillespie alleges protect the Central American gang MS-13.

Northam now holds a modest lead in virtually all polls. But if Gillespie wins—or even loses only narrowly—in such a diverse and highly educated coastal state, it will inevitably inspire other Republican candidates in the 2018 midterms to emulate his tactics, particularly his attacks on sanctuary cities.

Win or lose, “I wouldn’t be surprised if you see sanctuary-city initiatives on the ballot in as many states as possible next year,” Gene Ulm, Gillespie’s pollster, told me in a recent interview. That prospect underscores the quickly rising stakes for Democrats in this race. Many Democrats initially viewed Gillespie’s emphasis on immigration and crime as a largely defensive move after he nearly lost the GOP primary to Corey Stewart, a Prince William County supervisor who ran a Trump-like campaign that thundered against immigrants and party elites alike.

Since late August, Gillespie has run television ads accusing Northam of casting a tie-breaking vote in the state legislature to defend sanctuary cities. The spots have been widely criticized as misleading because, among other issues, no jurisdiction in Virginia actually qualifies as a sanctuary city. But over images of heavily tattooed Latino men, the ads charge that Northam’s vote “let dangerous illegal immigrants back on the street, increasing the threat of MS-13.” One briefly shows Gillespie talking with an African American police officer, but it ends with him walking with three white policemen—a thin blue line of defense—down what looks like a street in the outer Washington, D.C., suburbs that often decide Virginia elections.

Gillespie has also opposed the removal of Confederate statues, even after the white-nationalist violence that erupted in Charlottesville this summer. And this week, the Republican aired a new ad criticizing outgoing Democratic Governor Terry McAuliffe for restoring the voting rights of tens of thousands of felons, a policy that has disproportionately benefited African Americans in the state.

Democrats maintain that Gillespie is taking this Trump-like approach because he doesn’t naturally excite the president’s core constituency of blue-collar and non-urban whites. “Gillespie is a deeply flawed messenger for a populist message,” Geoff Garin, Northam’s pollster, told me. Garin said the Northam campaign’s internal polling shows that Gillespie’s tone, particularly on immigration, is “hurting him” with the many college-educated white voters in the Northern Virginia suburbs.

To that, Ulm responded succinctly: “That’s wishful thinking.” He said the attacks on sanctuary cities “absolutely” are improving Gillespie’s position with white-collar whites. “You wouldn’t see it so much [on television] if we didn’t believe so strongly in it,” he told me. What’s more, Ulm said, Gillespie’s defense of Confederate statues has fortified his standing among suburban whites further south, outside of Richmond, where the issue resonates more powerfully.

The outcome of the race—and its interpretation beyond Virginia—could hinge largely on whether Garin or Ulm is right. Even if Gillespie’s embrace of a Trump-style message energizes the president’s base, it will benefit him little if it generates a backlash among white-collar whites.

Democrats rarely carry most college-educated whites in Virginia, but as long as they stay close among them, it’s difficult for Republicans to win, given the state’s substantial minority population. Both McAuliffe in 2013 and Hillary Clinton in 2016 narrowly lost this bloc while winning the state. In 2014, Gillespie carried college-educated whites by 10 points in his challenge to Democratic Senator Mark Warner, and that wasn’t quite enough to win. If Northam runs about even or better among them, it would not only virtually ensure his victory, but also strongly signal that many of these voters are recoiling from a Trump-like approach to race.

But even if Gillespie slightly underperforms among white-collar whites, other Republicans, especially in more working-class states, may still consider that slippage an acceptable price for mobilizing the Trump constituency. Equally important in determining the Virginia contest’s resonance will be whether Gillespie faces bigger-than-usual deficits and, more critically, higher turnout among Latinos and African Americans, whose participation usually sags in off-year elections.

Steve Phillips, a prominent African American activist and a senior fellow at the Center for American Progress, has charged that the centrist, low-key Northam is too focused on white swing voters and hasn’t placed enough priority on energizing communities of color. Gustavo Torres, president of CASA in Action, a political organizing group that’s aiming to personally contact 65,000 Latino households ahead of the election, disagrees: He praises Northam for offering a clear message of inclusion to immigrants and says his campaign recognizes the importance of mobilizing them.

For all the racial signaling in Trump’s 2016 campaign, turnout compared with 2012 remained flat nationally among Latinos and declined among African Americans. If minorities in Virginia fail to vote in higher numbers than usual, even after Gillespie’s racial provocations, more Republicans will undoubtedly feel emboldened to follow him down that road. Already, in New Jersey, GOP gubernatorial nominee Kim Guadagno, who’s been trailing Democrat Phil Murphy badly, is closing her campaign by unleashing her own attacks on sanctuary cities and warning of “illegal aliens” committing violent crimes. “The stakes are very high,” Torres said. “If they win in Virginia, it’s going to be very scary all around the nation.”