A federal appellate ruling on Tuesday protecting the right of transgender students to use restrooms according to their gender identity is an important marker in a national debate that has prompted battles in courtrooms and legislatures across the country.

The Court of Appeals for the Fourth Circuit is the first federal court to affirm the Obama administration’s position on this question. The Department of Education and the Department of Justice have asserted in individual cases that barring transgender students from using restrooms and locker rooms based on their gender identity violates Title IX, a federal civil rights law that prohibits sex discrimination in education.

The current case was brought in 2015 by a male transgender student against the school board in Gloucester County, Va., after it passed a measure barring him from using the boys’ restroom. Writing for the majority in the 2-to-1 ruling, Judge Henry Franklin Floyd found that the lower court did not give due deference to the federal government’s interpretation of Title IX when it ruled against the student, Gavin Grimm.