Local civil-rights groups and black leaders have urged the district attorney to drop the prosecution, saying that black voters were being disproportionately punished for an unwitting mistake. African-Americans in North Carolina are more likely to be disqualified from voting because of felony convictions; their rate of incarceration is more than four times that of white residents, according to the Prison Policy Initiative, a nonprofit organization.

“It smacks of Jim Crow,” said Barrett Brown, the head of the Alamance County N.A.A.C.P. Referring to the district attorney, he added, “I don’t think he targeted black people. But if you cast that net, you’re going to catch more African-Americans.”

Mr. Nadolski said that race and ethnicity are not a factor in any case he prosecutes.

The prosecution comes even as several states are reconsidering longstanding laws that strip voting rights from an estimated 6 million Americans who have been convicted of felonies. A growing national movement is encouraging former felons to register to vote, or to push to have their rights restored, with the hope of empowering them and shedding the stigma of criminal convictions.

[ Read a Q. and A. with Jack Healy about the case and American election law. ]

The North Carolina case also has become part of a partisan war over voting rights ahead of this November’s midterm elections. At a rally on Tuesday, President Trump — who has made baseless claims that millions of people voted illegally in 2016 — renewed his calls for laws requiring voters to show photo identification. He said, incorrectly, that shoppers need to show identification to buy groceries, while people voting for president and senator do not.

When asked Wednesday about the president’s comments, Sarah Huckabee Sanders, the White House press secretary, said that Mr. Trump “wants to see the integrity of our elections system upheld.”

In separate interviews, five of the defendants in Alamance County said their votes were an unwitting mistake — a product of not understanding the voter forms they signed and not knowing the law.