A federal appeals court on Friday struck down the heart of a North Carolina voting law seen as the strictest in the nation, finding that Republican lawmakers intentionally discriminated against African-Americans when they passed it.

A divided 4th Circuit U.S. Court of Appeals ruled that the measure’s provisions “target African-Americans with almost surgical precision.”

The ruling is just the latest court win for voting rights advocates. A different federal appeals court ruled this month that Texas’s voter ID law is racially discriminatory and must be softened. And a district court softened Wisconsin’s ID law, too, though that decision is being appealed.

Related: Cutbacks to Poll Monitor Program Raise Voter Intimidation Fears

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

North Carolina Senate Leader Phil Berger and House Speaker Tim Moore said of the ruling, "we can only wonder if the intent is to reopen the door for voter fraud, potentially allowing fellow Democrat politicians like Hillary Clinton and Roy Cooper to steal the election. We will obviously be appealing this politically motivated decision to the Supreme Court.”

The voting law imposed a voter ID requirement, cut early voting opportunities, eliminated same-day voter registration and banned out-of-precinct voting, among other provisions.

The court found that by 2013, African-American registration and turnout rates had reached near parity with those of whites. But weeks after the Supreme Court weakened the Voting Rights Act in Shelby County v. Holder in 2013, Republicans said they planned to enact an “omnibus” voting law. The court's ruling continued: “Before enacting that law, the legislature requested data on the use, by race, of a number of voting practices. Upon receipt of the race data, the General Assembly enacted legislation that restricted voting and registration in five different ways, all of which disproportionately affected African-Americans.”

Attorney General Loretta Lynch praised the appeals court's decision.

"I am pleased that the Court of Appeals for the Fourth Circuit has struck down a law that the court described in its ruling as 'one of the largest restrictions of the franchise in modern North Carolina history,'" she 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."

While Texas and Wisconsin's voter ID laws were softened rather than eliminated, the appeals court rejected that approach here, saying even a softened ID provision would still have a discriminatory impact.

The election law scholar Rick Hasen called the ruling "a very big win for voting rights plaintiffs and the [U.S. Justice Department]," who had challenged the law.

Related: Texas Voter ID Ruling Offers Stinging Rebuke to Law's Backers

“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,” said Dale Ho, director of the ACLU's Voting Rights Project. “It is a major victory for North Carolina voters and for voting rights.”

A district court earlier this year upheld the law. But the appeals court found that the lower court erred by seeing the law’s goals as partisan rather than race-based. The state’s history of racial discrimination in voting, the appeals court said, “highlight[s] the manner in which race and party are inexorably linked in North Carolina. This fact constitutes a critical — perhaps the most critical — piece of historical evidence here. The district court failed to recognize this linkage, leading it to accept "politics as usual; as a justification for many of the changes in [the voting law]. But that cannot be accepted where politics as usual translates into race-based discrimination.”