WASHINGTON (Reuters) - The Obama administration told U.S. public schools on Friday that transgender students must be allowed to use the bathroom of their choice, upsetting Republicans and raising the likelihood of fights over federal funding and legal authority.

A sign marks an "All-Gender Restroom" at the Radcliffe Institute for Advanced Study at Harvard University in Cambridge, Massachusetts, U.S. May 13, 2016. REUTERS/Brian Snyder

Conservatives pushed back against the administration’s non-binding guidance to schools, the latest battleground in the issue of rights for lesbian, gay, bisexual and transgender Americans.

Texas Attorney General Ken Paxton said the guidance “must be challenged.”

“If President Obama thinks he can bully Texas schools into allowing men to have open access to girls in bathrooms, he better prepare for yet another legal fight,” Paxton, a Tea Party champion, said in a statement.

Other Republican-led states joined calls to disregard the White House’s directive and accused the administration of overstepping its role. In North Carolina, Governor Pat McCrory labeled the move a “massive executive branch overreach” and called on federal courts and the U.S. Congress to intercede, while Arkansas Governor Asa Hutchinson said it was “offensive, intrusive and totally lacking in common sense.”

The U.S. Education and Justice Departments, in a letter, told school districts nationwide that while the guidance carries no legal weight, they must not discriminate against students, including based on their gender identity.

The guidance contained an implicit threat that school districts defying the Obama administration’s interpretation of the law could face lawsuits or be deprived of federal aid.

The White House defended its actions, saying the guidance should not be viewed as a threat but instead as a set of “specific, tangible, real-world advice and suggestions” that many schools had sought and will welcome.

“That’s what we’re looking for: solutions that protect the safety and dignity of every single student in school,” White House spokesman Josh Earnest told reporters at a daily briefing, adding that the idea was to prevent discrimination against a range of groups extending beyond the transgender community.

Slideshow ( 4 images )

The directive came as the Justice Department and North Carolina are battling in federal court over a North Carolina state law approved in March that prohibits people from using public restrooms not corresponding to their gender assigned at birth, while other states weigh similar measures.

North Carolina’s law was the first to ban people from restrooms in public buildings and schools not matching the sex on their birth certificate. Mississippi has enacted legislation similarly viewed as discriminatory by civil and gay rights groups, and Tennessee and Missouri considered similar measures.

The letter to the schools from Washington said that, to get federal funding under existing rules, a school has to agree not to treat students or activities differently on the basis of sex. That includes not treating a transgender student differently from other students of the same gender identity, officials said.

The American Civil Liberties Union said the guidance would help make students “free to bring their whole selves to school.”

In a sign of what defiant states may face, the Justice Department this week asked a U.S. District Court in North Carolina to declare the state in violation of the 1964 Civil Rights Act and order it to stop enforcing the ban.

Americans are divided over which public restrooms should be used by transgender people, a Reuters/Ipsos poll showed, with 44 percent saying people should use them according to their biological sex and 39 percent saying they should be used according to the gender with which they identify.

A group representing U.S. school boards called the guidance “unsettled law.”

“A dispute about the intent of the federal law must ultimately be resolved by the courts and the Congress,” the National School Boards Association said in a statement.

Donald Trump, the presumptive Republican presidential nominee, was less critical than many of his party in several television interviews, saying the issue should be left up to individual states.

“Everybody has to be protected ... but it’s a tiny, tiny portion of the population,” Trump told Fox News.