A judge has ordered the parents of a kindergartener to allow their son to pick his own clothes after his gender identity became the flashpoint of a bitter custody fight.

The child's parents — whose names are under a publication ban to protect the identity of their son — are separated and disagreed about whether their son, who turns five this month, identified as a girl or a boy.

The Oakville mom believed her son identified as a girl and would often send him to school dressed in stereotypically feminine clothing. The mother also used the pronoun "she" to describe her son.

The dad, who lives in Burlington, believes his son was a "normal boy" who was being forced to act like a girl by his mother. He dressed his son like a boy, even holding a bonfire to burn his son's girl clothes (at the child's request, he contends).

The dispute eventually led the Halton Children's Aid Society to remove the child and his younger sibling from their mother's care.

In her ruling released June 1, Justice Sheilagh O'Connell ruled that the shared custody agreement — which saw the parents split care of their children during the week and alternate weekends — be reinstated.

O'Connell also found that the Children's Aid Society acted too quickly when it removed the child, identified by his first initial, S., from his mother's care.

"In many respects, they are both loving and dedicated parents. However, each parent needs to permit S. a variety of ways of expressing himself and S. should be supported but not encouraged toward any gender preference," she said.

"S. has the right to express himself the way he so chooses and it is hoped that each parent will accept, respect and support S. as he develops, in whatever way he develops."

O'Connell ordered that the boy should be dressed as he wishes and not unilaterally pushed toward either a male or a female identity. If he wishes to dress like a girl, O'Connell wrote, the parent in custody of the boy is to respect this desire, but is also required to notify the other parent and the Children's Aid Society.