Tuesday's ruling comes just five weeks before the election. An appeal is possible. The 6-month-old law requires each voter to show a valid photo ID.
Democrats and groups including the AARP and NAACP mounted a furious opposition to a law Republicans say is necessary to prevent election fraud.
Critics have accused Republicans of using old-fashioned Jim Crow tactics to steal the White House and have highlighted stories of registered voters struggling to get a state photo ID.
The law was already a partisan lightning rod when a top Republican lawmaker boasted that it'd allow GOP nominee Mitt Romney to beat Democratic President Barack Obama in Pennsylvania.
(Copyright 2012 by The Associated Press. All Rights Reserved.)