(CN) - The Fourth Circuit on Friday struck down North Carolina's restrictive voter ID law, ruling that it was enacted with "discriminatory intent.'

The unanimous ruling (pdf) also invalidated changes the state's Republican lawmakers made to early voting, same-day registration, out-of-precinct voting, and preregistration rules.

"The record makes clear that the historical origin of the challenged provisions in this statute is not the innocuous back-and-forth of routine partisan struggle that the State suggests and that the district court accepted," U.S. Circuit Judge Diana Motz wrote on behalf of the three-judge panel. "Rather, the General Assembly enacted them in the immediate aftermath of unprecedented African American voter participation in a state with a troubled racial history and racially polarized voting. The district court clearly erred in ignoring or dismissing this historical background evidence, all of which supports a finding of discriminatory intent."

The panel, which included U.S. Circuit Judges James Wynn and Henry Floyd, found the 2013 voting rules changes violated the U.S. Constitution and the Voting Rights Act.

While the judges were unanimous on the motivations behind the law, Motz dissented in part from the remedy the appeals court ordered.

She noted that the state loosened the photo-ID requirement a bit in 2015 by allowing voters without acceptable ID to vote if they signed an affidavit saying they had a "reasonable impediment" to getting one.

Motz said in regard to this one part of the states voting regime, she would have temporarily banned the photo ID requirement, rather than subject it to a permanent injunction.

The state did not immediately respond to the ruling. It does have the option of appealing the decision to the full Fourth Circuit, or it can appeal directly to the U.S. Supreme Court.

"With surgical precision, North Carolina tried to eliminate voting practices disproportionately used by African-Americans. This ruling is a stinging rebuke of the state's attempt to undermine African-American voter participation, which had surged over the last decade," Ho said.

Added Southern Coalition for Social Justice senior attorney Allison Riggs: "We applaud the appeals court for recognizing the discriminatory intent behind and effect wrought by the 2013 monster law. Because of this ruling, North Carolinians will now be able to register and vote free of the obstacles created by the Legislature in 2013."

On Friday afternoon, Attorney General Loretta Lynch added her voice to those comment on the ruling, saying she was pleased the Fourth Circuit struck down a law the court described as "one of the largest restrictions of the franchise in modern North Carolina history."

"As the court found, this law was passed with discriminatory intent. It targeted African-Americans 'with almost surgical precision' — imposing stringent ID requirements, reducing same-day registration and constraining out-of-precinct voting to place barriers between citizens and the ballot box. And it sent a message that contradicted some of the most basic principles of our democracy," Lynch said. "The ability of Americans to have a voice in the direction of their country — to have a fair and free opportunity to help write the story of this nation — is fundamental to who we are and who we aspire to be. Going forward, the Department of Justice will continue our work to protect that sacred right for all."