(CNN) The Obama administration issued guidance Friday directing public schools to allow transgender students to use bathrooms matching their gender identity.

A joint letter from the Departments of Education and Justice went to schools Friday with guidelines to ensure that "transgender students enjoy a supportive and nondiscriminatory school environment," the Obama administration said.

The announcement comes amid a heated national debate over transgender rights in schools and public life. The administration is embroiled in a legal standoff with North Carolina over its controversial House Bill 2, part of which has to do with transgender bathroom access. Other states and local governments have attempted to draw lines around rights for transgender people with mixed results.

This latest guidance for schools goes beyond the bathroom issue, touching upon privacy rights, education records and sex-segregated athletics, all but guaranteeing transgender students the right to identify in school as they choose. It echoes what members of the administration have previously said on the topic.

"There is no room in our schools for discrimination of any kind, including discrimination against transgender students on the basis of their sex," Attorney General Loretta Lynch said. "This guidance gives administrators, teachers and parents the tools they need to protect transgender students from peer harassment and to identify and address unjust school policies."

The letter does not carry the force of law but the message was clear: Fall in line or face loss of federal funding.

North Carolina Gov. Pat McCrory slammed the guidance and called on Congress to address the issue.

"Most Americans, including this governor, believe that government is searching for a solution to a problem that has yet to be defined. Now, both the federal courts and the U.S. Congress must intercede to stop this massive executive branch overreach, which clearly oversteps constitutional authority," McCrory said in a statement.

Sen. Lamar Alexander, the chairman of the Senate Health, Education, Labor and Pensions Committee, reiterated in a statement that the guidance was not federal.

"This is the kind of issue that parents, schools boards, communities, students and teachers should be allowed to work out in a practical way with a maximum amount of respect for the individual rights of all students. Insofar as the federal government goes, it's up to Congress to write the law, not the executive departments," the Tennessee Republican said.

Justice and Education Department officials have repeatedly emphasized that under their interpretation of Title IX, the federal anti-discrimination law in education, schools receiving federal funds may not discriminate based on a student's sex, including a student's transgender status.

Photos: Know your identity terms Photos: Know your identity terms New terms are entering the cultural lexicon as people endeavor to codify their sexual orientation or gender. These definitions, which have been edited, are primarily from the LGBTQ advocacy group The Trevor Project. The gender fluid definition is from Dictionary.com. Visit The Trevor Project for more details Hide Caption 1 of 10 Photos: Know your identity terms Hide Caption 2 of 10 Photos: Know your identity terms Hide Caption 3 of 10 Photos: Know your identity terms Hide Caption 4 of 10 Photos: Know your identity terms Hide Caption 5 of 10 Photos: Know your identity terms Hide Caption 6 of 10 Photos: Know your identity terms Hide Caption 7 of 10 Photos: Know your identity terms Hide Caption 8 of 10 Photos: Know your identity terms Hide Caption 9 of 10 Photos: Know your identity terms Hide Caption 10 of 10

"The guidance makes clear that both federal agencies treat a student's gender identity as the student's sex for purposes of enforcing Title IX," the administration said Thursday.

Texas Lt. Gov. Dan Patrick accused the Obama administration of "blackmail" and called the guidance "social engineering."

"The families in America will not accept it," Patrick said at a news conference.

Mississippi Gov. Phil Bryant issued a statement Friday afternoon calling the directive "outrageous" and directed his state's education department to disregard the order.

"The directive is nonbinding and does not carry the force of law," Bryant said. "Because these decisions are better left to the states, and not made at the point of a federal bayonet, Mississippi's public schools should not participate in the president's social experiment."

And Texas Sen. Ted Cruz, who often railed against such laws when he was a presidential candidate, blasted the administration's directive in a statement.

"America has woken up to yet another example of President Barack Obama doing through executive fiat what he cannot get done through our democratic process," Cruz said, adding, "Having spent many years in law enforcement, I've handled far too many cases of child molesters, of pedophiles, of people who abused little kids. The threats of predators are serious, and we should not facilitate allowing grown men or boys to be in bathrooms with little girls."

'Groundbreaking guidelines'

LGBT groups praised the announcement, calling it a validation of transgender rights and a repudiation of so-called "bathroom bills" that legislate bathroom access.

"These groundbreaking guidelines not only underscore the Obama administration's position that discriminating against transgender students is flat-out against the law, but they provide public school districts with needed and specific guidance guaranteeing that transgender students should be using facilities consistent with their gender identity," said Human Rights Campaign President Chad Griffin.

"This is a truly significant moment not only for transgender young people but for all young people, sending a message that every student deserves to be treated fairly and supported by their teachers and schools."

The letter emphasizes the departments' shared position that schools should treat transgender students the way they want to be treated, regardless of how others may feel about it.

Snapshot: North Carolina's transgender law Name: Public Facilities Privacy and Security Act When it passed: March 23 Who voted for it: The bill passed the state House 82-26 and the state Senate 32-0, with Senate Democrats walking out and not voting in protest. What it does: The new law puts in place a statewide policy that bans individuals from using public bathrooms that do not correspond to their biological sex. It also stops cities from passing anti-discrimination ordinances to protect gay and transgender people. What happens next: A federal lawsuit has been filed over the measure. The state's attorney general says he won't defend it in court. But in the court of public opinion, Gov. Pat McCrory and other supporters of the measure have staunchly stood behind it, saying it's about protecting privacy.

Schools should let transgender students use bathrooms, locker rooms and other sex-segregated facilities consistent with their gender identity, according to the guidance. Staff should address transgender students by their preferred names and pronouns. Schools cannot require students to have a medical diagnosis, undergo any medical treatment, or produce a birth certificate before treating them consistent with their gender identity, the guidance states.

"As is consistently recognized in civil rights cases, the desire to accommodate others' discomfort cannot justify a policy that singles out and disadvantages a particular class of students to ensure that all students, including transgender students, can attend school in an environment free from discrimination based on sex," the letter says.

The guidance takes the same approach to the bathroom issue: A school may provide gender-separated facilities but it must allow transgender students access to such facilities consistent with their gender identity. If a school opts for individual stalls it must make them available to all students.

U.S. Secretary of Education John B. King Jr. said the letter comes in response to request from schools and parents seeking guidance.

"This guidance further clarifies what we've said repeatedly -- that gender identity is protected under Title IX," he said. "We must ensure that our young people know that whoever they are or wherever they come from, they have the opportunity to get a great education in an environment free from discrimination, harassment and violence."