HOUSTON — A federal judge blocked Texas from enforcing its revamped voter identification law on Wednesday, ruling that the State Legislature’s attempt to loosen the law did not go far enough and perpetuated discrimination against black and Hispanic voters.

The decision was only the latest chapter in a yearslong court battle over the state’s voter ID rules, and comes amid concerted efforts by the Trump administration to enact tougher voting restrictions. The stakes are particularly high for Texas: As a result of previous court rulings, the state could be forced to undergo federal oversight of its election procedures.

The judge — Nelva Gonzales Ramos, of the United States District Court for the Southern District of Texas — had previously found that the original law, one of the most restrictive in the nation, was passed in 2011 with the intent to discriminate against blacks and Hispanics. It required voters to show one of seven forms of government-issued photo identification, such as a driver’s license or passport, before casting a ballot.

The Republican-controlled Legislature softened the law, in response to legal challenges and court rulings, by allowing potential voters to sign an affidavit and show more widely available types of identification, including a utility bill or a bank statement. The new law, known as Senate Bill 5, was set to take effect in January, despite complaints from critics that it created criminal penalties for those who made false claims about needing to use alternate IDs.