RALEIGH, N.C. (AP) — A federal appeals court ruled that a North Carolina law illegally targeted minorities with tougher ballot access rules, such as requiring photo identification to vote, adding a new partisan flashpoint in a swing state with a raft of hotly contested elections. The ruling Friday by the 4th Circuit Court of Appeals declared that the 2013 law violated the Constitution and the federal Voting Rights Act by targeting black voters "with almost surgical precision." The law, passed two years after Republicans took control of the state legislature for the first time in a century, sought to entrench GOP politicians in power, the opinion by a three-judge panel of the court stated. The decision overturned a federal district judge's April ruling that didn't find proof the law made it harder for minority voters to cast ballots. The decision was lauded by Democrats, including presidential nominee Hillary Clinton, as a victory for democracy and decried by Republicans as an effort to tilt the balance in elections this fall that could be won by either party. North Carolina legislators imposed the photo ID requirement, curtailed early voting and eliminated same-day registration and voters' ability to cast out-of-precinct provisional ballots in their home counties.