This petition for a writ of habeas corpus was brought pro se, under G. L. c. 248, § 1, by the father of three minor children (whom he purported to include as copetitioners) to have his visitation rights restored. The respondents are the mother of the children, a probate judge, a “family service officer” and a court psychologist. The petition was brought in the Supreme Judicial Court and transferred by a single justice of that court to the Superior Court where, after a hearing, it was dismissed for failure to state a claim upon which relief could be granted. The petitioner has appealed from an order allowing the respondents’ motion to dismiss. There was no error.
The allegations of the petition (and documents appended thereto) are imprecise, but a fair distillation of *163 the petitioner’s complaint is that he and the children, by suspension of his visitation rights, have been unlawfully restrained from associating with each other.
In May, 1973, the children’s mother was granted a decree nisi of divorce from the petitioner and was given custody of the children. The petitioner was allowed visitation rights to be exercised under supervision of a “family service officer,” 1 one of the respondents here. Nine months later, the judge, who had granted the divorce and who is also a respondent, entered an ex parte order suspending the petitioner’s visitation rights. After a full hearing held twenty-three days later on the petitioner’s motion to vacate that order, the motion was denied.
In the circumstances of this case, habeas corpus is not an appropriate remedy to test the suspension of the petitioner’s visitation rights.
2
The petitioner does not assert that the judge or the family service officer or the court psychologist are either legal or physical custodians of the children, nor does he challenge the validity of the decree giving custody of the children to their mother. “[Cjustody in the sense of restraint of liberty is a prerequisite to habeas, for the only remedy that can be granted on habeas is some form of discharge from custody.”
Fay
v.
Noia,
The petitioner appears
to be
asserting an immutable right to association with his children. There is no such right. Parents’ rights must yield to the best interests and welfare of their children. Although parents are the natural guardians of their minor children, their obligation to their children is in the nature of a trust reposed in them subject to their correlative duty of care and protection. The parents’ right to associate with their children may be terminated by their failure to discharge those obligations. See
Purinton
v.
Jamrock,
The obvious vulnerability of children to mistreatment at the hands of adults places a continuing responsibility upon the court in custody cases.
Pur-Shahriari
v.
Pur-Shahriari,
In view of our decision with respect to the propriety *165 of a habeas corpus action under these circumstances, we need not decide other claims which the petitioner seeks to raise by his petition.
Order dismissing petition affirmed.
Notes
By St. 1969, c. 771, §§ 1, 2 and 3, amending G. L. c. 276, § 83, and inserting §§ 85A and 85B, probation officers, apparently called “family service officers” to describe more accurately the nature of their duties, were added to the personnel of the Probate Courts to assist the judges in the administration of their orders of custody and support in domestic relations cases.
The petitioner has previously sought to raise the question of his visitation rights by way of a petition for a writ of habeas corpus brought in the Federal District Court. In affirming the District Court’s dismissal of that petition, the United States Court of Appeals for the First Circuit held that “[hjabeas corpus relief is not available under these circumstances.”
Donnelly
v.
Donnelly,
