The Trump administration has rescinded guidance enacted by his predecessor in favour of transgender students, the White House has said.
The Obama-era rule directed public schools to allow transgender pupils to use toilets of their gender identity.
But critics said that guidance was government overreach which threatened other students’ privacy and safety.
A letter sent to US schools on Wednesday outlined the change, saying the Obama directive caused confusion.
It had also sparked lawsuits and debate over how it should work in practice, the letter from the Justice and Education departments said.
Last May, Mr Obama’s justice and education departments instructed public schools to allow transgender students to use whichever bathroom corresponded to their gender identity.
Though not legally binding, Mr Obama’s order warned schools they could lose funding if they did not follow the new guidance.
The change in guidance under President Trump will have no immediate impact on schools because the Obama directive was temporarily blocked by a judge in Texas in August.
The directive sparked a backlash across the country, prompting legal challenges from 13 states and a Texas federal judge’s preliminary injunction blocking the department’s position in August.
The Obama administration’s guidance was based on its interpretation of Title IX, the federal law that prohibits sex discrimination in education.
Mr Obama argued that protection extended to gender identity.
But Mr Spicer said the previous administration’s guidelines were confusing and too difficult to implement.
During his presidential campaign, Mr Trump said transgender students should be allowed to use whichever bathroom “they feel is appropriate”.
But he reversed his stance after facing Republican criticism.
Conservative activists had praised Mr Trump’s order, saying it protected student rights to privacy.
“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.”
Meanwhile, American Federation of Teachers President Randi Weingarten called the move a major setback for trans rights.
“By rescinding these protections, the Trump administration is compromising the safety and security of some of our most vulnerable children,” she said.
“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.”