Updated

Schools can't prevent transgender students from using the restrooms that correspond with their gender identities without violating federal law, the Obama administration says.

The U.S. Department of Education and the Department of Justice made that argument in a friend-of-the-court brief submitted late Wednesday in support of a Virginia teenager who is suing for access to the boys' restrooms at his high school.

The government's filing says a Gloucester County School Board policy that requires 16-year-old junior Gavin Grimm to use either the girls' restrooms or a unisex bathroom constitutes unlawful bias under Title IX, the 1972 law that prohibits sex discrimination in education.

The policy denies Grimm "a benefit that every other student at this school enjoys: access to restrooms that are consistent with his or her gender identity," lawyers for the two departments wrote. "Treating a student differently from other students because his birth-assigned sex diverges from his gender identity constitutes differential treatment on the basis of sex under Title IX."

The administration's position in Grimm's case represents its clearest statement to date on a modern civil rights issue that has roiled some communities as more children identify as transgender at younger ages.

While not legally binding, it signals to school districts that may be wrestling with how to accommodate transgender students while addressing privacy concerns raised by classmates and parents which side of the debate they should take if they want to avoid a federal investigation.

The brief "sends a crucial message to schools across the country — transgender youth are valuable members of our community who are entitled to full protection of the law," Human Rights Campaign President Chad Griffin said. "No one should be humiliated or marginalized by the adults responsible for helping them to achieve."

Gloucester County Attorney Ted Wilmot was not available for comment on Thursday, his office said. After the Justice Department indicated in July that it wanted to weigh in on Grimm's lawsuit, Wilmot told the Daily Press newspaper in Newport News, Virginia that existing court precedents do not support the idea that the school board's restroom rules violate Title IX.

The Department of Education's Office for Civil Rights already has reached agreements with two southern California school districts, one in 2013 and one last year, to settle complaints of harassment and unequal treatment brought by transgender students.

In a pair of memos issued last year, one on the responsibility of schools to respond to reports of sexual violence and the other on access to single-sex classes, the office also articulated its view that Title IX entitles transgender students to be treated in accordance with their expressed gender.

Grimm, who was born female but identifies as male, told his parents he was transgender in April 2014 and was allowed to use the boys' restrooms at Gloucester High School during the last school year. After some other families complained, the school board voted 6-1 to restrict students with "transgender issues" to single-stall unisex facilities or those corresponding to their biological sex.

The American Civil Liberties Union sued to overturn the policy on his behalf in June. A federal judge sided with the school board last month, dismissing the sex discrimination claim the ACLU had advanced and that the Obama administration had embraced.

The case is now pending before the 4th U.S. Circuit Court of Appeals.