It is thought to be the first time such a method has been used in the Scottish courts.
The letter came from Glasgow sheriff Aisha Y Anwar, who was considering whether a father should be allowed contact with his three young children after an acrimonious split with their mother.
The letter was sent after a clinical psychologist involved in the hearings said she believed the ruling should be communicated directly to the children by the court rather than through either of their feuding parents.
The psychologist stressed how important it was for the youngsters to understand that the court had considered all the information when making the decision.
Sheriff Anwar wrote the two-page letter to the youngsters, who were aged between six and 12, detailing why she believed their father should be given a second chance to build a relationship with them.
She wrote: “I think that your dad needs some help to understand how you are feeling and to understand how he can be a better dad to you. I think that your dad needs some help to make sure he doesn’t make the same mistakes. I have asked him to get that help and he has agreed. He might also, sometimes, need some help from you to understand how you feel.
“I think your mum also needs some help to be better able to support you and to be more positive about your dad. She has agreed. I hope that she will now focus on helping you to see the good in your dad. She has told me that she will support you in getting to know your dad again, if that is what I decide is the right thing for you.
“I have also asked your mum and dad to get some help so that they can talk to each other again, even if they can’t be good friends. So, I have thought about all of this very carefully. I have especially thought about how you feel.”
QC Janys Scott, chair of the Faculty of Advocates’ Family Law Association, welcomed Sheriff Anwar’s unusual approach, saying it shows “the Scottish courts at their best”.
“She has not only made the decision she considers is in the children’s best interests, but she has thought carefully how to explain it to them so they know why she has made this decision,” said the QC.
In a similar move, a High Court judge in England recently wrote to a teenager to explain why he turned down the boy’s wish to live with his father.
Mr Justice Peter Jackson sent a letter to the 14-year-old, saying he wouldn’t permit the move because he felt his dad did not have his best interests at heart.