Lt. Gov. Ralph Northam, the Virginia Democratic candidate for governor. (Ricky Carioti/The Washington Post)

TUESDAY’S VIRGINIA gubernatorial primary, the first step in one of this year’s marquee political races, brought two surprising — and mostly positive — results.

The Democratic race was supposed to be very close. But voters chose experience over activist passion, picking Lt. Gov. Ralph Northam as their gubernatorial candidate over progressive favorite Tom Perriello by 11.8 points. Though the race was cast as a rerun of last year’s Hillary-vs.-Bernie presidential primary, the two men were virtually identical on policy and in their opposition to President Trump. Mr. Northam’s advantage was his decade of experience in Richmond, relationships with members of both parties and keen eye for state politics. Though the sharp Mr. Perriello would have made a fine nominee as well, it is heartening to see voters empower those who would make the most effective leaders, rather than the most emotionally satisfying rhetoricians.

On the Republican side, former George W. Bush aide Ed Gillespie narrowly won the nod, beating Prince William Board of County Supervisors Chairman Corey A. Stewart by a mere 4,300 votes out of some 360,000 cast. Polls had Mr. Gillespie well ahead of Mr. Stewart, who tied his campaign to defending Confederate monuments and who has based much of his career on anti-immigrant rhetoric. The closer-than-predicted finish will no doubt feed the narrative that the Republican Party is now the Trump party, its old establishment of economic conservatives, Christian traditionalists and national security hawks giving way to more extreme nativists.

This account exaggerates the GOP establishment’s collapse. Mr. Stewart benefited from very low turnout on the Republican side, no doubt inspired in part by predictions that Mr. Gillespie was unstoppable; that gave the hardcore base an outsize voice. Nevertheless, 57.5 percent of voters in the Republican primary chose someone other than Mr. Stewart. (State Sen. Frank W. Wagner, the most reasonable of the three GOP candidates, took 13.8 percent of the vote and Mr. Gillespie 43.7 percent.)

The lesson Republican politicians should learn is not to fear populist rabble-rousers but to confront them. It is undeniably a problem when 155,743 people in a major-party primary vote for a man such as Mr. Stewart, a relentlessly negative candidate who embraced the symbolism of the racist Old South. As he pugnaciously refused to concede defeat Tuesday night, Mr. Stewart cited the need to defend “our culture, and our heritage and our country,” language designed to stir up racial hostility. Declining to frontally take on this hateful strand in Republican politics did not work all that well for Mr. Gillespie. It looked calculating, because it was.

Establishment Republicans sickened by irrational populism should say so, clearly, loudly and often. They would retain more dignity. And they might even gain votes from Republicans simply looking for conservative politicians who aren’t bloodless finger-in-the-wind types.

Fortunately, with Mr. Stewart sidelined, Virginia now has two gubernatorial candidates capable of adult debate. We hope and expect they will keep the election focused on relevant policy questions.