Ever since Donald Trump became president, wary Republican elites have believed he was an anomaly—a unique candidate who owed his success to celebrity appeal and weak opposition, despite some noxious views and behavior. Take away Trump the person, they believed, and there would be no Trump phenomenon.

That viewpoint got a rude wake-up call this week, in a Virginia Republican primary that wasn’t supposed to be a contest at all. And while the GOP establishment’s preferred candidate still won, the surprise result showed there’s still a substantial appetite in the party’s base for the populist impulses Trump represents.

Virginia elects governors in the odd-numbered years after presidential elections, and this year, it was Democrats whose primary looked like a pitched battle. Two well-credentialed progressives—one the sitting lieutenant governor, the other a former congressman and Obama administration official—were locked in a battle for the party’s soul. But despite polling showing a tight race, the Democratic establishment candidate, Lieutenant Governor Ralph Northam, pulled out an easy win, defeating Tom Perriello by a 12-point margin.

On the Republican side, meanwhile, Ed Gillespie expected to coast to an easy victory over his main challenger, Corey Stewart, a Trump acolyte who highlighted his hard line on immigration and support for Confederate monuments. It doesn’t get much more “establishment” than Gillespie, a former D.C. lobbyist and chairman of the Republican National Committee. Polls had shown Gillespie up by 20 points over Stewart, a local county board chairman. Gillespie had all the major endorsements and many times as much money as Stewart.

But off-year elections, where turnout varies wildly and partisans are often late to decide, are devilishly difficult to poll. Virginia primaries have defied the pollsters before: In 2014, grassroots conservatives delivered a shocking defeat to Eric Cantor, the House majority leader, just weeks after Cantor’s pollster had told him he was winning by 34 points.

In this case, Gillespie and Stewart’s vote totals hovered within a point of each other for hours after the polls closed. Gillespie was finally declared the winner by just over 1 percentage point, drawing 43.7 percent of the vote to Stewart’s 42.5 percent.

I spent the weekend before Tuesday’s vote following Stewart and Gillespie, on the theory that their primary was an early test of the Trump era’s most pressing political question: whether the unorthodox new president represents a long-term political realignment or just a weird one-off. Had Gillespie walked away with the primary as expected, it might have been evidence that the Republican fever had broken, and that the GOP was looking to return to business as usual with sensible, practical candidates rather than race-baiting firebrands.

Virginia isn’t exactly Trump country: The state went for Hillary Clinton in 2016, and Trump won the state’s primary by a narrow margin over Marco Rubio. Despite its Southern geography, Virginia today is an urban, transient, diverse, highly educated state, where many local Republican activists are wealthy consultants and lobbyists like Gillespie. When I went to see Gillespie campaign at a local fair, I met one such activist, a former mining-industry lobbyist who lives in the D.C. suburbs. Gillespie’s campaign was premised on the notion that Virginia Republicans were looking for a candidate who, while not openly repudiating Trump, was the polar opposite of Trump in temperament and orientation, emphasizing tax cuts and economic growth over culture-war controversies.

Stewart’s theory was the opposite: that Trump changed everything and showed what the GOP base was really looking for. Serving as the Trump campaign’s Virginia state chairman last October, he led activists in a march on the RNC headquarters, where he charged that the “establishment pukes” were undermining Trump’s campaign. (He was fired for the stunt.) Last weekend, Stewart told me he had warmed to Reince Priebus, the former RNC chairman now serving as White House chief of staff, but still believed the Republican establishment was hampering Trump’s presidency.

The Stewart supporters I spoke to, at a campaign rally in a diner in Fredericksburg, were galvanized by his nationalist message. There were numerous Confederate flag bumper stickers in the parking lot, and one woman wore a stars-and-bars hat with the word “REBEL.” They told me they were disgusted with Republican leaders like House Speaker Paul Ryan, and put all their faith in Trump.

On Tuesday, there turned out to be a lot more of these types of Republican voters than Ed Gillespie expected.

Trump had an effect on the Democratic side of Tuesday’s primary as well. More than they competed on policy, the Democrats vied to be the most virulently anti-Trump, with the winner, Northam, airing an ad in which he called the president a “narcissistic maniac.” And Democrats were clearly energized: More than 540,000 turned out to vote in the Democratic primary, compared to 370,000 in the Republican primary.

In Fredericksburg, I asked Stewart if he believed Trump had changed the face of American politics. “That’s what this election is going to help answer,” Stewart replied. “He certainly was a different kind of Republican. The question is, did that start a new era in Republican politics? Or are we going to revert back to the same old same old, with more establishment candidates winning nominations?”

Stewart, of course, believed he was going to win, and he didn’t. But in coming as close as he did, he gave the Republican establishment a scare—and showed that a sizable portion of the GOP base doesn’t want to go back to business as usual. Far from being weary of the controversial and unorthodox president, a lot of Republicans want more candidates like Trump.