Robert Thomas (R) watches as final returns come in at an election night party in Stafford, Va., on Nov. 7. Thomas, shown with his wife, Christi, and their children, won the 28th House District seat by 82 votes. (Suzanne Carr Rossi/The Free Lance-Star via AP)

THE MYSTERY of how, why and by whom a few hundred Northern Virginians were registered to vote in the wrong state legislative districts in this fall’s elections does not look as though it will be resolved soon. For one thing, the registrar who might have been able to shed some light on the issue died last spring.

The more pressing question is what to do about the razor-thin result in one of the districts, on which partisan control of the state House of Delegates may hinge. Short answer: A federal judge now reviewing the mess should order a do-over.

That would be an unusual recourse for the race in the 28th House District, including parts of Stafford County and Fredericksburg, where Republican Robert Thomas leads Democrat Joshua Cole by 82 votes. It would also be warranted.

Consider: Dozens of the district’s voters, including some in a heavily Democratic precinct, were disenfranchised when they were mistakenly issued ballots to vote in the neighboring 88th House District (where the outcome was not close). Dozens more voters in the 88th District, which tilts Republican, were mistakenly given ballots to vote in the 28th.

An additional 237 voters were misassigned between the two districts but never cast a ballot — in some cases, perhaps, because they were confused about their registrations. And who could blame them?

Given that Mr. Thomas’s 82-vote victory margin — still subject to recount — was just a third of a percentage point of some 23,000 votes cast, and that 147 votes were erroneously cast — 86 of them in the 28th District and 61 in the 88th District — the outcome is invalid on its face. And there is no recourse under state law for elections officials to redo the election on their own say-so.

Unsurprisingly, Republicans are opposed to a redo in the 28th District. No doubt Democrats would be opposed if their candidate were in the lead. For the judge, that should be irrelevant.

The GOP’s opposition is understandable given that it is clinging by its cuticles to a House majority. Having controlled nearly two-thirds of the chamber’s seats going into the November elections, it got hammered statewide, losing at least 15 seats, and emerged with a 51-to-49 edge — including not only Mr. Thomas’s tainted “victory” in the 28th District but also a downstate seat in which the Republican candidate leads by just 10 votes heading into a recount. If either seat slips away, the GOP will have to share power with Democrats in the House; if the Republicans lose both seats, the Democrats will take control of the chamber for the first time since 2000.

But whatever the statewide stakes, residents in the 28th District deserve a clean election, one unsullied by some voters who were ringers and others who were disenfranchised. On Wednesday, Democrats asked U.S. District Judge T.S. Ellis III to order a new election. Given that the last one is irreparable, he should do just that.