RALEIGH, N.C. -- A federal appeals court has found that a North Carolina voter ID law was enacted "with discriminatory intent" and must be blocked.

An opinion issued Friday by a three-judge panel of the 4th Circuit Court of Appeals in Richmond reverses a lower-court's ruling that had upheld the law.

The 2013 rewrite to voting laws in North Carolina required photo identification to cast in-person ballots and made other changes.

Get Breaking News Delivered to Your Inbox

The U.S. Justice Department, state NAACP, League of Women Voters and others sued the state, saying the restrictions violated the remaining provisions of the federal Voting Rights Act and the Constitution.

In the opinion, the court found that the law was intentionally written to deprive black citizens in the state of their right to vote. This finding of intent is incredibly rare in voting rights cases.

"In holding that the legislature did not enact the challenged provisions with discriminatory intent, the [lower] court seems to have missed the forest in carefully surveying the many trees," the panel wrote in its opinion.

The opinion later states: "We cannot ignore the record evidence that, because of race, the legislature enacted one of the largest restrictions of the franchise in modern North Carolina history,"

The decision is considered a major victory for voting rights advocates and North Carolina residents who previously had no problem voting before the law was enacted won't face issues now from requirements that the law would have imposed on them.

It also comes only a few months ahead of the general election in a swing state that could help determine the outcome.

North Carolina is expected to appeal the ruling to the full 4th Circuit.

This comes only a week after the a federal appeals court ruled that a strict voter ID law in Texas discriminates against minorities and the poor and must be weakened before the November election.