Wisconsin residents who can't obtain photo identification will still be able to vote in November's general election, a federal judge ruled Tuesday, carving out an exception to state law that requires all voters to show photo IDs at the polls.

U.S. District Judge Lynn Adelman in Milwaukee issued a preliminary injunction that allows people who haven't been able to obtain IDs to vote in the Nov. 8 election if they sign an affidavit explaining why they couldn't get identification. But the judge declined to make that option available for the Aug. 9 primary, saying state election officials don't have enough time to prepare for it,

"Although most voters in Wisconsin either possess qualifying ID or can easily obtain one, a safety net is needed for those voters who can't obtain qualifying ID with reasonable effort," Adelman wrote. "The ... affidavit option is a sensible approach that will both prevent the disenfranchisement of some voters during the pendency of this litigation and preserve Wisconsin's interests in protecting the integrity of its elections."

Republican Attorney General Brad Schimel, whose state Justice Department is defending the photo ID mandate, said in a statement that the agency was disappointed with the injunction. He didn't commit to asking for the ruling to be put on hold, however, saying he would decide what to do next after agency attorneys analyze the decision.

The injunction marks another chapter in a long-running fight over Wisconsin's voter photo ID law. Republican lawmakers put the mandate in place in 2011, contending it would combat voter fraud, even though nothing suggests widespread voter fraud exists in the state. Democrats decried the requirement as an attempt to disenfranchise liberal-leaning voters such as minorities who are more likely to lack IDs.

The American Civil Liberties Union and the National Law Center for Homeless and Poverty filed a federal lawsuit that same year challenging the mandate as an unconstitutional burden on poor and minority voters. Adelman agreed with the groups, but a federal appeals court last year upheld the requirement and the mandate was in place for Wisconsin's presidential primary in April.

The groups have continued to argue, however, that voters who face high hurdles in obtaining a photo ID should be allowed to vote by affidavit. They maintain those voters include people who can't get IDs because of name mismatches or other errors in birth certificates or other supporting documents they have to produce to get an ID. They also say some people may need a credential from another agency but can't get it without an ID, putting them in an unresolvable situation, and that others might need a document that no longer exists.

Adelman wrote Tuesday in response to the group's June request for an injunction that state attorneys haven't produced any evidence showing that the affidavit option would undermine the integrity of Wisconsin elections. He also said any signer of the affidavit must swear to his or her identity and check off reasons for not obtaining an ID, ranging from a lack of transportation to family responsibilities.

The judge said there's no way to identify every person in the state who faces such hurdles to getting an ID, but he noted the state Division of Motor Vehicles has already denied IDs to more than 50 applicants. Sean Young, a senior staff attorney with the ACLU's Voting Rights Project, told The Associated Press that the group has evidence showing at least 1,000 voters fell into one of the affidavit categories.

"We're pleased with the result," Young said. "The injunction means that there will be a fail-safe this November for vulnerable voters who have difficulty obtaining IDs."