September 25, 1941, Francis O. Merchant filed a petition for a writ of habeas corpus to recover custody of his minor daughter, Nancy Ann Merchant, aged four years. The writ issued and the child was produced in court. After a hearing the sitting justice dismissed the writ and ordered the child restored to the custody of the respondent. The case is before us on exceptions to this ruling.
The petitioner was the husband of Mary Fuella Bussell, who was the daughter of the respondent. The marriage took place March 6, 1936, and the child was born March 3, 1937. The mother died a few hours after the birth. Shortly after the funeral there was a conference at the home in Saco of Dr. Clarence E. Thompson, a brother-in-law of the respondent. There were present Mrs. Bussell, her two daughters, and the petitioner. At the hearing Mrs. Bussell testified that at this family *120conference, in response to her inquiry as to whether she could have the child, the petitioner said: “Yes, she is your child. You may bring her up.” The daughter, Catherine, corroborated her mother. Dr. Thompson testified that on the same day he had a talle with the petitioner who said: “I have given the child to Mother Bussell to remain with her as long as she lives.” It is obvious that the reference is to the fife of the grandmother. The petitioner admits that there was talk about the future of the child but denies that he ever agreed that the grandmother during her life could have.custody of his daughter. The important fact, however, is that with the father’s consent the child did remain with the grandmother who a year later moved to Rochester, N. Y., where she lived with her daughters and brought up the child. In June, 1941, the respondent’s sister, Mrs. Thompson, died and since then the respondent has made her home with her brother-in-law, Dr. Thompson, in Saco. The grandmother has given the child devoted care, has watched over her during all the vicissitudes of babyhood, has given of her time and money that her grandchild might have the same kind of home life that the respondent was able to give to her own daughters, until today there is the same devotion between grandmother and grandchild as there would have been between mother and daughter. During all this time the father has seen but little of his child, has contributed in a relatively small way to her support, has given her but little personal attention, and apparently has been quite willing that the normal ties which bind together parent and child should be severed. In 1939 he remarried and the following year a son was born to his second wife. His daughter visited him and his wife in the summer of 1940 and on bringing her back to the respondent there was not the slightest intimation that he intended to end the arrangement which had been established on the death of his first wife. In fact, he at all times seemed perfectly satisfied with the child’s bringing up and desirous that things should go on as they were, until the spring of 1941 when he requested that the child be returned to him.
*121The question before us is whether on these facts, about which there is not any real dispute, the father can as a matter of right reclaim the custody of his child.
A writ of habeas corpus is ordinarily a proper remedy for a parent who claims to have been unlawfully deprived of the custody of a child. Generally speaking, the object of a writ of habeas corpus is to release one from an illegal restraint. In the case of an adult, who may go his own way, no more is required. An infant of tender years must, however, be in the custody of someone, and to do no more- than order a release would as a rule be a futility. In such cases courts have accordingly gone farther and have entered orders providing for custody. Rex v. Delaval, 3 Burr., 1434; Richards v. Collins, 45 N. J. Eq., 283, 17 A., 831, 14 Am. St. Rep., 726; In the matter of Margaret Eliza Waldron, 13 Johns., 418; In the matter of Kottman (So. Car. 1833) 2 Hill, 363, 27 Am. Dec. 390. See In re Barry, 42 Fed. 113, and the cases cited in State v. Smith, 6 Me., 462, 20 Am. Dec., 324.The basis on which the sovereign acting through its judicial officers exercises this right is well stated in In re Barry, supra, at page 118 as follows: “The state thus acting upon the assumption that its parentage supersedes all authority conferred by birth on the natural parents, takes upon itself the power and right to dispose of the custody of children as it shall judge best for their welfare. People v. Chegary, 18 Wend. (N. Y.), 642, 643; Blissets’ Case, Lofft, 748. The cases before cited show that the English and American courts act in this behalf solely upon the assertion of the right of the sovereign whose power they administer to continue or change the custody of the child at his discretion, as parens patriae, allowing the infant, if of competent age, to elect for himself; if not, making the election for him.” Where the writ is dismissed and control of a child remains where it is, there may be no need of an order providing for custody; but we see no objection in providing, as was done in the instant case, that custody shall remain in the respondent.
No rigid rule can be laid down to guide the court in questions *122of custody. The natural right of a parent to the care and control of a child should be limited only for the most urgent reasons. At the same time it has long been recognized that such right of a parent is not absolute. It is dependent to a very considerable extent on the reasonable performance by the parent of those duties which are owed to the child, and in case of a wilful failure of a father and a mother to fulfill the obligations which parenthood has cast upon them, the sovereign acting as parens patriae may itself assume the responsibility. Where the interest of the child requires, the state may take over such obligation even though the failure of the parent is due solely to misfortune. In all cases involving custody of minors, whether the issue is presented at the instance of the state itself or by individuals calling on the sovereign power to settle a dispute between them, the welfare of the child is the controlling consideration. Kelsey v. Green, 69 Conn., 291, 37 A., 679, 38 L. R. A., 471; Berkshire v. Caley, 157 Ind., 1, 60 N. E., 696; Chapsky v. Wood, 26 Kan., 650, 40 Am. Rep., 321; State v. Smith, supra; Ex parte Bush, 240 Mich., 376, 215 N. W., 367; Richards v. Collins, supra; In the matter of Margaret Eliza Waldron, supra; Clark v. Bayer, 32 Ohio St., 299, 30 Am. Rep., 593; Hoxsie v. Potter, 16 R. I., 374, 17 A., 129; In the matter of Kottman, supra; Bellmore v. McLeod, 189 Wis., 431, 207 N. W., 699; United States v. Green, 3 Mason, 482; 25 Am. Jur., 205, Fed. Cas. No. 15256. See also the remarks of Judge Hoar in a hearing on a petition for a writ of habeas corpus In the matter of Jeremiah O’Neal reported in 3 Am. Law Rev., 578.
The principle which has been almost uniformly followed by courts for more than a century is well stated by Judge Story in United States v. Green, supra, 485, as follows: “As to the question of the right of the father to have the custody of his infant child, in a general sense it is true. But this is not on account of any absolute right of the father, but for the benefit of the infant, the law presuming it to be for its interest to be under the nurture and care of his natural protector, both for maintenance and education. When, therefore, the Court is asked to lend its *123aid to put the infant into the custody of the father, and to withdraw him from other persons, it will look into all the circumstances, and ascertain whether it will be for the real, permanent interests of the infant; and if the infant be of sufficient discretion, it will also consult its personal wishes. It will free it from all undue restraint, and endeavor, as far as possible, to administer a conscientious, parental duty with reference to its welfare. It is an entire mistake to suppose the Court is at all events bound to deliver over the infant to his father, or that the latter has an absolute vested right in the custody.”
The statement of Chief Justice Shaw in the case of Pool v. Gott, 14 Monthly Law Rep., 269, quoted in the opinion of Hoxsie v. Potter, supra, 16 R. I., 374, 376, is peculiarly applicable to the facts before us: “Although there is no agreement proved, yet the conduct of the father, during nearly the whole life of the child, furnishes reason for supposing that he surrendered his rights over the child, by a tacit understanding, if not by an express agreement. He has, for eight years or more, been able to retake the child, and has made no offer to do so. No demand or offer has been made on either side, that he should contribute to her support. His present assertion of his right is in consequence of what he deems an unreasonable refusal of a different request. By his own acquiescence he has allowed the affections on both sides to become engaged in a manner he could not but have anticipated, and permitted a state of things to arise which cannot be altered without risking the happiness and interest of his child. He has allowed the parties to go on for years in the belief that his legal rights were waived, and this relation of adoption sanctioned and approved by him. Under such circumstances I do not think that the petitioner is in a position to require the interference of the court in favor of a controlling legal right on his part, against the rights, such as they are, the feelings, and the interests of the other parties.”
In the case now before us the petitioner bases his claim solely on his supposed right as father of the child, a right which he *124seems to feel is absolute. The judge below ruled against him. It is unnecessary to decide whether there has been a technical emancipation of the child by the father. The sitting justice found that there was. The decisive consideration, however, which governed his decision in dismissing the writ and directing that the child be given into the custody of the respondent, was clearly the welfare of the child. In his decision we heartily concur.
This petitioner for a period of more than four years showed not much more than a formal interest in his child. Circumstances were such that perhaps this was inevitable. He knew that the child was well cared for and was content to let the natural ties which bound him to his offspring grow very tenuous. Since the death of his wife there is little evidence that he has had any great yearning to have his child with him, to sacrifice for her, or to lavish on her the affection which would have meant so much to her in her tender years. Instead he surrendered this high privilege to the grandmother, who with the help of her unmarried daughters has given to this child the same devotion as it would have received from its own mother. Now having permitted all this to happen he claims the right, because he is the father, to sever the ties which bind this child to the respondent. In this instance the welfare of the child is paramount. The dictates of humanity must prevail over the whims and caprice of a parent.
Exceptions overruled.