The order blocking Locust Valley's policy comes amid the ongoing legal battle in Massapequa, where the New York Civil Liberties Union challenged that district’s policy on behalf of a transgender student, the New York Post reported.

In Massapequa's case, Rosa issued an interim stay in October barring it from enforcing its resolution pending an "ultimate determination."

Locust Valley has now been added as a related party because of the "near identical nature" of the districts' policies, according to the new order.

Massapequa filed a federal lawsuit against the student’s parents, the commissioner and other state officials after its policy was blocked.

Rosa's order said the outcome in that case could have implications for Locust Valley's policy.

The Locust Valley School Board said it is "navigating a complex and evolving legal landscape shaped by federal and state mandates" and "pursuing further legal counsel" following the commissioner’s order.

In justifying the policy, district officials have pointed to Title IX, which prohibits sex-based discrimination in education, and an executive order signed by President Donald Trump earlier this year, which declared male and female as the only two sexes and warned that federal funds "shall not be used to promote gender ideology."

But state officials contend that New York’s laws allow transgender students to access restrooms and locker rooms that match their gender identity.