WINSTON-SALEM, N.C. (AP) — North Carolina’s process for challenging voters’ registration seems to harken to a bygone era when fewer safeguards were in place, a federal judge said Wednesday as she presided over a lawsuit that alleges voters are being purged unfairly.

Lawyers for North Carolina countered that state data shows only a sliver of names have been removed from county rolls in the past two years — fewer than 7,000 statewide out of 6.8 million registered voters.

The comments came during an emergency hearing over NAACP allegations that at least three counties purged voter rolls through a process disproportionately targeting blacks

Early voting is already underway in the critical swing state that the NAACP has previously sued over other voter access issues. So far, North Carolina’s black voter turnout has lagged the 2012 presidential election.

The NAACP says counties are violating federal law by removing voters less than 90 days before the election. However, state officials say the process complements federal law and preserves due-process rights.

U.S. District Judge Loretta Biggs said the process sounds “insane.”

“This sounds like something that was put together in 1901,” she told lawyers for the state.

Biggs also said she was “horrified” by the number of removals in Cumberland County, which accounted for most of the statewide total.

“It almost looks like a cattle call, the way people are being purged,” she told county attorney Rick Moorefield.

He replied that board members didn’t like the process, “but they felt compelled to follow the statute.”

The hearing ended without a ruling, but Biggs acknowledged time was dwindling before next week’s election.

The NAACP lawsuit cites Cumberland, Moore and Beaufort counties, where activists have challenged thousands of voters. The challengers include volunteers with the Voter Integrity Project, which says it wants to guard against voter fraud.

In most cases cited by the lawsuit, mail to a voter was returned as undeliverable, which county boards can accept as evidence the voter doesn’t live there.

Under state law, any voter can challenge another county resident’s registration, resulting in a hearing where the challenger presents evidence, according to a state legal filing. If local officials find probable cause, the challenged voter is notified of a subsequent hearing. A voter who doesn’t rebut the evidence can be removed.

Elections officials and the challengers say few attend the hearings; many have moved without updating their registration. Others have died.

Lawyers for North Carolina said a database shows eight counties removed nearly 6,700 challenged voters statewide in the past two years. A court filing by the state said Cumberland County removed the most — nearly 5,600 — followed by Moore with 790. Beaufort removed 63.

However, there appears to have been a recent uptick. At least 4,500 challenges were filed in the three counties in August and September, the State Board of Elections told the NAACP in a letter. It doesn’t say how many challenges were successful.

Campaigning in Chapel Hill on Wednesday and urging people to vote, President Barack Obama cited one of the plaintiffs in the lawsuit: a 100-year-old black woman from Beaufort County who rebuffed a registration challenge.

“If you don’t vote, then you’ve done the work of those who would suppress your vote without them having to lift a finger. Come on!” he said.

The U.S. Justice Department said in a court filing that if the NAACP allegations are true, they represent violations of the National Voter Registration Act.

The Justice Department writes that counties can’t remove voters “using only mail returned as undeliverable and without following specific required procedures,” nor can they carry out “systematic removals within 90 days of a Federal election.”

The NAACP lawsuit comes during a protracted battle over voter access in the state. In July, a federal court struck down much of a 2013 elections law, saying the GOP-controlled General Assembly had disproportionately targeted black voters. The ruling lengthened in-person early voting by a week and eliminated a photo ID requirement for in-person voting.

That ruling sparked disagreements among local Democratic and Republican election officials about the number of sites and hours for early voting.

Through Tuesday, blacks’ early voting participation in North Carolina lagged behind the same point in the 2012 election by 13 percent, said Catawba College political scientist Michael Bitzer. Black voters regained some ground after more voting sites opened last week, but he said it’s unclear if they can close the gap before early voting ends Saturday.

Bitzer believes the difference is largely due to less enthusiasm for Democrat Hillary Clinton’s race against Republican Donald Trump than for Obama’s 2012 re-election, but the uneven rollout of voting sites also contributed. He said he wasn’t familiar enough with the new NAACP allegations to weigh their effect.

“I have to think at this point it’s the top of the ticket,” Bitzer said.