A federal judge has blocked Ohio’s cuts to early voting and its elimination of same-day voter registration—a major voting rights victory in the nation’s ultimate presidential battleground state.

Judge Peter Economus ruled Thursday that the cuts violated the Voting Rights Act’s ban on racial discrimination in voting, as well as the Equal Protection clause of the U.S. Constitution. He issued an injunction barring them from going into effect before the November election, and directed Ohio Secretary of State Jon Husted to add a second Sunday of early voting.

Husted said he would appeal the ruling.

“Today’s ruling kicks the door open to having different rules for voting in each of Ohio’s 88 counties, which is not fair and uniform and was not even acceptable to this court or the plaintiffs previously,” he said in a statement. “We must appeal this ruling, because we can’t simultaneously treat people the same and differently.”

State Sen. Nina Turner, a Democrat who is running against Husted this November, had urged the secretary of state not to appeal the ruling, saying in a statement that doing so would “only create confusion a month before early voting is set to begin.”

Voting rights advocates cheered.

“This ruling will safeguard the vote for thousands of Ohioans during the midterm election,” said Dale Ho, director of the American Civil Liberties Union’s Voting Rights Project, which brought the case. “If these cuts had been allowed to remain in place, many voters would have lost a critical opportunity to participate in our democratic process this November. This is a huge victory for Ohio voters and for all those who believe in protecting the integrity of our elections.”

“Today’s outcome represents a milestone in our effort to continue to protect voting rights even after the Supreme Court’s deeply misguided decision in Shelby County,” said Attorney General Eric Holder, during a speech about the Justice Department’s investigation into the Ferguson, Missouri police department. The Justice Department had filed a supporting brief in the Ohio challenge.

Holder noted that the judge’s reasoning was similar to that used in DoJ’s challenges to restrictive voting laws in Texas and North Carolina.

Earlier this year, Ohio’s Republican-controlled legislature cut the early voting period by six days, citing the need for uniformity across the state. The period that was cut was known as “Golden Week,” when Ohioans can register and vote on the same day. Same-day registration is among the most effective ways to bring new voters into the process, expert say. Days later, Husted issued a directive that ended Sunday voting and weekday evening voting past 5 p.m. Many African-American churches have in past years conducted “Souls to the Polls” drives on Sundays after services.

In his ruling, Judge Economus found that both the legislature’s cuts and Husted’s directive would disproportionately harm racial minorities and low-income residents, who are more likely to take advantage of early voting and same-day registration. He also dismissed Ohio’s argument that preventing fraud was a legitimate justification for eliminating same-day registration, finding that fraud has “almost nothing to do with instances of registering and voting on the same day.”

Rick Hasen, a prominent election law expert, wrote online that Economus’s ruling raises the question of why Ohio is violating the Voting Rights Act by cutting early voting to 29 days, when some states have no early voting at all. “The opinion issued today is quite undertheorized as a matter of law, and I am not sure that it will stand up to further scrutiny, at least if applied in other cases,” wrote Hasen, a law professor at the University of California, Irvine.

This is the third time that Economus has ruled against Husted and for voting rights advocates. In June, he ordered the secretary of state to restore the last three days of early voting. And he did the same thing in the run-up to the 2012 election, after Husted had tried to cut those days for all voters except members of the military.