A federal judge in Texas has temporarily blocked an Obama administration directive meant to expand bathroom access for transgender students in the nation’s public schools, the latest development in an ongoing battle pitting the federal government and LGBT advocates against those who believe the policy violates student privacy and infringes on states’ rights.

Texas and a dozen other states sued in an attempt to block the federal directive shortly after it was released in May, and in a 38-page opinion issued Sunday, Judge Reed O’Connor of the Northern District of Texas temporarily prohibited the federal government from enforcing it as that lawsuit proceeds. The Obama administration has said that schools must allow transgender students to use the bathrooms and school facilities that match their gender identity, citing it as a civil rights issue protected under the federal sex-discrimination law known as Title IX.

O’Connor also ruled that the federal Education and Justice departments may not launch or complete any investigations based on the Obama administration’s interpretation that Title IX’s “definition of sex includes gender identity.”

The states argued that the federal government had overstepped its authority and effectively issued new regulations for Title IX without going through the proper federal rule-writing process. Opponents of the policy have argued that it abridges student privacy rights and potentially puts them at risk in the assumed safe-spaces of single-sex bathrooms.

In granting a preliminary injunction against the government’s guidance, O’Connor ruled that the states were likely to win the case on the merits of their arguments. O’Connor’s ruling takes effect just as students across the country are returning to class after summer vacation.

The American Civil Liberties Union, which is representing a transgender student in Virginia in a case that so far as brought a higher court ruling from the Fourth Circuit Court of Appeals and might make its way to the U.S. Supreme Court, said Sunday’s ruling should not affect any ongoing cases about transgender rights.

“A ruling by a single judge in one circuit cannot and does not undo the years of clear legal precedent nationwide establishing that transgender students have the right to go to school without being singled out for discrimination,” the ACLU said in a statement. “This unfortunate and premature ruling may, however, confuse school districts that are simply trying to support their students, including their transgender students. So let us make it clear to those districts: your obligations under the law have not changed, and you are still not only allowed but required to treat transgender students fairly.”

Other LGBT advocates emphasized that Sunday’s decision does not prevent transgender individuals from suing to protect their rights.

“Students, parents and community groups are still able to — and we expect will continue to — bring lawsuits against schools that discriminate,” said Harper Jean, director of policy for the National Center for Transgender Equality. “And we expect that most schools will continue to do the right thing. Title IX still applies to them no matter what this one judge says.”

Republican officials who opposed the Obama administration’s directive welcomed the court’s decision and said it will protect students and allow individual school districts and states to address the issue in a way appropriate for their communities.

“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,” Texas Attorney General Ken Paxton (R) said in a statement Monday. “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.”

Alabama Attorney General Luther Strange, whose state also is a plaintiff in the case, said he had joined the lawsuit to prevent “social experimenters in Washington” from dictating Alabama schools’ bathroom polices. Strange called the judge’s ruling “a victory for parents and children all across Alabama.”

In Washington, Sen. James Lankford (R-Okla.), who has been critical of the Obama administration’s guidance to schools on transgender students and on sexual assault, said the Texas court had validated his view: “As my office has repeatedly stated, President Obama’s directive on public school bathrooms and locker rooms did not follow proper procedures for creating new regulations or law, just as the President has done on immigration, environmental regulations, and many other issues,” Lankford said in a statement. “No school wants any student to be bullied or discriminated against, but the Department of Education does not have the authority to operate as a national school board and impose their specific solutions on every district.”

Dena Iverson, a spokeswoman for the Justice Department, said in a statement that the agency is disappointed in the court’s decision and reviewing its options.

LGBT advocates and the Obama administration have hailed the transgender guidance as critical for protecting some of the nation’s most vulnerable children. But the Obama administration’s move in May has triggered fierce backlash from parents, politicians and advocates who call it an assault on traditional values and student privacy.

Even as the political and cultural clashes have raged, the courts have yet to offer clear answers about how and whether Title IX protects transgender students. So far, the highest court to weigh in on the issue was the Fourth Circuit Court of Appeals, which in April decided that Gavin Grimm, a transgender high school student who was born as a female can sue his Virginia school board on discrimination grounds because it banned him from the boys’ bathroom.

The appeals court deferred to the Obama administration’s position that Title IX guarantees transgender students the right to use bathrooms that correspond to their gender identity, and also ruled that Grimm’s school must allow him to use the boys’ bathroom while the case continues to wend its way through the courts.

The defendants in that case, Virginia’s Gloucester County School Board, plan to ask the Supreme Court to review the case. It is not clear whether the Supreme Court will agree to hear it, but earlier this month, the high court did grant the school district’s request on a separate issue: The district does not have to allow Grimm to use the boys’ bathroom during the upcoming school year.

O’Connor, the Texas judge, alluded to the prospect of a Supreme Court decision on the issue, writing in his decision Sunday that “a Supreme Court in the near future may obviate the issues in this lawsuit.”

Mark Berman contributed to this report.