A federal judge on Tuesday struck down federal protections for LGBTQ students, saying the Biden administration attempted to rewrite the federal law.

U.S. District Judge Reed O'Connor in Fort Worth, Texas, said officials tried to re-write federal law barring sex discrimination in schools, applying it to LGBTQ students, Reuters reported. The ruling came amid a lawsuit filed by Texas' Republican Attorney General Ken Paxton.

DOJ CHARGES TEXAS DOCTOR AFTER HE BLEW THE WHISTLE ON GENDER-AFFIRMING CARE FOR MINORS

Texas Attorney General Ken Paxton

Texas Attorney General Ken Paxton speaks at the Conservative Political Action Conference (CPAC) in Dallas, Texas.  (REUTERS/Brian Snyder)

Paxton argued that legal guidance issued by the U.S. Department of Education three years ago was invalid because the agency lacked the power to adopt it and that it could not be enforced in Texas.

"Joe Biden’s unlawful effort to weaponize Title IX for his extremist agenda has been stopped in its tracks," Paxton said in a statement. "Threatening to withhold education funding by forcing states to accept ‘transgender’ policies that put women in danger was plainly illegal. Texas has prevailed on behalf of the entire nation."

It said schools could be denied federal funding for discriminating against students based on their gender identity or sexual orientation. Examples of discrimination include requiring students to use bathrooms and other facilities that correspond to the sex they were assigned at birth.

"To allow Defendants' unlawful action to stand would be to functionally rewrite Title IX in a way that shockingly transforms American education and usurps a major question from Congress," wrote O'Connor.

The Department of Justice (DOJ) building

A federal court ruling has made it more difficult for the Department of Justice (DOJ) to enforce the Foreign Agents Registration Act (FARA).  (Kent Nishimura / Los Angeles Times via Getty Images))

CLICK HERE TO GET THE FOX NEWS APP

Fox News Digital has reached out to the Department of Education and Justice Department

In April, the DOE adopted regulations applying Title IX to LGBTQ students. Tuesday's decision does not affect those rules, which Texas and other states are challenging in court, Reuters reported.