A US teenager has successfully won a lawsuit against a teacher who described creationism as "superstitious nonsense".

Chad Farnan, a devout Christian studying at California's Capistrano Valley high school, persuaded a judge that his European history teacher, James Corbett, violated the establishment clause of the First Amendment, which courts interpret as banning government employees from promoting, or displaying hostility towards, religion.

Farnan claimed Corbett made comments that were "derogatory, disparaging and belittling regarding religion and Christianity in particular". In legal documents submitted to the US district court, he said he was uncomfortable going to class and felt as though Corbett had created an atmosphere in which he could not effectively learn "both because and regardless of his religious beliefs".

Farnan's lawyer, Jennifer Monk, who works for a not-for-profit Christian law firm, Advocates for Faith and Freedom, told the Guardian yesterday that Farnan's victory was the first of its kind, proving that the establishment clause applied equally to the disapproval of religion as it did to the promotion of religion.

"It is the first case of its kind where a court has held a teacher responsible for the disapproval of Christianity. It's common for lawsuits to be brought against teachers promoting religion. In general, for years, religion has been taken out of the classroom. I don't agree with that, but if it's going to be taken out, at the very minimum you can't go to the other extreme.

"The [Farnan] family is excited, it's a courageous stand. There were people who were very supportive and there were people who didn't agree with his stand."

Farnan spent almost 18 months gathering material against Corbett, compiling a dossier that featured secret recordings of the teacher's remarks.

However, Judge James Selna found in a 37-page ruling that almost all the statements cited by the plaintiff did not violate the establishment cause, including Corbett's view that "when you put on your Jesus glasses, you can't see the truth" – a reference to peasants who did not support the reforms of the Holy Roman Emperor Joseph II for religious reasons. The judge said the statement was made in the context of an historical discussion. He dismissed other comments by Corbett that "conservatives don't want women to avoid pregnancies — that's interfering with God's work" and that there was as much evidence that God created the world "as there is that there is a gigantic spaghetti monster living behind the moon who did it".

Only one of Corbett's opinions fell foul of the First Amendment – his "unequivocal belief that creationism is superstitious nonsense". Judge Selna concluded that there was no legitimate secular purpose to the statement and it constituted "improper disapproval of religion in violation of the establishment clause".

In his ruling, the judge said he tried to balance the rights of both parties. "The court's ruling reflects the constitutionally permissible need for expansive discussion, even if a given topic may be offensive to a particular religion," he said. "The decision also reflects that there are boundaries. The ruling protects Farnan, but also protects teachers like Corbett in carrying out their teaching duties."

He said the case reflected the tension between the constitutional rights of a student and the demands of higher education, as well as the tension between Farnan's religious beliefs and the need for government, especially schools, to carry out their duties "free of the strictures of any particular religious or philosophical belief system".

Corbett, a teacher with 20 years' experience, remains at Capistrano Valley high school and has made no public comment since the case started.