Saying teachers need to be free to discuss controversial subjects, a federal appeals court has dismissed a student's lawsuit against a high school history instructor whose classroom comments poked fun at creationism and religious fundamentalism.

The Ninth U.S. Circuit Court of Appeals in San Francisco said Friday it did not have to decide whether some of the teacher's remarks - like his calling a former teacher's anti-evolution advocacy "religious, superstitious nonsense" - violated the constitutional requirement of government neutrality by expressing hostility toward religion.

Regardless, the court said, a public employee can be sued only for violating clearly established constitutional rights. If any rights were violated in this case, they were not clearly established, the court said, because no public school teacher has ever been held liable for criticizing religion in a classroom discussion.

While teachers discussing issues like religion "must be sensitive to students' personal beliefs," the court said, "teachers must also be given leeway to challenge students to develop their critical thinking skills."

"We must be careful not to curb intellectual freedom by imposing dogmatic restrictions that chill teachers" from choosing their preferred methods of instruction, said Judge Raymond Fisher in the 3-0 ruling.

Attorney Robert Tyler of Advocates for Faith and Freedom, which represents the now-graduated Orange County student in the case, said he would ask the full appeals court for a rehearing and appeal to the U.S. Supreme Court if necessary.

"This case is about establishing legal precedent concerning the rights of children to be able to sit in a public school classroom without having their religion attacked," Tyler said. He said the court had deprived "millions of schoolchildren and tens of thousands of teachers" of guidance by sidestepping the constitutional question.

But Erwin Chemerinsky, the UC Irvine law school dean who represented the teacher and his school district, said the court "recognized the tremendous dangers in holding teachers liable for their speech in the classroom."

The suit was filed in 2007 by Chad Farnan, a 15-year-old sophomore at Capistrano Valley High School, who had secretly taped a series of statements by his advanced-placement history teacher, James Corbett.

Corbett told his students when class began that he would be making provocative statements to stimulate discussion and that they should feel free to disagree with him.

In one lecture, he said the Catholic Church had appealed to the religious beliefs of peasants to get them to oppose an 18th century emperor who was trying to improve their conditions. "When you put on your Jesus glasses, you can't see the truth," Corbett said.

While discussing clashes between science and religion in the 16th century, Corbett said there was as much evidence that God created the universe "as there is that there is a giant spaghetti monster living behind the moon who did it." When a student asked him about a conflict with a colleague who wanted to teach creationism, Corbett said he said he had not wanted to let the teacher "propagandize kids with this religious, superstitious nonsense."

Farnan withdrew from the class before filing his suit. Tyler said Farnan is now a college student. Corbett still teaches at the school.