In a ruling with implications for the presidential race, a judge on Wednesday rejected an effort by civil rights groups to block Pennsylvania’s voter-ID law, legislation that Republicans say is needed to prevent fraud at the polls this fall.

Commonwealth Court Judge Robert E. Simpson, a Republican, rejected the complaint that sought an injunction to prevent the law from taking effect. The measure, approved by the Republican-controlled legislature this spring, requires voters to show a state-approved photo ID such as a driver’s license in order to vote.

While not ruling on the merits, the judge said in a 70-page decision that the law’s provisions “are neutral and nondiscriminatory and apply uniformly to all voters.”

“The statute simply gives poll workers another tool to verify that the person voting is who they claim to be,” the court said.

The ruling is the latest salvo in an escalating election-year debate over voting rights, with the Obama administration opposing voter-ID laws. Ten states controlled by Republican legislatures have adopted such measures in the past three years, with Democrats and their allies challenging many of those statutes.Wisconsin’s voter-ID law is blocked; lawmakers in Missouri failed in a recent attempt to pass similar legislation.

Thirty-two states have introduced voter-ID measures this year, either new proposals or legislation to strengthen existing laws. Republicans argue that the laws are necessary to prevent fraud, including voting by people who aren’t U.S. citizens.

The Justice Department of the Obama administration is suing to block similar voter-ID laws in Texas and South Carolina, and is evaluating whether to file a lawsuit against the Pennsylvania measure.

In New Hampshire, another battleground state, a coalition of liberal groups asked the Justice Department on Wednesday to oppose that state’s new voter-ID and voter-registration laws, which Democrats claim will result in voter suppression.

If the Pennsylvania ruling stands, it could affect the presidential election in November. Democrats have carried Pennsylvania in every presidential contest since 1992, largely on the strength of the Democratic bastion of Philadelphia, where Republicans are outnumbered by about 6-to-1. But an estimated 18 percent of Philadelphia residents do not have state photo IDs. Statewide, about 9 percent of residents lack the proper identification.

House Majority Leader Mike Turzai, Allegheny County Republican, predicted in June that the new law would help Republican presidential candidate Mitt Romney carry Pennsylvania in November. Barack Obama won the state in 2008 by about 10 percentage points over Republican John McCain.

The judge called Mr. Turzai’s comments “disturbing and tendentious,” but said there was no evidence that other Republican members of the legislature shared his “boastful views.” Therefore, the court said, there wasn’t proof of partisan motivation for the legislation.

Every Democratic legislator voted against the measure, which was signed into law by Gov. Tom Corbett, a Republican.

The ACLU and other groups opposed to the law said they will appeal. They argue that the law will disenfranchise thousands of voters, especially lower-income residents and minorities.

Rep. Chaka Fattah, Pennsylvania Democrat, said the ruling puts the right to vote “at the mercy of unreasonable burdens on our senior citizens, our college students, on minorities, on those who don’t have driver’s licenses, and those who may have been born in another state where life-cycle record-keeping is, or was, unreliable.

“A fair hearing in Pennsylvania’s Supreme Court will restore full voting rights to hundreds of thousands of Pennsylvanians facing disenfranchisement,” Mr. Fattah said in a statement.

But Michael Dimino, associate professor of law at Widener University School of Law in Harrisburg, Pa., said the state Supreme Court isn’t likely to rule on the case before the election.

“This decision makes it much more likely that the law will be in place for this November’s election,” Mr. Dimino said.

He added that the judge’s fact-finding in support of the law lessens the chance that the state’s high court will invalidate the measure.

“Commonwealth Court said it was unconvinced that anybody would be prevented from casting a vote because of this law,” Mr. Dimino said. “That makes it much more difficult to overturn this law.”

The Pennsylvania court relied in part on a 2008 U.S. Supreme Court ruling that upheld a similar photo-ID law in Indiana. Judge Simpson said the Pennsylvania law’s photo-ID requirement is “reasonable … when viewed in the broader context of the widespread use of photo ID in daily life.”

“The Commonwealth’s asserted interest in protecting public confidence in elections is a relevant and legitimate state interest sufficiently weighty to justify the burden,” the judge wrote.

Judge Simpson said he thought that state officials and agencies are resolving problems with the law and that they would carry it out by November in a “nonpartisan, even-handed manner.”

The case now heads to the state Supreme Court, which is evenly divided with three Republicans and three Democrats. Opponents of the law would need four votes to prevail there. A seventh Supreme Court justice, Republican Joan Orie Melvin, was relieved of her duties in May because of criminal charges against her alleging that she used court staffers to work on her election campaigns.