A federal judge on Monday issued a ruling blocking Idaho from enforcing a law that prohibits transgender girls from participating in athletic competition.

U.S. District Judge David Nye was appointed by President Donald Trump in 2017.

In his 87-page ruling, Nye said that the law violates the Equal Protection Clause of the U.S. Constitution.

The Republican-led Idaho Legislature approved the “Fairness in Women's Sports Act” in March as the coronavirus epidemic was taking off. Governor Brad Little, a Republican, signed the bill into law just days after it cleared the Senate. He also signed another bill that prohibits transgender people from changing their gender marker on their birth certificates. A federal judge has ruled against the “Idaho Vital Statistics Act.”

(Related: Court blocks Idaho law prohibiting transgender people from changing sex on birth certificates.)

Supporters of the law said that it is needed because transgender women and girls have a physical advantage. Opponents argued that the bill subjects transgender athletes to invasive tests.

The lawsuit was filed by a coalition of groups – the ACLU, the ACLU of Idaho, Legal Voice, and Cooley LLP – on behalf of a track athlete at Boise State University who is transgender and a junior at Boise High School who is cisgender.

In his ruling, Nye cited the recent Supreme Court decision in Bostock that expanded the definition of sex to include gender identity.

“The proponents’ argument that Lindsay and other transgender women are not excluded from school sports because they can simply play on the men’s team is analogous to claiming homosexual individuals are not prevented from marrying under statutes preventing same-sex marriage because lesbians and gays could marry someone of a different sex,” Nye wrote, referring to the transgender plaintiff Lindsay Hecox.

(Related: Judge cites Bostock in blocking Trump's rollback of transgender protections in health care.)