Commonwealth Court Judge Bernard L. McGinley, a Democrat, said the law would unreasonably burden the fundamental right to vote, and the state had been unable to convincingly explain why it was necessary.
"Voting laws are designed to assure a free and fair election; the Voter ID Law does not further this goal," McGinley wrote in his 103-page ruling.
The law, one of the strictest in the nation, was signed by Republican Gov. Tom Corbett in March 2012 over the protests of every single Democratic lawmaker in Pennsylvania's Republican-controlled Legislature.
Enforcement of the law has been blocked by court orders pending resolution of the constitutional challenge. Both sides had vowed to appeal a negative decision to the Pennsylvania Supreme Court.
A spokesman for Corbett did not immediately respond to a request for comment. Lawyer Witold J. Walczak of the American Civil Liberties Union, which helped lead the legal challenge, said "the act was plainly revealed to be nothing more than a voter suppression tool."
Pennsylvania's Democratic leaders charged that the law was a cynical attempt by Republicans to hold down balloting by seniors, minorities and other Democratic-leaning groups in the last presidential election. Republicans called it an election-security measure, but administration officials acknowledged that they knew of no examples of voter impersonation.
The legislation was approved during the presidential election campaign at a time other GOP-led states also were tightening their voting requirements - setting off a partisan clash that continued through Election Day.
At a 12-day trial, the plaintiffs including the National Association for the Advancement of Colored People, the Pennsylvania League of Women Voters and Philadelphia's Homeless Advocacy Project emphasized problems in processing and distributing a new voting-only ID card available for free to voters who lack other acceptable IDs. They said dozens of registered voters who applied for those cards before the 2012 election did not receive them before ballots were cast.
Lawyers for the state defended the law, arguing that a multimillion-dollar publicity campaign in 2012 and the refinement of the special voting-only card by the Pennsylvania Department of State educated voters about the requirements of the law and would ensure that any registered voter who lacks an appropriate ID can now get one.