(CN) - A federal judge ruled that Wisconsin must offer a way to let voters cast ballots without a photo ID, and found a restriction on absentee voting was intentionally crafted to suppress the black vote.

The Republican-backed 2011 law requiring photo identification at the polls was in effect during April's primary election. Voters have been fighting the law for years, arguing that people who cannot obtain an Act 23-qualifying ID with reasonable effort are entitled to relief.

On July 19, U.S. District Judge Lynn Adelman ruled that Wisconsin must let such voters execute an affidavit to receive a ballot.

U.S. District Judge James Peterson issued a ruling Friday in a separate case challenging voter ID laws, on behalf of older black voters born in the South who were never issued a birth certificate and therefore cannot get a valid Wisconsin photo ID.

His opinion (pdf) begins with a strong critique of current Wisconsin Supreme Court and Seventh Circuit precedent that has upheld voter ID laws because they purportedly protect the integrity of elections.

"The Wisconsin experience demonstrates that a preoccupation with mostly phantom election fraud leads to real incidents of disenfranchisement, which undermine rather than enhance confidence in elections, particularly in minority communities," Peterson said. "To put it bluntly, Wisconsin's strict version of voter ID law is a cure worse than the disease."

However, Peterson said precedent prohibits him from tossing out the state's voter ID law in its entirety. The 119-opinion orders the state to reform its process to ensure that it has a working safety net for qualified voters who cannot acquire an ID after making a reasonable effort.

The state's attempt at a functioning program to enfranchise all voters — the ID petition process, or IDPP — is "pretty much a disaster," Peterson said, as it requires "on average, five communications with the [Department of Motor Vehicles] after the initial application to get an ID."

Approximately 100 qualified voters tried to get an ID before this year's primary election through the IDPP but were unable to do so, according to Friday's ruling.

Judge Adelman issued an injunction last month requiring Wisconsin to allow qualified voters to execute an affidavit to receive a ballot.

Imposing his own remedy, Judge Peterson ordered the state to issue those who are in the IDPP to get receipts for voting, and to reform the IDPP to meet constitutional standards.

"I take this approach because it respects the state's decision to have a strict voter ID law rather than an affidavit system. But Wisconsin may adopt a strict voter ID system only if that system has a well-functioning safety net, as both the Seventh Circuit and the Wisconsin Supreme Court have held," Peterson wrote.

The judge also found that the Wisconsin voter ID law's restriction on hours for in-person absentee voting discriminates on the basis of race, as it was "specifically targeted to curtail voting in Milwaukee without any other legitimate purpose.

"The legislature's immediate goal was to achieve a partisan objective, but the means of achieving that objective was to suppress the reliably Democratic vote of Milwaukee's African Americans," Peterson said.

Peterson's ruling struck down restrictions on early voting hours, the elimination of weekend voting, and restrictions on the use of student IDs for voting.

The decision will have no effect on the August 2016 primary, but will be in force for the November 2016 general election.

"We argued Gov. Walker made it harder for Democrats to vote and easier for Republicans to cheat, and the judge agreed," lead plaintiff and One Wisconsin Now Director Scot Ross said in a statement. "Rather than make their public policy more inclusive, Republicans instead chose to rig the laws to rig the ballot box. We could not be more proud of this victory."