THE TRIUMPH of Democratic Lt. Gov. Ralph Northam in Virginia's gubernatorial election Tuesday was a victory of decency, civility and moderation over fear, dread and barely veiled racist coding. The outcome reinforced what has become Virginia's quintessential, if imperiled, idea — that of a determinedly centrist Southern state that has repeatedly rejected efforts to coax its electorate to the toxic margins of American politics.

Mr. Northam — understated, personally gracious and so lacking in partisan fire in the belly that Republicans once took a shot at recruiting him to their ranks in the state Senate — led in the polls from the outset. Yet his win still contained a measure of surprise. It was a repudiation not only of Ed Gillespie, the Republican candidate, but also more fundamentally of the racially divisive Trump campaign playbook, which Mr. Gillespie, ditching his reputation as a traditional and fair-minded conservative, embraced whole-heartedly.

Virginians have now rejected President Trump's tawdry, tasteless, taunting brand of politics in consecutive years — in 2016, when Hillary Clinton won the state by a greater margin than President Barack Obama managed in 2012, and again on Tuesday, when Democrats swept all three statewide offices and gained perhaps a dozen or so seats in what had been a GOP-dominated legislature. The rest of the South may be Trump country — though even that is uncertain given the president's anemic poll ratings — but Virginia most assuredly is not.

Virginia voters suffered through a barrage of Gillespie campaign attack ads vilifying illegal immigrants by equating them with violent gangsters; celebrating the candidate's support for Confederate monuments immediately after they were the rallying cause of racist and neo-Nazi marchers in Charlottesville; and attacking Mr. Northam, a pediatrician, for his ostensible support for restoring voting and other civil rights to child sex abusers. Eschewing the pocketbook issues Mr. Gillespie himself said mattered most to Virginians, his ads aimed to inflame and frighten.

Like every Virginia governor, Mr. Northam is barred from running consecutively for a second term; he will have just four years to make his mark in Richmond. Like the incumbent, Terry McAuliffe, and his predecessor once removed, now-Sen. Timothy M. Kaine, Mr. Northam will take office as a Democrat facing stiff resistance from Republicans in the General Assembly. GOP leaders there have been loath to work cooperatively with recent Democratic governors, for fear of granting them a platform of achievements on which to run for higher office, as then-Gov. (and now Sen.) Mark Warner did after striking a bipartisan deal with lawmakers to raise taxes in 2004.

Still, Republicans will have in Mr. Northam a Democratic governor who is popular in the legislature and with whom they've worked in the past. Despite some flirtation with a $15 minimum wage and a few other populist stances during the spring Democratic primary, when he faced and vanquished a leftist challenger, his campaign generally avoided appeals to the Bernie Sanders-inspired extreme of his party's base. He offered substantive proposals to make progress in health care, the economy and the environment. That, along with his generally civil tone, provides a basis to hope that Mr. Northam can forge a record of accomplishment for all Virginians.