The Corbett administration has 30 days to file an appeal to the state Supreme Court.
Joshua Maus, spokesman for the Office of General Counsel, said the office was reviewing the ruling.
Lawyers representing plaintiffs in the case praised the ruling.
"The court confirmed that the photo ID law is unnecessary and disenfranchises hundreds of thousands of people," said Jennifer Clarke, executive director of the Public Interest Law Center of Philadelphia. "We call on the governor, the attorney general, and the secretary of state to stop spending our precious state dollars on defending this law, so dangerous to our democratic system."
The administration has spent about $6 million in state and federal funds to educate voters about the law and $1 million in state funds to the Philadelphia law firm Drinker Biddle to help defend it.
Gov. Corbett signed the voter ID bill - considered among the strictest in the nation - in March 2012 after protracted legislative debate and public protests along partisan lines.
Republicans said showing an ID would reduce voter fraud, while Democrats contended the limited types of valid ID would bar access to the polls, particularly among minorities, the elderly, students, and low-income voters.
The law has been on hold because of the litigation. Poll workers were allowed to ask for but not demand ID for voting.
Both sides agreed that the law would not be enforced during 2014 elections.