The phrase "under God" in the Pledge of Allegiance doesn't discriminate against those with atheist beliefs, a New Jersey judge has ruled.

State Superior Court Judge David Bauman made the decision Wednesday in dismissing a lawsuit brought by the American Humanist Association against the Matawan-Aberdeen Regional School District on behalf of a family in the district.

Attorneys for the family argued in November that the phrase invalidates their religious beliefs. The school district argued that saying the pledge is voluntary and that the phrase "under God" doesn't violate religious freedom or equal protection clauses of the Constitution.

Bauman wrote that the Pledge of Allegiance has never been viewed as a religious exercise" and instead is intended to instill honor, pride and fidelity to country, NJ.com reported.

The lawsuit focused on the words "under God," which were added to the pledge in 1954 and have survived legal challenges over the years. Massachusetts' high court ruled in 2014 in a similar lawsuit that the pledge is not discriminatory.

School district lawyer David Rubin has said that the district was merely following a state law that requires schools to have a daily recitation of the pledge. He said individual students do not have to participate.