On Wednesday, a federal court dismissed a lawsuit filed by an evangelical state university professor who was disciplined after repeatedly misgendering a transgender student — infractions determined to violate the university’s nondiscrimination policy.

Professor Nicholas Meriwether had sued his employer, Shawnee State University, in Portsmouth, Ohio, alleging that his First Amendment rights had been infringed.

That was after he received a written warning for repeatedly referring to Jane Doe, a transgender female student, using the title “Mr.” and male pronouns, despite using correct pronouns for every other member of the class.

Meriwether grieved the discipline, but the grievance was denied. He then enlisted the help of the anti-LGBTQ Alliance Defending Freedom to file the lawsuit against Shawnee State, arguing that his religious beliefs that gender is fixed, binary, and determined by biology from birth prevent him from acknowledging transgenderism.

The National Center for Lesbian Rights, along with Adam Unikowsky of Jenner & Block LLP and Jennifer Branch of Gerhardstein & Branch Co., LPA, intervened on behalf of Jane Doe and the university’s LGBTQ student group, Sexuality and Gender Acceptance. On behalf of their clients, the lawyers moved to have the lawsuit dismissed.

The case went before Magistrate Judge Karen Litkovitz, of the Western Division of the Southern District of Ohio, who issued a recommendation last September arguing for the lawsuit be dismissed.

In her opinion, Litkovitz noted that Meriwether was given multiple opportunities to stop referring to Doe as male, and was even given the option of simply referring to Jane Doe by a first name or last name without using pronouns or formal titles.

She also rejected claims that the disciplinary action violated Meriwether’s freedom of religion, was motivated by hostility towards religion, or infringed on his freedom of speech.

“Speech by a government employee is protected under the First Amendment only if the speech was made ‘as a citizen’ while addressing ‘a matter of public concern,” she wrote in her opinion. “A government employee’s speech is made ‘as a citizen’ and is protected under the First Amendment only when the speech is not ‘pursuant to [the employee’s] duties.'”

On Wednesday, U.S. District Judge Susan J. Dlott, of the Southern District of Ohio, dismissed Meriwether’s lawsuit, agreeing to adopt Litkovitz’s recommendation.

Related: Virginia teacher fired for refusing to call transgender student by male pronouns

“The Court concludes that Meriwether failed to state a claim for violation of his rights under the United States Constitution,” Dlott wrote in her ruling. “His speech — the manner by which he addressed a transgender student — was not protected under the First Amendment. Further, he did not plead facts sufficient to state a claim for a violation of his right to free exercise of religion, for a departure from religious neutrality under Masterpiece Cakeshop, Ltd. v. Colorado Civil Rights Commission, or for a violation of his rights to due process or equal protection.”

Alliance Defending Freedom could decide to appeal Dlott’s decision within the next 30 days, but has not yet indicated what actions it plans to take next.

Meanwhile, the National Center for Lesbian Rights issued a statement celebrating the lawsuit’s dismissal.

“We are pleased the Court affirmed that schools can ensure that all students are able to learn and the access educational opportunities available to all students without fear of discrimination,” Asaf Orr, a senior staff attorney and the director of NCLR’s Transgender Youth Project, said.

“Since this lawsuit began, transgender students have been worried that they would have to start skipping classes or avoid particular professors because Shawnee State would no longer be able to effectively address bullying, harassment, and mistreatment of transgender students,” Jae Keniston, the president of SAGA, said in a statement. “SAGA and its members are relieved that the Court recognized the importance of Shawnee State’s anti-discrimination and anti-harassment policies to transgender people on campus. This is a big step towards progress for all transgender people on Shawnee State’s campus.”

Read more:

California Democrat introduces bill to end insurance discrimination against people with HIV

Three female athletes sue Connecticut over transgender women competing in sports

Texas sues California over law banning official travel to states with anti-LGBTQ laws