WASHINGTON — The Trump administration has lifted federal guidelines that said transgender students should be allowed to use public school bathrooms and locker rooms matching their chosen gender identity.

The Wednesday decision is a reversal of an Obama-era directive issued in May. It will now be up to states and school districts to interpret whether federal sex discrimination law applies to gender identity.

A letter sent to schools nationwide Wednesday by the Justice and Education departments says the earlier directive caused confusion and lawsuits over how it should be applied. The new letter says the guidance is lifted, but anti-bullying safeguards will not be affected.

Although the Obama guidance was not legally binding, transgender rights advocates say it was necessary to protect students from discrimination. Opponents argued it was federal overreach.