NEW YORK (Reuters) - The legislature of New York's Nassau County passed a law on Monday to ban women's and girl's sports teams from using sports facilities in the county on Long Island unless they exclude transgender girls and women from playing.

The law was virtually identical to a thwarted order issued by Nassau County Executive Bruce Blakeman, a Republican, in February, which was immediately challenged by New York's attorney general and a local women's roller-derby team for violating a state ban on discrimination against people based on their sex or gender identity.

Blakeman's order, which he said was needed to allow cisgender girls and women the fairest chance to win sporting events, was thrown out by a New York court, which ruled last month that only the county legislature had the power to make such a change.

Under the new law, which Blakeman is expected to sign, if an organizer of girls' or women's sports wishes to book a county-run park or athletics facility, they must ask each member of the teams involved what sex was marked on their original birth certificate, and expel any teammates who were not designated female.

The restrictions do not apply to boys' and men's teams, nor to mixed teams not segregated by sex in Nassau County, a largely suburban chunk of Long Island east of New York City.

Victoria Lagreca, a lawyer in the Nassau County attorney's office, defended the law by pointing to four episodes in recent years in which cisgender women or girls were injured while playing sports alongside transgender women or girls. Two of the episodes were in Massachusetts, one in North Carolina, and the fourth occurred in Canada.

In response to lawmakers' questions, she said she was not aware of any such injuries in New York State, nor of how many instances there were of cisgender girls and women causing injuries in sports. Lagreca was unable to say how breaches of the law would be handled, nor how the county might investigate allegations of violations from members of the public, other than to say such complaints would be handled on a "case by case basis."

The Republican-controlled Nassau County Legislature passed the law in a 12-5 vote after a hearing in which more than a dozen members of the public spoke to oppose the ban.

New York Attorney General Letitia James has called the restrictions both illegal and transphobic. Civil rights groups have also condemned the effort as illegal discrimination and a needless invasion of people's privacy.

In 2020, the U.S. Supreme Court ruled that discrimination on the basis of sexuality or gender identity amounts to illegal sex discrimination under the Civil Rights Act.

The New York Civil Liberties Union has said it will likely resume its litigation against the Nassau restrictions on behalf of the Long Island Roller Rebels, a women's roller derby team belonging to a league that welcomes "all transgender women, intersex women, and gender expansive participants."

(Reporting by Jonathan Allen in New York; Editing by David Gregorio)

By Jonathan Allen