An openly gay couple was walking in their Oregon high school parking lot when the principal's son drove up, veered away at the last second and shouted an anti-gay slur at the two girls. In class, a teacher equated same-sex marriage with bestiality.

The girls complained to school officials in the coastal town of North Bend, but they said the harassment continued, including from the officials themselves. The school police officer even told one girl she's going to hell.

Late Monday, just days before the state education department was to convene a hearing on the matter after finding the allegations were credible, the American Civil Liberties Union of Oregon announced a settlement with the school district under which the principal of the high school will leave and the school district commits to improving the climate for Lesbian, Gay, Bisexual, Transgender and Queer students.

The ACLU of Oregon sent The Associated Press copies of the agreements, signed by North Bend School District Superintendent Bill Yester and the complainants, Olivia Funk and Hailey Smith.

"This is a tremendous achievement for our clients and all the current and future students of North Bend," said Mat dos Santos, the ACLU of Oregon's legal director. "It sends a clear message to everyone at the district: If you break the law by discriminating against LGBTQ students or engaging in religious proselytization at school, there are serious consequences."

The case underscores that, even in a generally liberal state with an openly bisexual governor who advocates for the rights of lesbian, gay, bisexual and transgender people, inequality persists.

"In Oregon, we want our children to thrive in inclusive environments and to be able to focus on learning," Gov. Kate Brown said in an email to AP. "Every student deserves to feel welcomed at their schools, and to know that they are safe — no matter where they come from or how they identify."

The ACLU of Oregon said the school district tried to sweep years of discrimination under the rug, and must be held accountable.

The North Bend School District's Facebook page was inundated by comments, most of them harshly critical, after the district posted a statement saying it disputes many of the state's findings and will present evidence to rebut them.

Dos Santos says the two — one a senior and the other a 2017 alumna — are brave young women who have made it their mission to end the mistreatment of gay students in the town of 10,000, located 175 miles (280 kilometers) southwest of Portland.

A closed hearing with school district officials, the two young women and the parties' attorneys had been scheduled for Wednesday and Thursday in North Bend, an education department spokeswoman, Victoria Nguyen, said. An investigation by the state education department has already found that the school district may have discriminated on the basis of sex or sexual orientation. Nguyen did not immediately respond to a request for comment after business hours Monday on the settlement.

Funk said she was initially too nervous to tell school administrators about the harassment, which at one point involved violence when a student hit her with a skateboard.

"I didn't trust the administration, especially after learning the principal made my friend, who was openly bisexual, read the Bible," she said.

The ACLU said both LGBTQ students and straight students have been forced to recite Bible passages as punishment in the school.

Smith recalled that her civics teacher had called her out in front of the whole class and said same-sex marriage was the same as marrying a dog. When she complained to the principal, he responded that "everybody has the right to their own opinion," Smith said.

"Simply put: All students deserve to feel safe at school. We all just want to learn and be ourselves," Smith said.

The settlement says Principal Bill Lucero must be gone starting the 2018-19 academic year.

"With Mr. Lucero gone, LGBTQ students can finally come out of the shadows." dos Santos said. "It's past time that North Bend High School make way for a more open and accepting administration."

The school district is also required to ask North Bend Police Department to remove the school police officer who told one girl she was going to hell, or provide a new officer for the role.

The school district will also hire an expert consultant in sex and sexual orientation discrimination, among other provisions of the agreement.

Smith and Funk agreed to dismiss all complaints. They did not request monetary damages but said the school should make a $1,000 gift to a local gay support group, Q & A of Coos County.

Since this case emerged, Dos Santos said numerous former and current students, parents, and staff have described allegations against the school, including a transgender boy being refused permission to play on the boys' basketball team, a black student forced to line up with his swim teammates from lightest to darkest skin color. An exchange student from Spain was awarded the "Best Mexican" award by the swim team, he said.

___

Follow Andrew Selsky on Twitter at https://twitter.com/andrewselsky