US states are making a stand after President Donald Trump's decision to rescind federal guidance that said transgender pupils should be able to use school toilets and changing rooms that match their gender identity.

New York's top lawyer criticised the move as "cruel" while a Los Angeles schools boss said her city "embraces all students".

The Obama administration instructed public schools last year to allow transgender children to use the bathrooms that matched their gender identity, and threatened to withhold federal funding if they were forced to use other restrooms against their will.

The controversial orders Donald Trump has already issued Show all 9 1 /9 The controversial orders Donald Trump has already issued The controversial orders Donald Trump has already issued Trump and the media White House Press Secretary Sean Spicer takes questions during the daily press briefing Getty Images The controversial orders Donald Trump has already issued Trump and the Trans-Pacific Partnership Union leaders applaud US President Donald Trump for signing an executive order withdrawing the US from the Trans-Pacific Partnership negotiations during a meeting in the Roosevelt Room of the White House in Washington DC. Mr Trump issued a presidential memorandum in January announcing that the US would withdraw from the trade deal Getty The controversial orders Donald Trump has already issued Trump and the Mexico wall A US Border Patrol vehicle sits waiting for illegal immigrants at a fence opening near the US-Mexico border near McAllen, Texas. The number of incoming immigrants has surged ahead of the upcoming Presidential inauguration of Donald Trump, who has pledged to build a wall along the US-Mexico border. A signature campaign promise, Mr Trump outlined his intention to build a border wall on the US-Mexico border days after taking office Getty Images The controversial orders Donald Trump has already issued Trump and abortion US President Donald Trump signs an executive order as Chief of Staff Reince Priebus looks on in the Oval Office of the White House. Mr Trump reinstated a ban on American financial aide being granted to non-governmental organizations that provide abortion counseling, provide abortion referrals, or advocate for abortion access outside of the United States Getty Images The controversial orders Donald Trump has already issued Trump and the Dakota Access pipeline Opponents of the Keystone XL and Dakota Access pipelines hold a rally as they protest US President Donald Trump's executive orders advancing their construction, at Columbus Circle in New York. US President Donald Trump signed executive orders reviving the construction of two controversial oil pipelines, but said the projects would be subject to renegotiation Getty Images The controversial orders Donald Trump has already issued Trump and 'Obamacare' Nancy Pelosi who is the minority leader of the House of Representatives speaks beside House Democrats at an event to protect the Affordable Care Act in Los Angeles, California. US President Donald Trump's effort to make good on his campaign promise to repeal and replace the healthcare law failed when Republicans failed to get enough votes. Mr Trump has promised to revisit the matter Getty Images The controversial orders Donald Trump has already issued Donald Trump and 'sanctuary cities' US President Donald Trump signed an executive order in January threatening to pull funding for so-called "sanctuary cities" if they do not comply with federal immigration law AP The controversial orders Donald Trump has already issued Trump and the travel ban US President Donald Trump has attempted twice to restrict travel into the United States from several predominantly Muslim countries. The first attempt, in February, was met with swift opposition from protesters who flocked to airports around the country. That travel ban was later blocked by the Ninth Circuit Court of Appeals. The second ban was blocked by a federal judge a day before it was scheduled to be implemented in mid-March SANDY HUFFAKER/AFP/Getty Images The controversial orders Donald Trump has already issued Trump and climate change US President Donald Trump sought to dismantle several of his predecessor's actions on climate change in March. His order instructed the Environmental Protection Agency to reevaluate the Clean Power Plan, which would cap power plant emissions Shannon Stapleton/Reuters

While the Trump administration's new letter to schools says the guidelines have been lifted, anti-bullying safeguards will remain in effect. States and school districts will now have the power to interpret whether federal sex discrimination law applies to gender identity.

New York state Attorney General Eric Schneiderman said: "President Trump's decision to rescind anti-discrimination protections for transgender students is yet another cruel move by an administration committed to divisive policies that roll back the clock on civil rights.

"Transgender individuals deserve to live in dignity, without fear of bullying or discrimination. I will do whatever it takes to protect transgender and all LGBTQ New Yorkers, no matter what happens in Washington."

Last year the outspoken Mr Schneiderman announced he would "fight @realDonaldTrump, his dangerous appointees, and their radical agenda".

Bob Ferguson, the Washington state Attorney General, said: "While the Trump administration has taken a disappointing step backward, the civil rights of transgender individuals will continue to be protected under Washington state law."

Washington is one of nearly 20 states to offer "explicit civil rights protections" for transgender people, his office said in a statement.

Superintendent Michelle King, of the Los Angeles unified school district, said students "will remain protected regardless of the new directive". She added: "The district embraces all students and remains committed to affirming a safe, productive learning environment for everyone."

However, the Gloucester County school board in Virginia, which is currently fighting a Supreme Court case on whether it can ban a transgender male pupil from the boys' toilets, welcomed the new letter, saying it was "pleased" states' "primary role" in setting local policy had been recognised.

And Texas Attorney General Ken Paxton, who led opposition to the Obama ruling, said the former president had tried to "bypass Congress and rewrite the laws to fit his political agenda for radical social change", according to Reuters.

White House press secretary Sean Spicer said President Trump was "a firm believer in states' rights and that certain issues like this are not best dealt with at the federal level".

The previous rules had led to legal confusion among states, according to the letter sent to schools by the education and justice departments.

The New York Times reported that education secretary Betsy DeVos resisted signing off on the new order because she was uncomfortable about potential harm to pupils. Attorney General Jeff Sessions pushed her to accept it and Mr Trump sided with him, it was claimed.

During his confirmation hearing, Mr Sessions told senators he still opposed same-sex marriage and the Supreme Court's decision in Roe vs Wade, the landmark case that guaranteed women's right to have abortions.

In January Mr Trump promised not to repeal an Obama-era ruling that order banned companies doing business with the federal government from discriminating on the basis of sexual orientation or gender identity.

The White House said at the time: "President Trump continues to be respectful and supportive of LGBTQ rights, just as he was throughout the election."

But activists have criticised his latest move.