Public schools must permit transgender students to use bathrooms consistent with their chosen gender identity, according to a directive issued by the Obama administration.

The guidance, from the Education and Justice departments, says public schools are obligated to treat transgender students in a way that matches their gender identity, even if their education records or identity documents indicate a different sex.

In a statement, Attorney General Loretta Lynch said: “There is no room in our schools for discrimination of any kind, including discrimination against transgender students on the basis of their sex.

The guidance, which is being sent to school districts on Friday, does not impose a legal requirement but officials said it is meant to clarify expectations of school districts that receive funding from the federal government.

North Carolina's Governor Pat McCrory

North Carolina Govenor Pat McCrory has sued the US government

It comes after the Justice Department sued North Carolina on Monday over a bathroom access law which it says violates the rights of transgender people.

In a statement, Education Secretary John King 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.”

Under the guidance, schools must treat transgender students according to their chosen gender identity as soon as a parent or guardian notifies the district that their identity “differs from previous representations or records”.

Students do not have to present a medical diagnosis or identification documents that reflect his or her identity and equal access must be given to transgender students even where it makes others uncomfortable, the directive states.

It reads: “As is consistently recognised in civil rights cases, the desire to accommodate others’ discomfort cannot justify a policy that singles out and disadvantages a particular class of students.”

The Obama administration has also released a 25-page document of questions and answers on best practices, including ways schools can protect the privacy rights of all students in toilets or locker rooms.

Gay, lesbian and transgender civil rights organisation Human Rights Campaign called the guidelines “groundbreaking”.

President Chad Griffin said in a statement: “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.”

Northa Carolina sued the US government last week over a state law which states transgender people must use public bathrooms and changing rooms that correspond to the sex on their birth certificates.