A federal judge in Portland has ruled that allowing a transgender high school student in a small Oregon school district to use the boys’ locker room and restrooms doesn’t violate the privacy rights of other students who object to sharing the spaces.

U.S. District Judge Marco Hernandez on Tuesday threw out a lawsuit filed by Parents for Privacy against the Dallas School District. Hernandez said transgender students have a right to use restrooms and locker rooms that correspond with their gender identity.

And if the parents of other students -- some of them devout Christians -- don’t like that, they're free to pull their children from the school, the judge said.

“It is within (their) right to remove their children from Dallas High School if they disapprove of transgender student access to facilities,” Hernandez wrote in a 56-page opinion. Dallas is 15 miles west of Salem.

The judge said the right of transgender students to be free of discrimination in school is outlined in Oregon law.

His ruling drew praise from the ACLU of Oregon and the LGBTQ advocacy group Basic Rights Oregon. Both fought against the lawsuit.

Gabriel Arkles, an ACLU attorney, said the Dallas lawsuit is part of a nationwide trend targeting young transgender people. Arkles said every federal judge asked to rule on similar cases has sided with the transgender students.

A similar lawsuit was filed recently in Sutherlin, population 8,000, 13 miles north of Roseburg. ACLU of Oregon vowed to fight that suit, as well.

“We will continue to defend transgender students in Oregon from these harmful lawsuits,” ACLU legal director Mat dos Santos said in a news release. “All students deserve a safe and accepting learning environment, regardless of gender identity. We know that when transgender youth are allowed to show up as their true selves, they thrive and make meaningful contributions to the community. This makes schools better for everyone.”

Attorneys for Parents for Privacy couldn’t be reached immediately Wednesday. But in court papers, they argued that as parents, they have a "duty to instill moral standards and values in their children."

They also contended that the children are concerned about maintaining their modesty in front of transgender classmates.

"These students have the sincere religious belief that they must not undress, or use the restroom, in the presence of the opposite biological sex, and also that they must not be in the presence of the opposite biological sex while the opposite biological sex is undressing or using the restroom,” the group said in court documents.

The lawsuit was filed last November against the school district, the Oregon Department of Education and the U.S. Department of Education. It sought to eliminate a Dallas School District policy created so then-senior Elliott Yoder could use the boys' locker rooms and restrooms at his 900-student school.

Yoder was designated as female at birth but identifies as male.

Read Hernandez's opinion here.

-- Aimee Green