A Virginia school district will pay $1.3 million in attorney's fees and costs associated with a case involving a transgender student who was not allowed to use the bathroom of his choice.

According to the American Civil Liberties Union (ACLU), the Gloucester County School Board will be ordered to pay the fees after six years of litigation.

Gavin Grimm filed his lawsuit in 2015 when he was a 15-year-old sophomore at Gloucester High School.

In June, the Supreme Court declined to review lower court decisions that found the school's policy violated Grimm's constitutional rights.

The school board informed the court on Thursday that it would pay the entire costs requested in the case.

“We are glad that this long litigation is finally over and that Gavin has been fully vindicated by the courts, but it should not have taken over six years of expensive litigation to get to this point,” said Josh Block, senior staff attorney with the ACLU LGBTQ & HIV Project. “After a year in which state legislatures have introduced an unprecedented number of bills targeting trans youth, we hope that the fee award will give other school boards and lawmakers pause before they use discrimination to score political points.”

“Rather than allow a child equal access to a safe school environment, the Gloucester School Board decided to fight this child for five years in a costly legal battle that they lost,” said Gavin Grimm. “I hope that this outcome sends a strong message to other school systems, that discrimination is an expensive losing battle.”

The Supreme Court was set to hear Grimm's case in 2017. But after the Trump administration withdrew its support for Grimm, the high court instead sent the case back to the lower courts.