A federal judge issued an emergency injunction just four days before Election Day, forcing local elections boards to restore voters who were purged from rolls.

U.S. District Judge Loretta Biggs issued the ruling after an emergency hearing earlier in the week on NAACP allegations that at least three counties purged voter rolls through a process disproportionately targeting black voters.

State officials are scrambling and worked well into Friday night after the ruling came down.

"Our agency is working quickly to establish the procedures necessary to comply with the court order between now and Election Day," said North Carolina State Board of Elections Executive Director Kim Westbrook Strach.

Thousands of North Carolina voters who were removed from the rolls and told they couldn't vote will now be able to cast their ballot Tuesday.

The NAACP filed a lawsuit Monday.

"We will not back down and allowed this suppression to continue," said North Carolina NAACP President William Barber. "This emergency injunction will help make sure that not a single voter's voice is unlawfully taken away."

The civil rights group argued there was an attempt to suppress minority vote.

"Voter fraud is a lie, but voter suppression is alive and we have to fight it at every turn," Barber said.

The State Board of Elections have said that the lawsuit concerned about 4,500 people whose registrations were challenged in the 90-day period.

Private citizens can challenge another voter's residence based on returned mail.

Hearings are then held and often the voter in question is removed from the rolls.

100-year-old Beaufort County resident Grace Hardison was told she couldn't vote. She wrote President Barack Obama and he shared her plight Friday at a rally at Fayetteville State University.

"They targeted the wrong woman," he said before the crowd. "She could be your grandmother, your great-grandmother."

A federal judge issued an injunction and ordered the election boards to restore voter registrations that were canceled in Cumberland, Moore, and Beaufort counties.

The case is going to trial and is scheduled for after the election.

The State Board of Elections hasn't decided whether officials will appeal the ruling.

"This emergency injunction will help make sure not a single voters' voice is unlawfully taken away," Barber said. "The NAACP is defending rights of all North Carolinians to participate in this election and we will not back down and allow this suppression to continue. This is our Selma."