Editor's note: This story has been updated throughout.

A federal judge has tossed out a new law softening Texas’ strict voter identification requirements.

U.S. District Judge Nelva Gonzales Ramos on Wednesday ruled that Senate Bill 5, signed by Gov. Greg Abbott in June, doesn’t absolve Texas lawmakers from responsibility for discriminating against Latino and black voters when they crafted one of the nation’s strictest voter ID laws in 2011. The judge also ruled that the state failed to prove that the new law would accommodate such voters going forward.

The Corpus Christi judge’s ruling is the latest twist in a six-year battle over Texas’ laws restricting what forms of identification are accepted at the polls, and it sets up a round of squabbling over whether the federal government should once again pre-approve the state's election laws.

SB 5 was the Legislature’s attempt to wriggle free of consequences after courts found fault with its 2011 ID law.

Last year, the U.S. 5th Circuit Court of Appeals ruled that the 2011 law disproportionately burdened minority voters who were less likely to have one of seven forms of identification the state required them to show at the polls. Ramos upped the ante in April, ruling the state discriminated on purpose.

As Ramos weighed possible remedies for the state's violations of the Voting Rights Act and the U.S. Constitution, Texas leaders state pushed SB 5 as a solution and scrambled to get it to Abbott's desk at the end of the legislative session.

Ramos had temporarily softened the state's voter ID rules for the 2016 elections, and the new law somewhat followed her lead. It allows Texans without photo ID to vote if they present alternate forms of ID and sign affidavits swearing a “reasonable impediment” kept them from obtaining the proper ID.

Those voters could present documents such as utility bills, bank statements or paychecks to confirm their identification. Those found to have lied about not possessing the proper photo ID could be charged with a state jail felony, which carries a penalty of 180 days to two years in jail — which Ramos said "appear to be efforts at voter intimidation."

Under the new law, the permissible IDs remain the same as the earlier law: a state driver's license or ID card, a concealed handgun license, a U.S. passport, a military ID card, a U.S citizenship certificate or an election identification certificate.

Minority groups suing the state had asked Ramos to scrap SB 5, saying it still dripped with discrimination — largely because lawmakers did not expand the list of acceptable IDs.

Ramos agreed in her ruling Wednesday.

“SB 5 does not meaningfully expand the types of photo IDs that can qualify, even though the Court was clearly critical of Texas having the most restrictive list in the country,” she wrote. "Not one of the discriminatory features of [the old law] is fully ameliorated by the terms of SB 5."

SB 5's process for voters without proper ID, Ramos wrote, "trades one obstacle to voting with another—replacing the lack of qualified photo ID with an overreaching affidavit threatening severe penalties for perjury."

The ruling also said Texas couldn't be trusted to educate voters about changes to its ID law, following its widely criticized efforts ahead of elections in 2016 that were marked by confusion at the polls. She noted that Texas has claimed to spend $4 million on voter education before the 2018 elections, "but this stipulation is not part of SB 5 or any other statute."

Unless appeals courts step in, Ramos' sweeping ruling could mean Texans wouldn't have to show a photo ID at the polls in future elections.

Texas Attorney General Ken Paxton quickly promised to appeal Ramos' decision.

“Today’s ruling is outrageous," Paxton said in a written statement. "Senate Bill 5 was passed by the people’s representatives and includes all the changes to the Texas voter ID law requested by the 5th Circuit."

Paxton cited the support of the U.S. Department of Justice, which originally sided with civil rights groups in fighting the Texas voter ID law, but reversed its position after President Trump took office.

Paxton said the Department of Justice "is satisfied that the amended voter ID law has no discriminatory purpose or effect.

"Safeguarding the integrity of elections in Texas is essential to preserving our democracy," he added. "The 5th Circuit should reverse the entirety of the district court’s ruling.

Voting rights groups and Democrats welcomed Ramos' ruling.

"Time and time again, federal courts have made it clear that Texas’s strict voter photo ID law is discriminatory,” said Danielle Lang, senior counsel for Campaign Legal Center, which is representing plaintiffs in the case. “It doesn’t matter how many times the state tries to dress the law in sheep’s clothing – its intent is to discriminate and prevent hundreds of thousands of eligible voters from casting ballots."

Ramos said she would next consider whether to invoke a section of the Voting Rights Act to place Texas under federal oversight of its election laws — a process called preclearance.

For decades, Texas was on a list of states and localities needing federal permission to change their election laws, a safeguard for minority voting rights. The U.S. Supreme Court wiped clean the list in 2013 but left open the possibility that states could return to the list if they intentionally discriminated in the future.

Federal courts have ruled four times this year that Texas intentionally discriminated in passing voting laws, with Ramos' ruling reaffirming one of those on Wednesday.