Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

In a blow to advocates of transgender rights, the U.S. Supreme Court Monday said it would not hear the case of a transgender high school student fighting to use the bathroom of his choice.

The court also wiped off the books a lower court ruling in favor of the student, Gavin Grimm, who said federal law allowed him to use school restrooms matching his gender identity.

"This is a detour, not the end of the road," said the ACLU's Joshua Block, who represented Grimm.

The Supreme Court had earlier agreed to hear the case on March 28. But last month, the Trump administration announced a change in policy on the transgender issue. The lower court had relied, in part, on an earlier version of that policy.

In light of the change, the Supreme Court asked lawyers involved in the case whether it should proceed, and both sides urged the court to hear the case.

But Monday's order, with no noted dissent, took the case off the court's calendar.

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Grimm told MSNBC on Monday that he was “disappointed” that the Supreme Court would not take up the case, but he will keep fighting for the rights of transgender people to exist in public spaces.

"I’ve had so many people come up to me and say that I’ve changed their minds, I’ve helped them come to terms with either their own transition or the transition of a loved one," Grimm said. "I definitely think I’ve been seeing a real-world, very positive impact with what I’m doing and with just the conversation in general, and I can’t be more overjoyed to hear that. I think just one changed heart is totally worth it."

Advocates agreed.

"It's not a loss. It's really just a temporary setback," said Mara Keisling, executive director of National Center for Transgender Equality.

She noted that a handful of cases involving a similar issue are now working their way through the federal courts.

Grimm's case came to the Supreme Court on an appeal from the school board in Gloucester County, Virginia after the Fourth Circuit Court of Appeals ruled in favor of Grimm. He was born female but began to identify as male after his freshman year. He legally changed his name and began hormone therapy.

A bathroom sign welcomes both genders at the Cacao Cinnamon coffee shop in Durham, North Carolina, on May 3. Jonathan Drake / Reuters, file

The principal at first gave him permission to use the boys' bathroom, but the school board adopted a policy saying restrooms were "limited to the corresponding biological genders."

Grimm sued, claiming that the arrangement made him feel stigmatized and isolated, and the appeals court ruled in his favor. It said refusing to allow students to use bathrooms corresponding to their gender identity would violate a federal law known as Title IX that bans sex discrimination.

The ruling cited an Education Department letter that said "a school generally must treat transgender students consistent with their gender identity." The appeals court found that to be a reasonable interpretation of Title IX.

In February, the Trump administration rescinded the Education Department letter as well as guidance issued by the Obama administration to the nation's schools, warning them that failing to allow students to use the bathrooms matching their gender identity could cause them to lose their federal funds.

The Obama administration had also cited the court ruling in its transgender lawsuit against North Carolina's bathroom law.

Grimm's case now goes back to the Fourth Circuit. It, in turn, could send the case back to the Virginia trial court.

The Gloucester County School Board on Monday said it "looks forward to explaining why its commonsense restroom and locker room policy is legal under the Constitution and federal law."

The ACLU said it is encouraged by support for Grimm's case.

"While we’re disappointed that the Supreme Court will not be hearing Gavin’s case this term, the overwhelming level of support shown for Gavin and trans students by people across the country throughout this process shows that the American people have already moved in the right direction and that the rights of trans people cannot be ignored," said the ACLU's Block.