Transgender students have lost the US government protection that allowed them to use school toilets and locker rooms matching their gender identities as Donald Trump's administration stepped into a long-simmering national debate.
The administration came down on the side of states' rights, lifting the Barack Obama-era national guidelines characterised by Republicans as an example of overreach.
Without the Obama directive, it will be up to states and school districts to interpret anti-discrimination law and determine whether students should have access to restrooms in accordance with their expressed gender identity and not just their biological sex.
"This is an issue best solved at the state and local level," education secretary Betsy DeVos said.
"Schools, communities and families can find, and in many cases have found, solutions that protect all students."
In a letter to the nation's schools, the justice and education departments said the earlier guidance "has given rise to significant litigation regarding school restrooms and locker rooms".
The agencies withdrew the guidance "in order to further and more completely consider the legal issues involved".
But anti-bullying safeguards remain, according to the letter, which said: "All schools must ensure that all students, including LGBT students, are able to learn and thrive in a safe environment."
It was not clear what immediate impact the change would have on schools, as a federal judge in Texas put a temporary hold on the Obama guidance soon after it was issued, after 13 states sued.
Even without that hold, the guidance carried no force of law, but transgender rights advocates said it was useful and necessary to protect students from discrimination.
Opponents argued it was federal overreach and violated the safety and privacy of other students.
The White House said: "Returning power to the states paves the way for an open and inclusive process to take place at the local level with input from parents, students, teachers and administrators".
The reversal is a setback for transgender rights groups, which had been urging Mr Trump to keep the guidelines in place.
Advocates say federal law will still ban discrimination against students based on their gender or sexual orientation, but lifting the Obama directive still puts children in harm's way.
"Reversing this guidance tells trans kids that it's OK with the Trump administration and the Department of Education for them to be abused and harassed at school for being trans," said American Federation of Teachers president Randi Weingarten.
Activists protested against the move on Wednesday outside the White House.
Conservatives hailed the change, saying the Obama directives were illegal and violated the rights of fixed-gender students, especially girls who did not feel safe changing clothes or using toilets next to anatomical males.
"Our daughters should never be forced to share private, intimate spaces with male classmates, even if those young men are struggling with these issues," said Vicki Wilson, a member of Students and Parents for Privacy.
"It violates their right to privacy and harms their dignity."
White House spokesman Sean Spicer denied media reports that Ms DeVos, who has been criticised for her stance on LGBT issues, had opposed the change but was overruled by attorney general Jeff Sessions.
Any disagreement was merely over wording and timing, Mr Spicer said.
The Obama administration's guidance was based on its determination that Title IX, the federal law prohibiting sex discrimination in education, also applies to gender identity.
But the guidance did not sufficiently explain its interpretation of that law, Mr Sessions said in a statement.
"Congress, state legislatures and local governments are in a position to adopt appropriate policies or laws addressing this issue," he said.
Legal experts said the change in position could impact pending court cases involving the federal sex discrimination law, including a case to be heard by the Supreme Court in March involving Gavin Grimm, a transgender teenager who was denied bathroom access in Virginia.
The justices could decide not to hear the case and direct lower courts to decide that issue.
Mr Grimm said of the Trump action: "It's not positive. It has the possibility of hurting transgender students and transgender people.
"We're going to keep fighting like we have been and keep fighting for the right thing."