McCOY, J.
This habeas corpus proceeding. was instituted by the appellant to obtain the possession of his then five year old daughter from the respondents, who are the maternal grandmother, aunt, and uncle of said child. Much testimony was submitted, and the court made findings and judgment denying the writ, from which judgment the father appeals.
[i] The child in question was born at the home of the appellant’s mother in 1913, while appellant was residing upon a claim in the state of Montana. A few days after the birth of the child, the mother died. Since the death of the mother the child has resided with, been in the care, custody, and control of, the respondent Mrs. Carrie Egge, maternal grandmother. During the time the child resided with the respondent grandmother appellant visited the respondents and his daughter about once a year. In 1915 appellant remarried, and at the time of the hearing was the father of another child about the age of one year. The appellant and respondents are all persons of unquestionable good Christian character; all are possessed of considerable means and valuable property; the respondent grandmother resides in the city of 'Sioux Falls; the appellant resides, upon a farm in the state of Montana about 50 miles from the railroad, and about 3 miles from school and church. It is the contention of appellant that he, as the father, is, under the provisions of section 111, Civil Code 1903, and section 184, Rev. Code 1919, as an absolute legal right, entitled to the custody of his said minor child; it not being shown that he is an unfit person to have the control and custody of said child. 'Section 184 in substance provides that the father of a minor child is entitled to its custody, services, and earnings. While this statute gives the father a paramount right to the custody and control of his minor children, still we are of the view that the right is not absolute, but that it is a qualified right which must bend to whatever may be found to be for the best permanent interest of the child. Neither the father nor mother has any rights that can be allowed to militate seriously against the welfare of the child. 20 R. C. L. 597; Mercein v. People, 25 Wend. (N. Y.) 64, 35 Am. Dec. 653; United States v. Green, 3 Mason, 482, Fed. Cas. No. 15,256; Corrie v. Corrie, 42 Mich. 509, 4 N. W. 213; Houghton v. Houghton, 37 S. D. 184; 157 N. W. 316; Re Sidle, 31 N. D. 405, 154 N. W. 277.
*436[2, 3] The custody and control of a minor 'child is a most sacred trust which is cast ‘by law, first upon the father, and, upon his decease, upon the mother. But the law which thus bestows the right has reserved to itself, acting through the courts of'justice, the power of careful supervision in its exercise. The legal dominion which the parent has over the child is a qualified one and given for the discharge of an important trust, and1 in the carrying out of such trust the paramount question always is: What is for the best welfare of the child? 20 R. C. L. 601. In re Edith Pryse, 85 Kan. 556, 118 Pac. 56, 41 L. R. A. (N. S.) 564; Washaw v. Gimble, 50 Ark. 351, 7 S. W. 389; People v. Porter, 23 Ill. App. 196; Drumb v. Keen, 47 Iowa, 435; In re Beckwith, 43 Kan. 159; 23 Pac. 164; Jones v. Darnall, 103 Ind. 569, 2 N. E. 229, 53 Am. Rep. 545; Chapsky v. Wood, 26 Kan. 650, 40 Am. Rep. 321; Tyler on Infancy, 283. In a case such as this, where all parties concerned are of excellent character, and all are able, willing/ and -ready to do what they think best for the child’s welfare, it is not always a matter eas)r of decision.
Where it appears, as it does in this case, that the father'is a person of good character, and where no reason or circumstance is shown to exist why he should not have the custody and control of bis own child, we must hold, under the circumstances of this case, that his right is paramount to -that of the respondents. It is contended -by respondents that at the time of the death of the mother the appellant made a contract with the maternal grandmother whereby he gave his consent that she should care for said child. It does not appear that appellant unqualifiedly surrendered his custody and control by said contract. The provisions of the contract are somewhat vague in this respect. We are of the view that this contract should have but little weight, and should1 not be a controlling factor when considered in connection with all the surrounding circumstances. This was appellant’s first child. Ap^ pellant and his first wife were then quite young. When the wife and mother died, it was impossible for appellant to personally care for this child. No one was better qualified for giving such care than one of the grandmothers. It was possibly a moral duty resting on one or both the grandmothers to care for this 'child, and the-appellant no doubt assén-ted to the maternal grandmother having the care and custody of the child for some indefinite time and *437by reason of the force of the circumstances then existing. Now appellant has remarried, and has a home of his own. There is nothing appearing but what the present wife of appellant is a perfectly proper person to join with him in the custody, care, and control of this child. Under the -circumstances of this case we are of the view that the appellant by reason of his paramount right should say and be allowed to determine who should have the custody, care, and control of said child. We are of the view, and so hold, that appellant should have been awarded the possession of said -child.
The judgment and order appealed from are reversed, and the cause remanded, with directions to enter judgment in favor of appellant, the plaintiff, awarding him the custody, care, and control of said child.