A federal judge recently dismissed a lawsuit filed by parents who claimed public school officials in Massachusetts encouraged their children to change their names and pronouns without their consent.

U.S. District Judge Mark Mastroianni ruled Dec. 14 that the lawsuit against Ludlow Public School officials failed to meet the "shocks-the-conscience" legal standard for due-process claims under the 14th Amendment, but he also scolded the school district for its policy to withhold students' gender identities.

Mastroianni deemed that policy "imperfect," "flawed" and not in accordance with nonbinding state guidance regarding transgender students, according to the National Catholic Register.

Parents Stephen Foote and Marissa Silvestri claimed in the suit, which was filed in April, that their child was encouraged by school officials at Paul R. Baird Middle School in Ludlow to adopt a new name and different gendered pronouns.

TRANS PSYCHOLOGIST FILES BRIEF AGAINST MARYLAND SCHOOL DISTRICT HIDING TRANSITIONS FROM PARENTS: ‘TERRIBLE IDEA’

Paul R. Baird Middle School

Parents alleged their child was encouraged by school officials at Paul R. Baird Middle School in Ludlow, Massachusetts, to adopt a new name and different gendered pronouns. (Google Maps)

"[The Ludlow School Committee and implicated educators] exceeded the bounds of legitimate pedagogical concerns and usurped the role of [the plaintiffs] and other parents in the Town of Ludlow to direct the education and upbringing of their children, make medical and mental health decisions for their children and to promote and preserve family privacy and integrity," the lawsuit alleged.

Mastroianni, an Obama appointee, expressed "apprehension" in his ruling about the school's actions and gender policy, but he ultimately decided that withholding information about the plaintiffs' children did not meet the threshold of being shocking to the conscience. The judge cited the complex nature of the issue and the conflicting interests at play as the reason for his decision.

MASSACHUSETTS PARENTS SUE SCHOOL, SAY OFFICIALS ENCOURAGED CHILDREN TO USE NEW NAMES, PRONOUNS WITHOUT CONSENT

Pro-transgender protesters

A protester voices support for the promotion of transgender ideology in schools during a pro-transgender march. (Mark Kerrison/In Pictures via Getty Images/File)

Mastroianni said Massachusetts law "recognizes gender identity as a personal characteristic deserving of protection from discrimination" and does not "provide exceptions to permit parents to override a school’s decision to support students who identify as transgender or gender nonconforming."

"Addressing a person using their preferred name and pronouns simply accords the person the basic level of respect expected in a civil society generally, and, more specifically, in Massachusetts public schools where discrimination on the basis of gender identity is not permitted," he ruled.

But the judge also noted that state law does not require Ludlow officials to keep a child's gender transition at school a secret from parents, adding that "it is disconcerting that school administrators or a school committee adopted and implemented a policy requiring school staff to actively hide information from parents about something of importance regarding their child."

GENDER POLICY IN WASHINGTON STATE SCHOOL DISTRICT ‘SPITS IN THE FACE OF PARENTS,’ MOTHER SAYS

'Protect Trans Youth' protesters

FILE - Demonstrators protest in support of rights for transgender youth. (Fox News)

"Students and parents would almost certainly be better served by a more thoughtful policy that facilitated a supportive and safe disclosure by the student, with support and education available for students and parents, as needed and when accepted," the judge wrote.

CLICK HERE TO GET THE FOX NEWS APP

The parents have until mid-January to appeal, which their lawyer said they are considering, the Register reported.

Fox News' Timothy Nerozzi contributed to this report.