The California Supreme Court decided unanimously Thursday that a father should not have been removed from his home based on his 3-year-old daughter's claim that he had molested her.

In a ruling written by Justice Leondra Kruger, the justices said a juvenile court judge should not base a decision on the accuracy of statements by a child too young to testify unless the youngster's claims bear "special indicia of reliability."

The decision, which clarified previous court rulings, said the requirement of reliability was "designed to ensure that children are protected from abuse while guarding against the risk that children will needlessly be separated from their parents on the basis of unreliable reports that are not subject to testing in court."

Thursday's ruling stemmed from a 2012 Alameda County child dependency case in which evidence showed the 3-year-old - identified by the court as I.C. - had been molested by an 8-year-old neighbor named Oscar.

Her mother summoned police, and the girl was examined in a hospital. An investigation proved to be inconclusive.

Two months later, the girl saw her neighbor, who attended the same school as her brother. According to her mother, I.C. was scared and confused.

About four days later, the girl told her mother, "My dad put his penis on me." Her mother corrected her, saying it was Oscar who did that. The mother questioned her husband, who called the allegation "crazy."

I.C. repeated the allegation to a child welfare worker who made an unannounced visit to her preschool, and the county then took her and her brother to a forensic facility for children. I.C. was videotaped during an interview.

The child welfare worker assigned to the case believed the allegation and filed a petition to have the children declared dependents of the juvenile court. The petition charged that the girl had been abused and that both children were at risk.

According to evidence presented during a juvenile court hearing to determine whether the children needed government protection, I.C. could not differentiate between a penis and a train. The youngster also claimed that her father had molested her stepsister, her babysitter and the babysitter's sister.

The father protested his innocence, and the mother said she believed him. After viewing the videotape of the girl's interview - unlike in criminal cases, juvenile courts may take into account statements made by children deemed too young to testify - the judge decided the girl was credible because her "core" allegation was spontaneous, had remained consistent and she had no motive to lie.

The court initially removed the children from their home but later allowed them to return to their mother, as long as the father stayed away.

A divided panel of a San Francisco-based court of appeal upheld the judge's decision.

In 2015, the Alameda County juvenile court decided the father could return home. But his lawyer, Louise Collari, said the man persisted with his appeal because he wanted his name cleared. Police investigated the child abuse allegation, Collari said, but did not bring charges.

In overturning the lower courts, the Supreme Court pointed to a ruling it had written in 2000 that said the statements of a child too young to testify may be admitted in a court proceeding if their timing, content and circumstances showed them to be reliable.

I.C.'s father did not contest the admissibility of his daughter's statements but said the juvenile court should not have relied solely on them in deciding he had molested her.

Thursday's ruling said a young child's accusations do not have to be corroborated but, according to precedent, should be evaluated for their spontaneity and consistency - as well as for the accuser's mental state, lack of motive to lie and terminology.

In I.C.'s case, the juvenile judge's decision was not supported by substantial evidence, the court found.

"The probability that I.C.'s statements resulted from her recent molestation by Oscar, and her surprise encounter with her abuser just days earlier, cannot be ignored," Kruger wrote.

The court said the evidence showed that "I.C. had a tendency to interweave fantasy with truth," and her statements contained inconsistencies and inaccuracies.

Juvenile courts also should not rely solely on the judgment of a child welfare worker assigned to a case, the court said.

Samantha Stonework-Hand, who represented Alameda County, said she could not discuss specifics of the case because juvenile matters are confidential.

Collari, a staff attorney for the First District Appellate Project, which handles appeals for low-income people, said the court's decision was needed because the accusation of child abuse "was never going to be moot for this family."

"The fact that this happened is going to stick with them forever," she said.