Citizens vote on a basketball court at a recreation center serving as polling place in Greenville, N.C., on Nov. 8, 2016. (Jonathan Drake/Reuters)

WHEN ELECTION officials in North Carolina audited the 2016 vote, they found 441 ballots had been cast by felons on probation or parole who voted despite a state law barring them from the polls until their sentences are complete. Those votes were illegal, but most state prosecutors sensibly declined to bring charges on the grounds that the offenders didn’t know the law, weren’t alerted to their ineligibility and didn’t realize they had done anything wrong.

Not so in Alamance County, a small locality in the Piedmont where a dozen individuals convicted of felonies, nine of them African Americans, cast votes. There, the Republican district attorney, Pat Nadolski, has gone forward with prosecutions that reflect his own lack of judgment while reminding the nation of North Carolina’s recent poisonous racial history.

In North Carolina, where 70 percent of the population is white, blacks represent a hugely disproportionate share of convicted felons and incarcerated people. African Americans make up more than two-thirds of the 441 citizens statewide identified as having voted illegally.

In 2016, a federal court struck down the state’s restrictive voting law, enacted by the Republican-dominated legislature, saying the measure targeted blacks “with almost surgical precision.” This year, GOP lawmakers took a new tack, trying to place a proposal on the November ballot that would in the future scratch the final Saturday of early voting, a day that in recent years has attracted large numbers of blacks to the polls.

Voting laws, including for felons, vary enormously across the country. In some states the right to vote is restored automatically when people leave prison; in others, including North Carolina, felons are required to complete their sentences, including serving probation or paying fines, before their rights are restored. Elsewhere, ex-felons face waits of several years before they can regain voting rights. In two states, felons may vote even while incarcerated.

In the case of the Alamance 12, as they are now known, most seem to have had no intent to break the law; they were simply unaware of it. As it happens, a bill to require intent as a precondition for prosecuting illegal voters died this year in the state legislature.

Mr. Nadolski says race has nothing to do with his decision to seek sentences of up to two years for the crime of illegal voting. But context matters. This is North Carolina, where African Americans’ voting rights have been under siege. It is preposterous to impose prison sentences on people who cast an illegal vote without intending to break any law. And, even short of prison time, prosecution itself can leave an indelible stain on an individual’s record.

The prosecution of the Alamance 12 plays into the canard, peddled by President Trump and some other Republicans, that fraudulent voting poses a threat to the republic. In fact, there is no evidence that intentional voting fraud takes place in any significant numbers in North Carolina, where nearly 4.8 million ballots were cast in 2016, or anywhere else. The true offense is this kind of disproportionate prosecution. Republicans should ask themselves whether, in a democracy, it is admirable to find themselves continually on the side of those who are trying to discourage and narrow the vote.