A Middlesex Superior Court judge has rejected a lawsuit by an atheist couple and their children who sued the Acton-Boxborough Regional School District and the Acton schools challenging the use of the words “under God” in the Pledge of Allegiance.

Judge S. Jane Haggerty, in a ruling released Friday, said the daily recitation of the pledge with those words did not violate the plaintiffs’ rights under the Massachusetts Constitution, did not violate the school district’s antidiscrimination policy, and did not violate state law.

The plaintiffs, while acknowledging that the children had the right to refuse to participate in the pledge, asserted that the phrase “under God” was a “religious truth” that contradicted their beliefs, Haggerty said.

Advertisement - Continue Reading Below

The defendants argued that the pledge, rather than a religious document or ceremony, is a patriotic exercise and statement of political philosophy, according to the ruling.

The judge observed that the case presents a “familiar dilemma in our pluralistic society — how to balance conflicting interests when one group wants to do something for patriotic reasons that another group finds offensive to its religious (or atheistic) beliefs.”

The judge ruled in her 24-page opinion that the phrase “under God” was not a religious truth.

Citing previous opinions, she said that the daily flag salute and pledge in schools are “clearly designed to inculcate patriotism and to instill a recognition of the blessings conferred by orderly government under the constitutions of the state and nation.”

“The Pledge is a voluntary patriotic exercise, and the inclusion of the phrase ‘under God’ does not convert the exercise into a prayer,” she wrote.

“As recently as 2002, Congress reaffirmed the terms of the Pledge,” she noted, “making findings that support the conclusion that including the phrase ‘under God’ did not transform the Pledge into a religious exercise but rather was intended to reflect the history and political philosophy of the United States.”

Also named as a defendant in the case was Stephen E. Mills, superintendent of both the Acton-Boxborough regional and Acton public school systems.

Mills on Monday released a copy of the memo he sent to the school committee detailing Haggerty’s ruling in favor of the existing practice.

“The court upheld the school district’s longstanding practice of leading children in the Pledge of Allegiance, which is also required under our state law,’’ Mills wrote.

“The school districts have maintained throughout this lawsuit that we have not engaged in unlawful discrimination against its students, specifically with respect to their religious beliefs as was alleged in this case,’’ Mills wrote.

Mills added that “we are pleased with the court’s decision regarding the claim of discrimination and we continue to work hard to provide a positive and accepting educational environment for all of the students in the communities that we serve.’’

The names of the children and their parents who brought the lawsuit were not disclosed in court papers, but they were represented by Fitchburg attorney David Niose on behalf of the American Humanist Association.

Niose is also president of the association, and he promised on the association’s website to appeal Haggerty’s ruling.

“If conducting a daily classroom exercise that marginalizes one religious group while exalting another does not violate basic principles of equal rights and nondiscrimination, then I don’t know what does,’’ he wrote.

During the litigation, Daniel and Ingrid Joyce stepped forward on behalf of their two children to defend the inclusion of the words “under God’’ with the support of the Catholic fraternal organization, the Knights of Columbus (which campaigned in the early 1950s to get the words “under God” inserted into the pledge) and the Becket Fund for Religious Liberty.

“This is a great victory for everyone who believes that human rights come not from the whim of the government, but from a higher power, which is what the Pledge proclaims,” Diana Verm, legal counsel of the Becket Fund wrote on the fund’s website.

The fund reported on its site that the Acton-Boxborough litigation was the fourth major lawsuit targeting the phrase “under God’’ in the pledge and is also the fourth time that courts have ruled in favor of retaining the phrase.