Voting rights activists are finding a surprising new friend in the federal courts, as a federal judge in Texas struck down that state’s controversial voter ID law, likening it to a poll tax directed at Blacks and Hispanics, while the U.S. Supreme Court blocked Wisconsin from implementing a law requiring voters to present photo IDs.

The actions, coming less than a month before the crucial November midterm elections, mean that African-Americans in those states will have one less impediment to casting their ballot. However, the court system wasn’t so friendly last month to African-Americans in North Carolina, where a federal judge ruled the state can go ahead and implement new regulations that many observers believe were intended by Republican lawmakers to restrict the voting access of African-Americans and young people.

The ruling Thursday night by U.S. District Judge Nelva Gonzales Ramos of Corpus Christi is a major defeat for Republicans, who engineered a swath of more stringent voting measures across the country that many observers think were aimed directly at African -Americans and Hispanics, particularly after the U.S. Supreme Court weakened the Voting Rights Act last year by striking down the provision that determines which localities receive special scrutiny.

While 34 states have passed laws requiring an ID to vote, states like Wisconsin, Pennsylvania and Texas have struck them down. In some cases, the new restrictions have backfired on Republicans, spurring African-Americans to come out in greater numbers as a form of protest. Many observers believe that’s exactly what happened in the 2012 election, when President Barack Obama won a second term.

After the Supreme Court weakened the Voting Rights Act, Attorney General Eric Holder and President Obama vowed to fight to make sure it had a limited impact on African-American voters. Texas was one of the places that Holder staked out as a battleground, directing significant Justice Department resources to fight the state’s new voting laws.

“We are extremely heartened by the court’s decision, which affirms our position that the Texas voter identification law unfairly and unnecessarily restricts access to the franchise,” Holder said in a statement released Thursday night. “Even after the Voting Rights Act was seriously eroded last year, we vowed to continue enforcing the remaining portions of that statute as aggressively as possible. This ruling is an important vindication of those efforts.”

After the Supreme Court’s ruling last year on the Voting Rights Act, which had long blocked Texas and eight other states with histories of discrimination from changing election laws without permission from the DOJ or a federal court, Texas was one of the first states that rushed to pass more restrictive voting rules.

The ruling by Gonzales Ramos, an appointee of Obama, could spare an estimated 13.6 million registered Texas voters from needing one of seven kinds of photos identification to cast a ballot.

According to lawyers from the Justice Department, more than 600,000 of those voters, mostly Black and Hispanics, currently lack any eligible ID to vote.

Under the Texas law, college student IDs aren’t accepted by poll workers, but concealed handgun licenses are. In addition, although free voting IDs offered by the state require a birth certificate that costs as little as $3, the Justice Department claimed that traveling to get those documents imposes an outsized burden on poor minorities. Texas has issued just under 300 free voter IDs since the law took effect while the state of Georgia has issued 2,200 voter IDs under a similar program, which opponents of the law said demonstrated that Texas wasn’t trying very hard.

Gonzales Ramos said the Texas law “creates an unconstitutional burden on the right to vote, has an impermissible discriminatory effect against Hispanics and African-Americans, and was imposed with an unconstitutional discriminatory purpose.” She said it “constitutes an unconstitutional poll tax.”

But Republican Texas Attorney General Greg Abbott said he would appeal.

“The State of Texas will immediately appeal and will urge the Fifth Circuit to resolve this matter quickly to avoid voter confusion in the upcoming election,” said Lauren Bean, a spokeswoman for Abbott’s office.