A Pennsylvania judge on Friday struck down a controversial law requiring voters to show photo identification before they cast their ballots, the latest ruling in what has become a nationwide battle over voter ID laws.

Commonwealth Court Judge Bernard L. McGinley ruled that Pennsylvania’s voter identification law is unconstitutional and places an unreasonable burden on people trying to exercise their right to vote.

“Voting laws are designed to assure a free and fair election; the Voter ID law does not further this goal,” McGinley wrote in a 103-page decision. McGinley’s ruling sets up a showdown in the Pennsylvania Supreme Court.

Challenges to new voter ID laws have been a part of an escalating legal battle across the country during the past two years. Critics say the laws — passed by eight states in 2011 — can hurt turnout, primarily among minority voters.

Supporters of the measures — seven of which were signed by Republican governors and one by an independent — said they were needed to combat voter fraud. Pennsylvania’s voter ID law was passed by a Republican-controlled legislature and signed by Republican Gov. Tom Corbett in March 2012. It had been delayed by the courts and was not implemented in the 2012 election.

On Friday, civil rights groups and other opponents of voter ID laws cheered McGinley’s decision.

“Today Judge McGinley delivered a devastating indictment of the Pennsylvania voter ID law,” said Michael A. Rubin, whose law firm, Arnold & Porter, joined the American Civil Liberties Union of Pennsylvania and other lawyers to represent groups challenging the law, such as the NAACP and the Homeless Advocacy Project in Philadelphia.

James D. Schultz, general counsel to Corbett, said in a statement the state was still weighing whether to appeal. “We continue to evaluate the opinion and will shortly determine whether post-trial motions are appropriate,” he said.

McGinley ruled that several aspects of the voter ID law’s implementation failed to ensure that residents would have sufficient access to voting ballots. Although Pennsylvania officials said they would establish mobile units to provide photo IDs to residents who did not have them, McGinley said that there were not enough of those units and that the wait times for residents would be lengthy. Many license offices, he added, are open only a couple of days per week.

He concluded, however, that the plaintiffs had not specifically proved that the law was intentionally discriminatory, as defined under the Pennsylvania constitution.

“The relevance of this ruling to other voter ID challenges is somewhat limited,” Richard L. Hasen, an election-law expert at University of California at Irvine, said on his Election Law Blog. “The findings on implementation are state specific and don’t really carry over to other states.”

The Justice Department has sued North Carolina and Texas over their voter ID laws, saying they represent a broad threat to the democratic process.

The Supreme Court last year invalidated a key section of the 1965 Voting Rights Act that had required jurisdictions with a history of discrimination to receive approval from the Justice Department or a federal court before they could make changes in their voting laws. The department is relying on another section of the act to bring the lawsuits against North Carolina and Texas.

Aaron Blake and Juliet Eilperin contributed to this report.