A U.S. District Court judge in Arizona ruled Tuesday that racism was behind an Arizona ban on ethnic studies that shut down a popular Mexican-American Studies program at Tucson Unified School District.

Arizona’s law banning classes “designed primarily for students of a particular ethnic group” was enacted and enforced with racist intent, making it unconstitutional. “Both enactment and enforcement were motivated by racial animus,” federal Judge A. Wallace Tashima said in the ruling.

The statute in question prohibited classes from promoting resentment toward individual races and classes or advocating ethnic solidarity instead of individualism, according to a report by the Associated Press. Although Judge Tashima had previous upheld most of the law, a federal appeals court sent the case back for a July trial in order to ascertain whether racism had been a motivating factor in its passage.