Courtesy of Bryan Parras Former Arizona Superintendent of Public Instruction John Huppenthal, here at the federal courthouse in Tucson on June 26, was among the leaders of the attempt to ban ethnic studies.

A federal judge on Wednesday put the final nail in the coffin of Arizona’s Republican-backed law banning Mexican-American studies classes in Tucson public schools.

The final judgment issued by Senior Judge A. Wallace Tashima after a two-week bench trial last summer caps a seven-year legal battle over conservative attempts to restrict what books could be used or subjects taught in Tucson’s majority-Latino schools.

Conservative lawmakers led by then-Superintendent of Public Instruction Tom Horne and then-state Sen. John Huppenthal, who later succeeded Horne, derided Tucson’s Mexican-American studies curriculum as an anti-American politicization of public school classrooms. To shut the classes down, they spearheaded the passage of a state law in 2010 that prohibited classes aimed at students of a specific ethnicity, that fostered racial discord or that encouraged the overthrow of the U.S. government.

In Wednesday’s judgment, however, Tashima wrote that conservative lawmakers passed the ethnic studies restrictions “not for a legitimate educational purpose, but for an invidious discriminatory racial purpose and a politically partisan purpose.” (The senior judge on the U.S. Court of Appeals for the 9th Circuit was sitting by assignment to hear the case in U.S. District Court.)

No officials may carry out any part of the law, the judgment says. Tashima ruled in August that the law violates the students’ First Amendment rights by restricting information and the 14th Amendment’s equal protection clause by targeting Latinos.

Tashima’s judgment also sticks the state of Arizona with the bill for the plaintiff’s legal fees. The court has yet to determine the amount.

The Arizona attorney general’s office did not immediately return a call requesting comment about whether the state plans to appeal the ruling.

After seven years, the state can request that the permanent injunction be lifted, independent of the appeal process.

Tucson’s school board voted in 2012 to abandon its Mexican-American studies program after Arizona officials threatened to withhold 10 percent of the district’s state funding. They plucked copies of seven books used in the canceled courses from classrooms, fueling complaints from educators across the country that the state was in effect banning books.

Amid the legal controversy, several of the teachers in the program left Tucson or stopped working for the school district.

But the publicity generated by the court battle spurred efforts in other states to create ethnic studies programs modeled on or influenced by the Tucson classes.

CORRECTION: In a previous version of this article, Judge Tashima was misidentified as a U.S. district judge. He is a senior judge on the U.S. Court of Appeals for the 9th Circuit, who was sitting by assignment to hear a district court case.