The judge, Lloyd North, decided the child should leave his mother and live with his father. North said the boy would be exposed to “significant emotional harm” if he remained with his mother.
A psychologist said the mother persistently portrayed the boy’s father negatively and the child identified with the views she expressed.
The judge, who analysed the case at a private family court hearing in Norwich, decided the boy would enjoy a positive relationship with both parents if he lived with his father but continued to see his mother.
Details emerged after the boy’s mother challenged North’s findings at a public appeal hearing in the family division of the high court in London.
A high court judge dismissed the appeal and published a ruling.
Mr Justice Williams said the family could not be identified, adding that social services staff at Essex county council had responsibility for the boy’s welfare.
The parents separated a number of years ago, judges heard, and had been in dispute over their son’s care for much of his life.