A federal judge on Thursday denied a request by New York’s Nassau County to let it enforce new restrictions on transgender athletes at county sports venues without facing legal action by the state’s attorney general for violations of anti-discrimination laws.

Nassau County Executive Bruce Blakeman, a Republican, issued an order in February that denies permits at county-run parks and sports facility to girls’ and women’s sports teams that cannot attest that all their members were designated female on their original birth certificates.

His order, one of scores of laws, rules and regulations advanced by Republican politicians around the U.S. to regulate trans people’s conduct, does not place any restrictions on men’s or mixed teams.

Days later, New York Attorney General Letitia James, a Democrat, sent Blakeman a letter telling him to rescind the order, which encompasses a large section of Long Island adjacent to New York City, or risk legal consequences. She called the order “transphobic and blatantly illegal” under the state’s human rights laws, which put New York among 22 states that forbid discrimination based on gender identity.

Blakeman sued James in U.S. District Court on Long Island, asking the judge to order New York’s chief law-enforcement officer not to pursue legal action against the county, and arguing that the state’s anti-discrimination laws violate the U.S. Constitution.

On Thursday, Judge Nusrat Choudhury ruled against Nassau County, noting that the Constitution’s 11th Amendment generally prevents a local government from suing a state government in federal courts.

She also ruled that Nassau County had no legal standing, nor did an unnamed 16-year-old girl who plays volleyball who joined Blakeman as a plaintiff in the lawsuit through her parents.

“There are no facts in the record showing that any specific cisgender woman or girl in Nassau County will face imminent injury in an athletic event involving a transgender woman or girl on Nassau County Parks property if the Executive Order is invalidated,” Choudhury wrote.

The judge said she would rule on the attorney general’s motion to dismiss the lawsuit entirely later in April. A spokesman for Blakeman did not respond to requests for comment, and the New York attorney general’s office declined to comment beyond its court filings.

Since issuing his order, Blakeman has been sued in a state court by at least one women’s team accusing the county of violating anti-discrimination laws.