The 4th U.S. Circuit Court of Appeals has overturned major chunks of North Carolina’s broad election reform law passed in 2013, claiming that U.S. District Court Judge Thomas Schroeder committed factual errors when he threw out challenges to the law.

“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,” wrote Judge Diana Gribbon Motz. “This failure of perspective led the court to ignore critical facts bearing on legislative intent, including the inextricable link between race and politics in North Carolina.”

The ruling by the three judge appeals court panel, all appointed by Democratic presidents, affects the state’s voter ID requirement enacted by the Republican-controlled General Assembly. It also overturns the state’s law shortening early voting, eliminating same-day registration during early voting, out-of-precinct voting, and early registration programs that sign teenagers up to vote before they’re 18.

The appellate judges wrote that “contextual facts … reveal powerful undercurrents” in the state’s politics that must be taken into account when considering the 2013 law.

“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,” the opinion says. “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.”

Reaction to the decision was swift.

Sen. Bob Rucho, R-Mecklenburg, who helped write the law, didn’t hold back in his scathing criticism of the opinion and the judges.

Rucho said he was amazed at how “three Democrat judges can totally ignore 400 pages of facts and come up with a biased decision as they did that opens up the opportunity for voter fraud again by eliminating the photo ID [requirement] and all of the other common-sense efforts that were done in the election law.”

Schroeder’s opinion, handed down in April, was 485 pages.

Rucho said two other federal circuits have used North Carolina’s voter ID law as a model for other states.

“The Indiana case, in which the Supreme Court authorized and allowed voter ID, is just totally ignored by these judges,” Rucho said.

Rucho said that he suspects the 4th Circuit judges are using the 4-4 partisan split in the U.S. Supreme Court as an opportunity to push through such decisions without being checked by the higher court.

“Apparently, they think they are just immune to any kind of consequence for bad decisions,” Rucho said. He suggested Congress might impeach some of the judges.

Other Republicans also blasted the decision.

“Photo IDs are required to purchase Sudafed, cash a check, board an airplane, or enter a federal courtroom,” GOP Gov. Pat McCrory said. “Yet, three Democratic judges are undermining the integrity of our elections while maligning our state. We will immediately appeal and also review other potential options.”

Senate leader Phil Berger, R-Mecklenburg, and House Speaker Tim Moore, R-Cleveland, issued a joint statement responding to the ruling.

“Since today’s decision by three partisan Democrats ignores legal precedent, ignores the fact that other federal courts have used North Carolina’s law as a model, and ignores the fact that a majority of other states have similar protections in place, we can only wonder if the intent is to reopen the door for voter fraud, potentially allowing fellow Democrat politicians like [presidential nominee] Hillary Clinton and [gubernatorial nominee] Roy Cooper to steal the election,” the two leaders said Friday. “We will obviously be appealing this politically motivated decision to the Supreme Court.”

State GOP Executive Director Dallas Woodhouse tweeted, “There were no winners here today. They people of North Carolina lost today.”

In a subsequent statement, Woodhouse said Cooper and state Democrats were overruling the will of the people.

“The voter ID law has already been put into place and was successful in its implementation this year, despite the false predictions from the left,” Woodhouse said. “Preserving integrity at the ballot box is just plain common sense, but Roy Cooper and his liberal allies used endless lawsuits to throw our citizens under the bus. The people of North Carolina deserve a system that ensures every voter is who they say they are as they rightfully cast their vote.”

Russell Peck, McCrory’s re-election campaign manager, put out a statement with a photo showing a sign from the Democratic National Convention in Philadelphia showing that a photo ID was required for delegates to pick up their credentials.

“A liberal, activist court just sided with Hillary Clinton, Roy Cooper, and George Soros by striking down North Carolina’s common sense voter ID law,” Peck said. “They didn’t even look at the evidence before making a decision.”

Democratic U.S. Senate candidate Deborah Ross, who sponsored many of the election laws that the GOP statute tried to curtail, praised the ruling.

“Our democracy is strongest when we bring more voices into the political process,” Ross said. “But North Carolina’s recent and restrictive law, which included a stringent voter ID requirement and undid two bills I passed that allowed same-day voter registration and out-of-precinct voting, did the exact opposite. Today is a good day for democracy. We must continue to respect and protect the right to vote for all eligible Americans.”

The American Civil Liberties Union, one of the plaintiffs in the suits challenging the law, also praised the ruling.

“With surgical precision, North Carolina tried to eliminate voting practices disproportionately used by African-Americans,” said Dale Ho, director of the ACLU’s Voting Rights Project. “This ruling is a stinging rebuke of the state’s attempt to undermine African-American voter participation, which has surged over the last decade.”

Kim Westbrook Strach, executive director of the State Board of Elections, said the state board is reviewing the ruling and encouraged voters to stay informed of developments in the coming weeks.

“Absent alternative guidance from the courts, voters will not be asked to show photo identification this election,” Strach said. “Early voting will run Oct. 20 through Nov. 5, and same-day registration will be available at early voting sites.”

Strach encouraged voters to vote in their assigned precincts to avoid having to use a provisional ballot. However, voters who do not appear in their assigned precincts will still have their vote count for all eligible contests, she said.