A federal judge on Friday ruled Georgia must allow more than 3,000 people to vote in this year's midterm elections just four days before Election Day, siding against a Republican who both heads the state's election system and is running for governor just four days before Election Day.

The case stemmed out of concerns Republican nominee Brian Kemp was purging voters from the rolls and a new exact match voting law was targeting minorities. He's running in a tight race against Democrat Stacey Abrams, who, if elected, would be the first black woman governor in the nation's history.

Polls show Abrams running close behind Kemp, who also serves as the Secretary of State. Critics have said the exact match law disproportionately affects minorities and thus will keep them from voting in the historic race.

On Friday, U.S. District Court Judge Eleanor Ross agreed in part. She filed an injunction, granting an emergency request that will allow 3,141 people to vote on Tuesday who were originally barred because of the exact match law. Those individuals were flagged due to citizenship issues and are primarily minorities.

Ross wrote in the 36-page order the court had "grave concerns" about "the differential treatment inflicted on a group of individuals who are predominantly minorities."

"The election scheme here places a severe burden on these individuals," Ross wrote in the order.

More:Will Georgia voting controversies discourage voters from turning out?

More:Georgia NAACP files complaints alleging voting machines incorrectly registered votes

More:Federal judge blocks Georgia from throwing out absentee ballots based on signature mismatches

The injunction is part of a larger lawsuit filed by a number of civil rights groups who sued on behalf of more than 50,000 people flagged as ineligible to vote.

"This is just the tip of the iceberg of the sort of obstacles that are being placed in front of voters — disproportionately minority voters. We will continue to fight to knock every one of them down," said Kristen Clarke, president and executive director of the Lawyers’ Committee for Civil Rights Under Law, one of the group's behind the lawsuit. "For now, we are thrilled that this order will allow over 3000 voters to vote this Tuesday without being subjected to unnecessary hurdles."

Georgia's 2018 election is the first under the state's exact match law, which requires voter registration applications to precisely match information on file with the state's motor vehicle department or the Social Security Administration. Those voters whose names don't match exactly are placed on a "pending" list for further scrutiny.

Some mismatches are triggered by variations in a name, like a dropped hyphen, accent mark or middle initial, or because of data entry errors. Critics of the law say minorities are more likely to have names with those features, thus making it harder for them to vote. The NAACP said about 70 percent of those affected by exact match in the state are black.

Other people are also flagged as potential noncitizens, often because the state driver’s license database hasn’t been updated to reflect their naturalization. Roughly 51,100 Georgians have been flagged as ineligible to vote because of such registration problems.

The judge ruled the state unfairly burdened the 3,000 individuals whose registration was flagged for citizenship issues because only a deputy registrar is allowed to clear them to vote a regular ballot when the voters show proof of citizenship at the polls.

She noted voters flagged for issues other than citizenship can be cleared by any poll worker after showing a photo ID.

A spokeswoman for state Attorney General Chris Carr did not immediately say whether the state would appeal. Spokeswoman Katie Byrd said state attorneys were reviewing the order.

Also Friday, a federal appeals court rejected Kemp's request to stay a ruling that will prevent the state from tossing absentee ballots over signature issues.

Kemp requested the stay so he could appeal the decision. Civil rights groups applauded the decision.

"Once again, a court has blocked Georgia’s attempt to obstruct voters," said Sophia Lakin, an attorney with the ACLU. "This ruling is a huge victory as we round the final turn to the midterms."

Abrams and voting rights groups have accused Kemp of using his office to suppress votes and tilt the election.

Kemp rejects the charge. His campaign spokesman told USA Today that Kemp has made it "easy to vote and hard to cheat in Georgia."

"Any accusations to the contrary are absolutely baseless," spokesman Cody Hall said. "Right now, we have more people on the voting rolls than ever before. That's because of online voter registration championed by Brian Kemp. We also have record turnout for early voting."

Contributing: Nicquel Terry Ellis and the Associated Press