Under the guidelines, schools had been required to treat transgender students according to their stated gender identity, and either allow access to restrooms and locker rooms for the gender they identify with or provide private facilities if requested. The Obama administration had said that students' gender identities were protected under Title IX requirements, which forbid federally funded schools from discriminating on the basis of sex.
But officials in the departments Education and Justice said that their predecessors failed to make their case, citing "significant litigation" spurred by the policy.
Local and state governments as well as Congress could adopt "appropriate policies or laws" to address discrimination, bullying and harassment of lesbian, bisexual, gay or transgender students, Atty. Gen. Jeff Sessions said in a statement.
Questions about transgender students are best “solved at the state and local level,” Education Secretary
The White House cast the change as consistent with President Trump's belief in states' rights.
The Obama administration had contended that its guidance did not constitute new federal regulations or requirements, but simply represented its interpretation of existing law in response to requests for clarity from school districts and state education agencies.
But they were immediately challenged in court, and implementation of the guidance was uneven until the Texas judge blocked it.
Civil rights groups were quick to condemn the move by Trump administration officials.
"They have sent a deeply troubling message to students that the administration will not stand up for students' civil rights," the Leadership Conference on Civil and Human Rights, an umbrella organization that includes teachers unions and the NAACP, said in a statement.
Texas officials, some of the loudest opponents of the Obama-era guidance, applauded the step.
"The action taken today by the Trump administration is encouraging and my office is evaluating what impact it might bear on our ongoing litigation," Texas Atty. Gen. Ken Paxton said in a statement. "Our fight over the bathroom directive has always been about former President Obama's attempt to bypass Congress and rewrite the laws to fit his political agenda for radical social change."
The move could scuttle a Supreme Court case to be heard next month in which a transgender boy, Gavin Grimm, is seeking to use the boys' room at his Virginia high school.
He won before the U.S. appeals court in Richmond, Va., which cited the guidance letter issued by Obama administration lawyers. But on Oct. 28, less than two weeks before the presidential election, the high court agreed to hear the school board's appeal of the ruling in favor of the transgender student.
Lawyers for the Gloucester County School Board noted that the 1972 law did not forbid all sex-based policies. For example, schools may maintain separate sports teams for boys and girls. And government regulations say they also may have "separate toilet, locker rooms and shower facilities on the basis of sex."
The justices said they would rule on the validity of the Education Department's policy and on whether the 1972 law protects transgender students from discrimination.
The justices could decide to step aside for now and send the case back to the appeals court to reconsider its ruling because it was based on the Obama administration policy. Or they may press ahead and seek to rule broadly on whether the 1972 law forbids discrimination against students like Grimm.
It is also possible that after hearing arguments, they split 4-4, leaving the outcome in doubt until the arrival of a ninth justice.
The American Civil Liberties Union, which is representing Grimm, said it still expects the Supreme Court to hear the case.
In previewing the announcement earlier Wednesday, White House Press Secretary Sean Spicer noted that the guidance had not yet been fully implemented, both for legal and procedural reasons. The aim of the change, he said, was to respect states' determinations.
"The president … is a firm believer in states' rights," Spicer said.
Spicer also denied a New York Times report that DeVos was reluctant to sign off on the change.
"There is no daylight between anybody, between the president, between any of the secretaries," he said. "I think there's been some discussion between the timing of the issuance and recommendations or between the exact wording."
In California, state law forbids discriminating against students based on gender identity or gender expression.
Memoli reported from Washington and Resmovits from Los Angeles. Staff writer David G. Savage in Washington contributed to this report.
5:10 p.m.: This story was updated with reaction to the Trump administration announcement.
4:45 p.m.: This story was updated with the Trump administration rescinding guidance.
3:15 p.m.: This story was updated with reaction from a former Obama administration official.
2:30 p.m.: This story was updated with background on a Supreme Court case.