(CNN) A judge said he will order a Georgia Legislature district to redo a primary election between two Republicans because errors in voter data called the results into question.

The announcement came in response to a lawsuit filed by state Rep. Dan Gasaway that challenged the legitimacy of the election he lost by 67 votes to businessman Chris Erwin in May. Following his loss, Gasaway personally examined voter rolls and determined that "cross-contamination" in his district's voter information had led to at least 67 people voting in the wrong district, according to his lawsuit.

At a hearing for the case Tuesday in Northeast Georgia's Banks County, Judge David Sweat said it was unclear who the misallocated residents would have voted for, therefore a new election was required.

"The court's real concern is that people have confidence in our elections," Sweat said.

Gasaway told CNN he felt vindicated by the judge's decision and he plans to start campaigning all over again.

"We've worked on this for a very long time. It's important for voters to know that their votes matter," he said.

The repeat primary election will be on Dec. 4, and because there is no Democratic challenger, the winner will automatically become the district's state representative, according to the judge's order signed on Thursday.

Laurel Ellison, who was listed as a co-defendant in the lawsuit as the elections supervisor for Habersham County, where most of the errors occurred, said at Tuesday's hearing that some of the discrepancies had been caused by complications in the county's redrawing of district lines in recent years.

She said that in some places the district line "splits down the middle" of properties and county officials have had to decide which district those properties' residents should vote in. Ellison said the county had determined that 70 people voted in the wrong district in May.

Mark Davis, president of Data Productions Inc., a voter-data consulting company that has previously worked for Gasaway's campaign, testified Tuesday that he also found errors in Gasaway's district but that such discrepancies "exist all over the state. It's not anything unique to this district."

Davis said he has long called for a state-level overhaul to address what he characterized as widespread errors in Georgia voter rolls.

Gasaway told CNN he has counted about 1,200 misplaced voters within House District 28, which he represents, or the districts that surround it, though he said not all of those residents voted in his district's May 22 primary.

Bryan Tyson, an attorney for Gasaway's opponent, Erwin, argued Tuesday that the methods Gasaway had used to calculate the discrepancies were not specific enough because he did not rely on references to official census tracts. The judge rejected that argument, however.

Erwin said he was considering whether to appeal.

Georgia can keep using voting machines

Tuesday's hearing came the day after a federal judge presiding over a separate lawsuit ruled that Georgia can continue using electronic voting machines. That federal suit described discrepancies in voter data and confusing issues at polling places in other parts of Georgia and argued the state should implement paper-ballot-based voting ahead of November's midterm elections so that results can be audited.

Although the federal judge denied the plaintiff's request to switch to paper ballots on the grounds that such a change would be too close to the November elections, she criticized the state's handling of its voter system.

US District Judge Amy Totenberg wrote that "state elections officials had buried their heads in the sand" by downplaying the severity of some of the concerns raised in the suit, such as the exposure of information on more than 6 million registered Georgia voters, password files and encryption keys.

"The State of Georgia Defendants have delayed in grappling with the heightened critical cybersecurity issues of our era posed for the state's dated, vulnerable voting system that provides no independent paper audit trail," Totenberg wrote.

Secretary of State Brian Kemp, who oversees the state's elections and is running as the Republican candidate for governor, has repeatedly said Georgia's voting system remains secure and that changes to the system ahead of November's elections are unnecessary. Kemp also leads a state commission that is exploring ways to upgrade Georgia's aging voting system.

In reaction to the federal judge's ruling, Kemp said, "With this ruling behind us, we will continue our preparations for a secure, orderly election in November."

His office had previously opened an investigation into the apparent errors in the May primary in Gasaway's district but not yet publicly released findings.

A spokesperson had directed CNN's questions about the apparent errors to Habersham County. "Under state statute, properly districting voters is a county responsibility," she said.

This story has been updated.