Federal law protects the rights of transgender students to use both locker rooms and restrooms in alignment with their identities, a federal court in Maryland has ruled.

The decision is a legal victory for Max Brennan, a transgender boy who had been forced by Maryland’s Talbot County Public Schools to use separate restrooms and locker rooms because he is transgender. The court ruled that both Title IX and Equal Protection Clause support the decision.

After the federal appeals-court ruling in the case of Virginia’s Gavin Grimm, Brennan’s school in Maryland allowed him access to restrooms but not locker rooms. Attorneys for FreeState Justice, a legal-advocacy group for low-income LGBTQ Marylanders, had filed suit in July 2016, and American Civil Liberties Union attorneys joined the case. At that time, Brennan was a rising ninth-grader in the Easton, Maryland, school system.

The decision of the U.S. District Court for the District of Maryland joins a growing list of court decisions supporting transgender rights.

Related: Federal courts are standing up to Trump & Sessions’ anti-transgender agenda

A number of school districts in adjacent Virginia are now updating their nondiscrimination policies to include sexual orientation and gender identity.

Brennan said he was pleased with the federal-court victory.

“I am extremely happy with the court’s decision and think it’s a great step in the right direction,” Brennan said.

“I am hopeful that this case will not only help change policy for the better but help the students who are bound to come after me.”

U.S. District Court Judge George L. Russell III was specific in his ruling, which identified Brennan as “M.A.B.”

“M.A.B.’s claims come down to a boy asking his school to treat him just like any other boy. This court finds that Title IX and the Equal Protection Clause provide M.A.B. grounds to do so.”