WICHITA FALLS, Texas – A federal judge in Texas on Sunday blocked the Obama administration’s recent order for all public schools to allow transgender students to use whatever bathroom and locker room facilities they choose.

U.S. District Judge Reed O’Connor granted a preliminary injunction and applied it nationwide in response to a lawsuit filed by Texas and numerous other states opposing the Obama administration directive sent to schools this spring, NPR reports.

MORE NEWS: Know These Before Moving From Cyprus To The UK

O’Connor wrote that the federal government failed to seek public comment before issuing the directive, which came with an implied threat that schools would “jeopardize their federal education funding by choosing not to comply,” according to the news site.

O’Connor contends “the plain meaning of the term sex” used when federal Title IX laws were crafted “meant the biological and anatomical differences between male and female students as determined at their birth.”

Obama’s Education and Justice departments wrote in a May letter to all schools that the federal Title IX anti-discrimination law applies to transgender students’ gender identity, or the gender they “identify” with, rather than biological sex.

Texas and 22 other states sued the federal government over the Title IX interpretation – 13 which filed a joint lawsuit that’s currently in O’Connor’s court, and 10 other states in a separate lawsuit playing out in Nebraska.

States in the Texas case requested a preliminary injunction to prohibit schools from implementing the Obama administration’s guidance until the legal process is complete, and O’Connor, NPR reports.

O’Connor wrote that the federal Title IX law is “not ambiguous” and clearly applied to biological sex when the law was written. The judge found the Obama administration’s guidelines “compulsory in nature” because they’re tied to federal education funding, and ordered all schools nationwide to “maintain the status quo” while numerous court cases on the issue proceed.

MORE NEWS: How to prepare for face-to-face classes

O’Connor said his ruling also prohibits the Obama administration from enforcing its guidelines or investigating schools based on the notion “the definition of sex includes gender identity,” according to the news site.

Justice Department spokeswoman Dena Iverson told NBC News “the department is disappointed in the court’s decision, and we are reviewing our options.”

The ruling, issued Sunday, came as students in Texas and numerous other states head back to school this week.

Texas Attorney General Ken Paxton, who initiated the lawsuit, praised the ruling against Obama’s “illegal federal overreach,” USA Today reports.

“This president is attempting to rewrite the laws enacted by the elected representatives of the people, and is threatening to take away federal funding from schools to force them to conform,” Paxton said. “That cannot be allowed to continue, which is why we took action to protect states and school districts, who are charged under state law to establish a safe and disciplined environment conducive to student learning.”

The Texas ruling came less than a month after the U.S. Supreme Court on Aug. 3 blocked a lower court ruling requiring a Virginia school district to comply with the Obama administration’s transgender directive.

The Gloucester school district’s biologically based bathroom policy can remain in effect as transgender student Gavin Grimm’s discrimination lawsuit continues forward in the court, justices ruled in a 5-3 decision, EAGnews reports.