A federal judge in Florida ruled late Thursday that a state rule prohibiting former felons from voting in elections is unconstitutional and should be changed as soon as possible.

U.S. District Judge Mark Walker sided with voting rights organization Fair Elections Legal Network, the group that sued Republican Gov. Rick Scott after a handful of people who had completed their sentences and applied for voting rights were rejected.

“A person convicted of a crime may have long ago exited the prison cell and completed probation,” Walker wrote. “Her voting rights, however, remain locked in a dark crypt. Only the state has the key — but the state has swallowed it.”

Walker said he will decide how to fix the process. In the upcoming November election, Florida voters will decide on a constitutional amendment to give ex-cons voting rights immediately upon their release. The measure needs 60 percent support to pass.

The current rule allows the governor and three Cabinet members to consider reinstating a former prisoner's voting rights on a case-by-case basis, which Walker found to be flawed. He cited evidence that Scott restored voting rights to a white man who voted illegally, but didn't do the same for a black man in the same situation.

About 3,000 former prisoners have had their voting rights restored since 2011, when the policy went into effect.

Scott's office defended itself from the judge's decision and said the clemency board has existed for decades and been overseen by multiple governors.

"The process is outlined in Florida’s Constitution, and today’s ruling departs from precedent set by the United States Supreme Court," John Tupps, Scott’s communications director, said in a statement. "The governor believes that convicted felons should show that they can lead a life free of crime and be accountable to their victims and our communities. While we are reviewing today’s ruling, we will continue to defend this process in the court."