(Reuters) - A Texas law that requires voters to show identification before casting ballots was enacted with the intent to discriminate against black and Hispanic voters, a U.S. federal judge ruled on Monday.

The decision by U.S. District Judge Nelva Gonzales Ramos came after an appeals court last year said the 2011 law had an outsized impact on minority voters. The court sent the case back to Ramos to determine if lawmakers intentionally wrote the legislation to be discriminatory.

Ramos said in a 10-page decision that evidence “establishes that a discriminatory purpose was at least one of the substantial or motivating factors behind passage” of the measure.

“The terms of the bill were unduly strict,” she added.

Spokesmen for Texas Attorney General Ken Paxton Jr. and Governor Greg Abbott, both Republicans, could not be reached for comment.

In January, after the Supreme Court declined to hear the case, Paxton said it was a common sense law to prevent voter fraud.

The ruling on voter ID comes about a month after two federal judges ruled that Texas lawmakers drew up three U.S. congressional districts to undermine the influence of Hispanic voters.

The measure requires voters to present photo identification such as a driver’s license, passport or military ID card.

Plaintiffs have argued the law hits elderly and poorer voters, including minorities, hardest because they are less likely to have identification. They contend the measure is used by Republicans to suppress voters who typically align with Democrats.

The legislation has been in effect since 2011 despite the legal challenges.

Ramos said the law had met criteria set by the U.S. Supreme Court to show intent that included its discriminatory impact, a pattern not explainable on other than racial grounds, Texas’ history of discriminatory practices and the law’s unusually swift passage.

Kristen Clarke, president of the Lawyers’ Committee for Civil Rights Under Law, one of the plaintiffs, said the ruling showed other states that discriminatory laws would not stand up to legal scrutiny.

“This is a good ruling that confirms what we have long known, that Texas’ voter ID law stands as one of the most discriminatory voting restrictions of its kind,” she said.

In a shift from its stance under former President Barack Obama, the U.S. Justice Department dropped a discrimination claim against the law in February. The department said that the state legislature was considering changing the law in ways that might correct shortcomings.