A California judge suggested some parents posed a "clear and present danger" to LGBTQ students in a ruling Wednesday against a Southern California school district.

San Bernardino County Superior Court Judge Thomas S. Garza blocked a Chino Valley Unified School District's newly passed parental notification policy, which required staff to inform parents if a student identified as transgender. The temporary restraining order was issued in response to California Attorney General Rob Bonta's lawsuit against the district over the notification policy.

During the hearing, the judge reportedly compared students changing gender to changing their religion.

"Let’s say that a student were raised under one religion, then decides to change that religion on their own, at whatever age," Garza said according to The Washington Free Beacon. "With that in mind, whatever the class of protected students are, students are students. Whatever makeup that they comprise, it strikes me that you are singling out a group that is exposed to a clear and present danger."

CALIFORNIA AG ACCUSED OF ‘LYING’ AFTER HE CLAIMS PARENTAL NOTIFICATION POLICY ‘PUTS CHILDREN IN HARM’S WAY'

California school policy

A parents rights supporter holds up a sign during Chino Valley Unified School District board meeting at Don Lugo High School in Chino. (Will Lester/MediaNews Group/Inland Valley Daily Bulletin via Getty Images)

Reporters at the hearing said the judge admitted he had not fully read the school district's argument in defense of its pro-parent policy and he didn't understand its "purpose" for advancing the "educational pursuits of students."

Real Clear Politics' Susan Crabtree shared, "The judge admitted he had not fully read the district's argument against the restraining order, but said the issue is ‘how do we safeguard students identifying as LGBTQ+?’"

"He also argued that there is a ‘clear and present danger’ posed by some parents," she wrote on X, formerly known as Twitter.

The state's Attorney General had objected to the policy, arguing it "unconstitutionally discriminates" against LGBTQ students and violates their privacy rights.

He celebrated the judge's decision on Wednesday.

CALIFORNIA MOM CLAIMS DEMOCRATS ‘TRYING TO LEGISLATE FIRST AMENDMENT OUT OF EXISTENCE’ WITH SCHOOL BILL

Protester chino valley unified school district

A person holds a sign in opposition to the parental notification policy passed by the Chino Valley Unified School board. (David McNew/Getty Images)

"San Bernardino Superior Court’s decision to issue a temporary restraining order rightfully upholds the state rights of our LGBTQ+ student community and protects kids from harm by immediately halting the board’s forced outing policy," Bonta said in a press release. "While this fight is far from over, today’s ruling takes a significant step towards ensuring the physical, mental, and emotional well-being of inclusivity."

CLICK HERE FOR THE FOX NEWS APP

Chino Valley Unified School District Board of Education President Sonja Shaw blasted the judge's decision in a statement to Fox News Digital, calling opponents "government bullies."

She also criticized the attorney general for claiming the policy doesn't protect children from being abused. 

Chino Valley Unified School District Superintendent Dr. Norm Enfield, left, and President Sonja Shaw listen to a speaker talking about the parental notification policy. (Will Lester/MediaNews Group/Inland Valley Daily Bulletin via Getty Images)

"Bonta does not get to talk to us regarding our policies and procedures," she remarked. "He continues to distort the truth, and muddy the waters so everyone gets confused. Our administration regulations spell this out and he knows that. When a child wants to change their records etc., admin will ask them if their parents know. If the student says they are in danger, then right there before any harm is done as mandated reporters they are required to take action."

"Parents have a right to come to the classroom, pull records, ask questions, and be actively engaged in their child’s education," Shaw added. "Bonta's solution is to sanitize secret keeping. He is doubling down on a child’s mental health issues by encouraging an identity at home and one at school. Bonta is a direct danger to our children."

For more Culture, Media, Education, Opinion, and channel coverage, visit foxnews.com/media.