WASHINGTON — A federal judge in Kentucky on Thursday struck down President Joe Biden’s effort to expand protections for transgender students and make other changes to the rules governing sex discrimination in schools, ruling that the Education Department had overstepped and violated teachers’ rights by requiring them to use students’ preferred pronouns.

The ruling, which extends nationwide, came as a major blow to the Biden administration in its effort to provide new safeguards for LGBTQ+ and pregnant students, among others, through the law known as Title IX. It arrived just days before those protections were likely to face more scrutiny under the incoming Trump administration.

Chief Judge Danny C. Reeves of the Eastern District of Kentucky ruled that the Education Department could not lawfully expand the definition of Title IX to prohibit discrimination based on gender identity, as it had proposed last year.

In April, the administration announced a revised version of Title IX — a 1972 law that is part of the Civil Rights Act and prohibits sex discrimination in educational programs that receive federal funding — that applied more explicitly to transgender students. It generally prohibited schools from rejecting a student’s gender identity in most contexts.

The changes ran into opposition from Republican-led states, which filed legal challenges, including one brought by Tennessee, Kentucky, Ohio, Indiana, Virginia and West Virginia that led to the decision Thursday. Through that case and others, the rule had been temporarily blocked in 26 states.

But on Thursday, Reeves definitively ruled against the Biden administration.

Citing the Supreme Court’s sweeping decision in Loper Bright Enterprises v. Raimondo last year, which limited the regulatory power of federal agencies, Reeves wrote that the Biden administration had overstepped when it sought to enforce its new interpretation of Title IX through federal rulemaking.

The judge also rejected the revised rule on free-speech grounds, writing that it “offends the First Amendment” by potentially requiring educators to use names and pronouns associated with a student’s chosen gender identity.