In a major victory for LGBT advocates fighting legislative attempts to keep transgender people out of the bathrooms corresponding with their gender identities, a federal appeals court on Tuesday sided with the Obama administration’s interpretation that an existing federal statute banning sex discrimination in education also protects transgender students seeking equal access to bathrooms and facilities.

The 2-1 decision from the 4th Circuit Court of Appeals reverses a lower court’s determination that a transgender boy did not have grounds to sue his Virginia school board under Title IX of the 1972 Education Amendments over a policy requiring him to stay out of the boys’ bathroom. At the trial court hearing last summer, U.S. District Judge Robert Doumar – a President Ronald Reagan appointee – threw out the transgender student’s Title IX argument and denied his request for a preliminary injunction, which would have allowed him to use the boys’ bathroom in accordance with his gender identity.

Though Tuesday’s decision from the 4th Circuit does not grant the preliminary injunction to the student in question, it does reinstate his Title IX claim, finding that the Department of Education’s interpretation of the civil rights law deserves deference. The decision sends the case back to Judge Doumar for review.

“We conclude that the Department’s interpretation of its own regulation … as it relates to restroom access by transgender individuals, is entitled to Auer deference and is to be accorded controlling weight in this case,” wrote Judge Henry Floyd, a President Obama appointee, in the opinion. “We reverse the district court’s contrary conclusion and its resultant dismissal of [the] Title IX claim.”

The case was brought by 16-year-old Gavin Grimm, who sued the Gloucester County School Board in eastern Virginia over a recently adopted policy preventing him from using the boys’ bathroom. Gavin lives his life in accordance with his male gender identity – he legally changed his name, takes hormone therapy and holds a driver’s license that says “M” for male. But because he was designated a girl at birth, Gavin is required under the school board’s policy to use the bathroom in the nurse’s office, a single-stall unisex bathroom, or the girl’s room at school.

RELATED: Appeals court wrestles with where trans student can go to the bathroom

It’s a policy that mirrors regulations now seen in numerous bills pending in state legislatures across the country. By far the most notorious of these measures to be introduced this year is North Carolina’s House Bill 2, which prohibits transgender people from using public restrooms in line with their gender identities. That legislation, which is facing its own legal challenge, could be significantly impacted by Tuesday’s decision seeing as the 4th Circuit has jurisdiction over North Carolina.

“Today’s ruling makes plain that North Carolina’s House Bill 2 violates Title IX by discriminating against transgender students and forcing them to use the wrong restroom at school,” said the American Civil Liberties Union, ACLU of North Carolina, and Lambda Legal in a joint statement Tuesday. “This mean-spirited law not only encourages discrimination and endangers transgender students – it puts at risk billions of dollars in federal funds that North Carolina receives for secondary and post-secondary schools.”

RELATED: Appeals court hears trans student’s challenge to school’s bathroom policy

No federal law currently exists explicitly barring discrimination on the basis of gender identity. But numerous federal agencies – including the Department of Justice and the Department of Education, both of which filed a 40-page brief with the 4th Circuit in support of Gavin – have determined that existing bans on sex discrimination cover discrimination based on gender identity as well. Tuesday marks the first time in which a federal appeals court has weighed in on a bathroom policy seen as anti-LGBT.