The parents of an 8-year-old transgender child are suing a Yorba Linda private school, saying their daughter was barred from using the girls’ restroom and was forced to wear a uniform for boys.

In their discrimination lawsuit filed Wednesday, Priya Shah and Jaspret Brar say Heritage Oak Private School advertised itself as “nondiscriminatory” but then refused to treat their daughter, Nicole (Nikki) Brar, in accordance with her gender identity.

The lawsuit says the school denied their daughter’s appeals to wear a girls’ uniform and rejected her requests to be called by the appropriate name and pronouns. The school also insisted that she use a staff restroom instead of the girls’ restroom and failed to address bullying in the classroom, according to the lawsuit.

The family is represented by Public Counsel, the largest pro bono public interest law firm in the country. In a statement through their attorney, the parents said their lawsuit is a fight for human dignity.

“We couldn’t stand to watch Nikki’s hopes and dreams be crushed because a group of adults didn’t accept her for who she is,” said her father, Jaspret Brar.

“I am forever in awe of the courage that it took for Nikki to stand up for who she is, despite all the messages she was getting from her school and from society,” said her mother Priya Shah. “Her courage to fight for her authentic self has galvanized my own.”

The suit also names the school’s Pennsylvania-based parent company, Nobel Learning Communities.

In a statement on Thursday, Kerry Owens, a spokeswoman for Nobel Learning, said transgender students in older grades have been accommodated at its schools without incident.

Owens said the school retained an outside consultant for help and was communicating with the family to discuss accommodations for Nikki.

“Unfortunately, these accommodations were rejected, and the parents withdrew their child,” she said.

Nikki was born as a boy, but as a small child began showing preferences for toys and activities associated with girls — a behavior that is typical of transgender children, according to the lawsuit.

The lawsuit says Nikki “preferred pink outfits and rainbow ponies,” and would wear her mother’s high-heeled shoes.

Just before her seventh birthday, she told her mother that she was a girl and had felt like a girl for a “long time,” according to the suit. Her parents supported her and found a therapist who specialized in gender identity for children.

The therapist “encouraged Nikki’s parents to let her buy girl’s clothes if that is what she was asking for,” the lawsuit says. “When Nikki was able to wear girl’s clothes, she was happier and liked the way she looked.”

The lawsuit says Nikki’s mother, who taught college courses in gender and transgender theory, was especially affected by her daughter’s transition because one of her students who identified as transgender later committed suicide.

“When Nikki came to Priya to tell her she was a girl, Priya thought of the student she had lost and affirmed to herself that she would keep her own child safe and supported.”

Her parents decided to enroll her at Heritage Oak, a secular school, for the 2016-2017 school year because they believed it would be academically challenging.

But while Nikki received support from her family, at Heritage Oak she suffered emotional distress and became depressed when the school did not recognize her gender, the lawsuit says.

The suit says she “talked about self-harm; isolated herself socially and would not play with other children at recess because she could not be herself with them.”

After she ripped a picture of herself in half and cried out, “I hate myself,” Nikki’s parents removed her and home-schooled her for the rest of the year, the suit says.

The lawsuit says Heritage Oak told the parents that the school is a “conservative institution” and that allowing Nikki to transition there would “create an imbalance.”

Owens, the spokeswoman for Nobel Learning, said Heritage Oak in this case was mindful of the need to support other young children, as well as Nikki.

“We believed it was extremely important to respond, not hastily, but with deliberate care, to decide when and how to inform and educate our entire elementary school community of students, staff and parents about the mid-year change of gender identity expression of a young child,” Owens said. “Due to the sensitivity of the issue and age of the child, we believed we needed expert guidance regarding timing (such as preparing children for a change they would see in spring semester of second grade and fall semester of third grade), process and age-appropriate communication.”

While there have been several lawsuits in the country involving transgender students in public schools, Kathryn Eidmann, one of the attorneys representing the family, said this is one of the first cases of a transgender student suing a private school.

Heritage Oak has been in Orange County for more than 50 years and serves students in preschool through middle school, according to its website.

Eidmann said the lawsuit was filed under California’s Unruh Civil Rights Act, which prevents business discrimination because the school is a for-profit institution.

“This case sends the message that in California we don’t tolerate this type of discrimination,” she said.

The lawsuit says Nikki now attends a school in the Placentia-Yorba Linda Unified School District, which has affirmed her gender identity and is working closely with her parents.

The family is asking for changes to the school’s policies and an unspecified amount in damages.