The U.S. Supreme Court said Tuesday that it will not hear an appeal from Pennsylvania students who claimed a high school's transgender policy violated their privacy, leaving a policy in place that allowed transgender students to use the bathrooms matching their gender identity.

“This is an enormous victory for transgender students across the country," said Ria Tabacco Mar, a senior staff attorney with the American Civil Liberties Union.

It's the second time the issue has evaded Supreme Court review. Two years ago, the justices dropped a case that raised the question after the Trump administration canceled an Obama-era policy that would have required schools to accommodate transgender students.

In the case denied Tuesday, students from Boyertown Area School District in central Pennsylvania went to court after the high school began allowing their transgender classmates to use locker rooms and restrooms based on gender identity. One of those bringing the legal challenge, identified in court papers only as Joel Doe, said he felt embarrassed by the policy, stopped changing his clothes in gym class, and eventually left the school entirely.

Five other students joined him in the lawsuit, saying the policy violated their constitutional right to bodily privacy and access to equal educational benefits. But lower courts rejected their claims. The 3rd U.S. Circuit Court of Appeals, based in Philadelphia, found that the policy served an important interest in preventing discrimination against transgender students, and the Supreme Court left that ruling intact.

"Boyertown’s schools chose to be inclusive and welcoming of transgender students in 2016, a decision the courts have affirmed again and again," said the ACLU, which defended the school district's policy in the case. "This lawsuit sought to reverse that hard-won progress by excluding transgender students from school facilities that other students use. That would have increased the stigma and discrimination that transgender students already face."

In effect, the legal dispute was about who should be required to use single-user restrooms — transgender students or other students who said the policy made them uncomfortable.

"Forcing a teenager to share a locker room or restroom with a member of the opposite sex can cause embarrassment and distress," violating their right to privacy, a court brief filed by the student challengers said.

Opening those areas to transgender students could cause others to feel harassed, violating a federal law that bans discrimination on the basis of sex, they also argued.

Although the students were named with aliases in court documents, Alexis Lightcap has since graduated. "My privacy shouldn't depend on what others believe about their own gender," she said.

But the school district said no student is required to change clothes in the view of others because privacy safeguards are in place and single-user restrooms are available. Students typically do not undress fully in common areas, few of them shower after gym class, and the school has replaced its community showers with individual shower stalls with curtains, it said.

"The district has a compelling interest in not discriminating against transgender students by excluding them from facilities that match their gender identity," the ACLU brief said. It told the story of some of the transgender students. One of them, Aiden DeStefano, was elected to the homecoming court as a boy. When he was allowed to use the boys' locker room, he said, "I am finally one of the guys, something I have waited for my whole life."

The Pennsylvania Youth Congress Foundation, which advocates for LGBTQ rights, said only four transgender students at Boyertown High School had been allowed to use restrooms or locker rooms matching their gender identity by the end of the 2016-2017 school year. Because single-use facilities were available, "No one is required to share a restroom or locker room with a transgender student — or anyone else — if he or she does not want to do so," the group said.