A school district in California did not violate the First Amendment rights of a high school calculus teacher when he was ordered to remove banners in his classroom that referred to God, a federal appeals court has ruled.

The unanimous decision on Tuesday by a three-judge panel of the 9th U.S. Circuit Court of Appeals reversed a decision last year by a federal judge in the case of Westview High School teacher Bradley Johnson, Fox5SanDiego.com reports.

In the earlier decision, U.S. District Judge Roger Benitez concluded that the Poway Unified School District infringed upon Johnson's rights and ordered it to allow him to re-post the banners.

Johnson has long displayed large banners in his classroom in Rancho Penasquitos that read: "In God We Trust,'' "One Nation Under God,'' and "All Men Are Created Equal, They Are Endowed By Their Creator.''

In its decision, the appeals court cited previous U.S. Supreme Court cases when it ruled that the school district has the right to limit speech of public employees in the workplace and acted lawfully when it told Johnson to remove the banners.

"Just as the Constitution would not protect Johnson were he to decide that he no longer wished to teach math at all, preferring to discuss Shakespeare rather than Newton, it does not permit him to speak as freely at work in his role as teacher about his views on God, our nation's history, or God's role in our nation's history as he might on a sidewalk, in a park, at his dinner table, or in countless other locations," wrote Judge Richard Tallman.