A lawyer for Stanford did not return a call seeking comment. University officials were also not immediately available for comment.

Stanford had said that the speech code barred only "fighting words" expressing hatred and contempt and aimed directly at individuals and small groups. It argued that the wording of the code clearly said the code proscribed no idea, no matter how offensive.

At the heart of the case is the question of how far universities can go to fight hateful speech without violating freedom of expression. More than 150 colleges and universities have tried to regulate such speech, according to a survey by the Freedom Forum First Amendment Center.

But several institutions have abolished or narrowed their codes because of criticism and legal challenges.

The Stanford code, adopted in 1990, forbids use of "gutter epithets and symbols of bigotry."

The university had argued that the code stemmed from fundamental Stanford principles: students are expected to show respect for others' rights and students should be protected from "discriminatory harassment."