Conservative campaigners have welcomed a US judge's decision to block an Obama administration policy that public schools should allow transgender students to use the bathrooms of their choice.
The decision by Judge Reed O'Connor granted a nationwide injunction sought by 13 dissenting states just in time for the new school year.
While a setback for transgender advocates, the ruling is only the latest salvo in a larger legal and cultural battle over transgender rights that could be headed toward the US Supreme Court.
Following milestone achievements in gay rights including same-sex marriage becoming legal nationwide in 2015, transgender rights have become an increasingly contentious issue in the United States, with advocates saying the law should afford them the same rights extended to racial and religious minorities.
District Court Judge Reed O'Connor of the Northern District of Texas issued a nationwide injunction siding with the 13 states and blocking the Obama administration's bathroom guidelines on Sunday, the evening before students in much of Texas and some of the other affected states were due back in school.
O'Connor found the federal government failed to provide states with sufficient notice and opportunity for comment before issuing the guidelines. He also said the guidelines had the effect of law and contradicted existing legislative and regulatory texts.
The Family Research Council, which has campaigned vigorously against the administration's policy, said in a statement: "This is a win for parental rights and the privacy of schoolchildren nationwide! Parents in every school district in America must demand that their local school boards not sacrifice the privacy and safety of their children because of this administration's pursuit of political correctness."
Another campaign group, Alliance Defending Freedom, said on Facebook: "Schools have a duty to protect the privacy, safety, and dignity of all students, and this order from a federal district court certainly helps them in fulfilling that duty."
The US Department of Justice said it was disappointed by the decision and was reviewing its options. Legal experts expected it to appeal.
In May, the Justice and Education departments issued guidance that public schools must allow transgender students to use bathrooms, locker rooms and other intimate facilities of their choice rather than those matching their gender assigned at birth. The Justice Department has called the guidelines non-binding, saying they had no legal consequences.
But they were also backed up by a threat to withhold federal education money from states that refused to comply, drawing objections from 13 states, led by Texas, that sued.
Some conservatives have fought an expansion of transgender rights which thy see as an attack on privacy and an example of federal government overreach.
In test cases around the country, various lower courts have differed in their interpretation on whether anti-discrimination laws apply to transgender people, potentially sending the matter to the US Supreme Court for a definitive resolution.
The office of Texas Attorney General Ken Paxton, a Republican who frequently sues the Democratic Obama administration, said he was pleased with a decision against "illegal federal overreach."
But a group of five civil rights organisations supporting the Obama policy said legal precedent protects transgender students from discrimination, which a single judge cannot overturn.
"The court's misguided decision targets a small, vulnerable group of young people – transgender elementary and high school students – for potential continued harassment, stigma and abuse," said the five groups, including the American Civil Liberties Union and Lambda Legal.
Additional reporting by Reuters.