The ruling is likely to be seen as a boost for Democratic presidential nominee Hillary Clinton in a state that is politically important as it does not lean heavily toward either Democrats or Republicans. Clinton is heavily favored among black Americans over Republican nominee Donald Trump.
The court also struck down other restrictions that scaled back early voting, prevented residents from registering and voting on the same day, and eliminated the ability for voters to vote outside their assigned precinct.
Critics argue that photo ID laws enacted by North Carolina and several other states are designed to drive down turnout by minorities and poor people who are less likely to possess drivers' licenses or other forms of state-issued identification.
In its ruling, the U.S. Appeals Court for the Fourth Circuit said the state legislature targeted African-Americans "with almost surgical precision."
"We can only conclude that the North Carolina General Assembly enacted the challenged provisions of the law with discriminatory attempt," the court wrote.