PHOENIX ― A federal judge ruled Tuesday that the state of Arizona violated students’ rights by banning a Mexican-American studies program from Tucson public schools.

The ruling issued by U.S. District Judge A. Wallace Tashima found that a law passed by Arizona’s Republican-dominated state legislature in 2010 violated both the First and 14th Amendments. It marks a major victory for educators and activists who viewed the ethnic studies law as a flatly discriminatory effort by Arizona Republicans to keep Hispanic students from learning about their history or studying writers of color that are often ignored in public schools.

Curtis Acosta, one of the former teachers of the banned program, celebrated the ruling on Twitter.

I just received word from our attorney, Richard Martinez, that we won our case against the state of Arizona. ¡Justicia! #InLakEch #MASTrial — Curtis Acosta (@CurtisAcostaLLP) August 23, 2017

Lawyers for the plaintiffs had argued at a trial that concluded last month that Tucson students had a right under the First Amendment to receive information. They also contended that Arizona Republicans violated the equal protection clause of the 14th Amendment by targeting Hispanics, both when passing the 2010 law and by enforcing it exclusively against Mexican-American studies (MAS) classes in one district.

“We won on all points,” said Richard Martinez, one of six lawyers defending the students. “It speaks to the importance of the judiciary and protecting everyone against racial discrimination.”

Arizona Republicans, led by former Superintendent of Public Instruction Tom Horne and his successor John Huppenthal, argued that the ethnic studies classes bred resentment against whites.

But the ruling faulted both of them for failing to observe a single class in action and for assuming that MAS teachers would hide their allegedly subversive agendas in the presence of public officials.

“Both individuals conveyed an unfounded, yet uniform, distrust of MAS teachers’ and students’ accounts of what was taking place in MAS classrooms,” the ruling states, referring to Horne and Huppenthal.

A series of anonymously posted and racially-charged blog comments from Huppenthal played a role in cementing Tashima’s opinion that the Republican officials acted with “racial animus” ― the legal term for an intent to racially discriminate. Huppenthal called for the elimination of Spanish from public life, with the exception of a limited number of words on Mexican restaurant menus, and compared Mexican-American studies teachers to the Ku Klux Klan.

“Huppenthal’s blog comments provide the most important and direct evidence that racial animus infected the decision to enact A.R.S. § 15-112,” Tashima’s ruling reads, referring to the ethnic studies statute. “Several of his blog comments convey animus toward Mexican-Americans generally.”

“Huppenthal’s usage of pseudonyms also shows consciousness of guilt,” Tashima added. “Had Huppenthal, a public official speaking in a public forum on a public issue, felt that his inflammatory statements were appropriate, he would not have hidden his identity.”

The 2010 ethnic studies law was unusual, Tashima’s ruling states, because it targeted a single curriculum in a single district ― a problem that could have been resolved locally if it bothered state education officials. It was also possible to address Arizona Republicans’ complaints about allegedly biased or partisan materials under existing law, the ruling said.

A hearing will follow within the next three weeks to determine how the ruling will be enforced. Martinez expected the ethnic studies law to be scrubbed from the state statute.

The Arizona Attorney General’s office did not answer a phone call requesting comment about the ruling.

This story has been updated to include reactions to the ruling and additional context about the case.