The opinion of the court was delivered by
Burch, J.:The proceeding was one of habeas corpus, commenced by a father to obtain custody of his child from its *516maternal grandparents. The judgment was that the child be placed in the custody of a third person. The respondents appeal.
The child is a girl, who was some six and a half years old when the proceeding was commenced. Her father and mother had been divorced, and in the divorce action she was given to her mother. The mother lived with the respondents for several years, remarried, and removed to Missouri. She died shortly before the present proceeding was instituted, and the child, was left with the respondents. The court found that the father was not, at the time of the trial, a proper person to have care and custody of the child. She had a good home with her grandparents, but bad feeling existed between them and the father. The evidence was clear that the father’s right to visit his daughter, and thus improve meager occasion to gratify his affection for her and stimulate her affection for him, could not be indulged and protected if she remained with her grandparents; hence the order placing the child in the custody of a suitable woman not related to any of the contestants.
The defendants argue that the issues made by the writ and the return were, whether or not the respondents unlawfully held possession of the child, and whether or not the father was a fit person to be entrusted with her custody; that both these issues were found in favor of the respondents; and, hence, that the judgment is erroneous because outside the issues.
Welfare of the child is always an issue in this class of cases. Rights of parents and claims of grandparents must all yield, under proper circumstances, to the best interest of the child, and in a habeas corpus proceeding the court may award custody accordingly. Right of a parent to visit his child is a restricted form of that right to society which may be enjoyed in full by virtue of custody. Forfeiture of right of custody does not of necessity forfeit right of visitation, and in a proper case a claim of the unrestricted society which is embraced in and consequent upon custody may be granted in part by providing for visitation. In this instance, the court concluded the father’s right and the little girl’s welfare required that they should enjoy each other’s society to a limited *517extent, free from exposure to the baneful influences and consequences of the hostility of the grandparents toward the father.
The judgment of the district court is affirmed.