A Pennsylvania judge on Wednesday refused to grant an injunction on a new voter identification law that Democrats say could harm President Obama’s re-election chances by unfairly targeting minorities, college students and others in a key swing state.

The decision by Robert Simpson, a commonwealth court judge, clears the way for Pennsylvania to require voters in the Nov. 6 general election to produce photo identification before they are allowed to cast ballots.

Opponents, who had challenged the law’s constitutionality, had asked Judge Simpson to delay the law’s imposition until after the election. Supporters say the law, variations of which have been passed in other states in recent years, is necessary to prevent voting fraud.

The Pennsylvania law was approved earlier this year by the State Legislature along party lines and signed into law in March by Gov. Tom Corbett, a Republican.

The American Civil Liberties Union is expected to appeal the decision to the State Supreme Court, which is split evenly between Democrats and Republicans. A tie would affirm the law.