A three-judge panel of the U.S Court of Appeals for the 4th Circuit has found North Carolina’s controversial GOP-backed voting restrictions were intended to discriminate against African American voters.

The Friday ruling is a huge win for voting rights activists in a closely watched case in a potential 2016 swing state. The appeals court reversed the ruling of a district court siding with the state.

“In holding that the legislature did not enact the challenged provisions with

discriminatory intent, the court seems to have missed the forest in carefully surveying the many trees,” the opinion said. It permanently blocked provisions in a 2013 North Carolina law that required certain photo IDs to vote, limited early voting, eliminated same day registration, ended out-of-precinct voting and prohibited pre-registration of young voters.

In the opinion, the panel of judges said that the law restricted voting in ways that “disproportionately affected African Americans” and that its provisions targeted “African Americans with almost surgical precision.” It said the state’s defense of the law was “meager.”

“Thus the asserted justifications cannot and do not conceal the state’s true motivation,” the opinion said.

It noted that the legislation was passed as African American voter turnout had expanded to almost the rates of whites, and that the legislature enacted the legislation after the Supreme Court gutted the Voting Rights Act, which had required North Carolina to seek federal approval for changes to its voting policies. The appeals court — citing a lower court’s findings — pointed out that state lawmakers sought data breaking down voting practices by race. The judges said that the law’s provisions singled out the practices disproportionately popular among African Americans, such as preregisteration and provisional voting.

“The district court found that not only did SL 2013-381 eliminate or restrict these voting mechanisms used disproportionately by African Americans, and require IDs that African Americans disproportionately lacked, but also that African Americans were more likely to ‘experience socioeconomic factors that may hinder their political participation,'” the opinion said.

The partially-split appeals court opinion was mostly written by Judge Diana Motz, a Clinton-appointee. She was joined by Judges James Wynn and Henry Floyd, both Obama-appointees. The Obama appointees said in a seperate section of the opinion that no remand down to a lower court to reconsider a remedy for the voter ID requirement of law was necessary, arguing that no remedy would fix the problem that the law was passed with a discriminatory intent. Judge Motz dissented from that section, saying she would have asked for a remand.

The appeals court questioned the lower court’s decision not finding discriminatory intent. It criticized the lower court for resting that conclusion on the fact the voting practices that Republican lawmakers had prohibited had been enacted by a previous, Democratic-controlled legislature.

“Thus, the district court apparently considered SL 2013-381 simply an appropriate means for one party to counter recent success by another party,” the appeals court opinion said. “We recognize that elections have consequences, but winning an election does not empower anyone in any party to engage in purposeful racial discrimination.”

The case was a consolidation of a number of lawsuits challenging the legislation, brought by various civil rights organizations and voter advocacy groups, on behalf of voters. The Department of Justice also participated in the litigation, siding with the challengers.

The appeals court declined the request of the challengers to put North Carolina back under “preclearance” — the requirement for federal approval of voting laws in certain states that was partially dismantled by the Supreme Court in 2013 — as is allowed by Section 3 of the Voting Rights Act when discriminatory intent is found. The appeals court said the remedy was “rarely used” and “not necessary” in this case.

Read the full decision: