
248 N.W.2d 380 (1976)
Application of G. K. for a Writ of Habeas Corpus.
No. 11873.
Supreme Court of South Dakota.
December 31, 1976.
Rehearing Denied February 2, 1977.
*381 Thomas C. Barnett, Jr., Gary R. Thomas, Fort Thompson, for appellant.
John F. Cogley, of Morgan, Fuller, Theeler & Cogley, Mitchell, for respondent.
WINANS, Justice.
Defendant appeals from a judgment granting custody of her child to its natural father. This is the type of case in which the courts are expected to act with Solomon-like wisdom. Any solution reached in a custody case is seldom totally satisfactory. We affirm.
G. K., the natural father of T. T. G., a child, petitioned for a writ of habeas corpus in circuit court seeking custody of the child from M. G., its natural mother. Defendant's return of the writ alleged that the mother of an illegitimate child is entitled to sole custody and prayed that the proceedings *382 be dismissed. Pursuant to a motion to quash the writ the matter came on for hearing. The lower court awarded custody of the child to the father. Defendant seeks to have the judgment reversed; in the affirmative, she would have us remand for further inquiry into her present fitness.
The child is the product of unfortunate circumstances. The contestants in the matter are his unmarried, natural parents. M. G. is a resident of Mitchell, South Dakota. G. K. is now a resident of Kemmerer, Wyoming, but at the time of T. T. G.'s conception was attending college in Mitchell. The couple met in early 1972. He was 26 years old and she was 17. As a result of their relationship, M. G. became pregnant. G. K. learned of the pregnancy shortly before his graduation in August 1972. He secured employment in Boise, Idaho and before he left for that job the couple discussed the possibility of M. G. joining him there. It was financially infeasible at that time, however, so G. K. gave her money for a rental trailer in Mitchell until he could afford to bring her to Idaho.
G. K. stayed in frequent contact with M. G. and in September offered to bring her to Idaho. She requested a delay because of the Corn Palace festivities. Subsequent conversations also produced requests for delay and finally in late October M. G. refused to go to Idaho. G. K. had been sending her money throughout this period.[1] Although M. G. refused to join him, G. K. continued to send money. T. T. G. was born on April 5, 1973. G. K. voluntarily paid the expenses incident to the birth and has contributed to the support of the child on a monthly basis since that time. G. K. visited the child on his return trips to Mitchell whenever M. G. permitted him to do so.
T. T. G. has resided with his mother since his birth. M. G. has lived at various locations in Mitchell, spent three months in Georgia with her brother, and moved into her mother's home in April or May 1974.[2] In June 1974 the maternal grandmother called G. K. and requested that she receive the support payments because M. G. had been keeping all or part of the money herself. Thereafter G. K. added the grandmother's name to the support payments.
In August or September 1974 M. G. was hospitalized as a result of either cutting her wrists or taking an overdose of pills. In January 1975 she was arrested because of an altercation in her mother's home; she was charged with resisting arrest and assaulting a police officer. Pursuant to an agreement with the presiding judge, sentence was withheld because M. G. committed herself to Yankton State Hospital for thirty days of treatment for alcoholism. She failed to remain the full thirty days.
When M. G. left the hospital, she went to Cedar Rapids, Iowa to visit her boyfriend by whom she was pregnant at the time of the hearing. Except for a brief period when M. G. returned to Mitchell, T. T. G. remained in the care of his grandmother until May 1975. At that time M. G. returned and moved into a house with her son. She has never been employed; she subsists on the payments provided by G. K. and on aid provided by the Welfare Department in Davison County. In May 1975 G. K. petitioned for a writ of habeas corpus to gain custody of T. T. G.
Illegal detention is the basis for issuance of a writ of habeas corpus. When custody of a child is involved, however, the scope of the writ is enlarged and the court's equitable powers over the child are invoked. Application of Habeck, 1955, 75 S.D. 535, 69 N.W.2d 353. See also, Vanden Heuvel v. Vanden Heuvel, 1963, 254 Iowa 1391, 121 *383 N.W.2d 216; Green v. Green, 1965, 178 Neb. 207, 132 N.W.2d 380; In re Mark T., 1967, 8 Mich.App. 122, 154 N.W.2d 27; In re Richard, 1975, 14 Cal.3d 783, 122 Cal.Rptr. 531, 537 P.2d 363. As is true in all custody cases, the best interest and welfare of the child is the controlling concern. Application of Habeck, supra; In re One Minor Child, 1972, Del.Supr., 295 A.2d 727.
SDCL 21-27-5 provides:
"The court or judge to whom the application for a writ of habeas corpus is made, shall forthwith award the writ, unless it shall appear from the application itself or from any document annexed thereto, that the applicant can neither be discharged nor admitted to bail, nor in any other manner relieved."
It is defendant's contention that under this statute the writ should not issue because petitioner did not make a prima facie showing that he was entitled to custody. See State v. Foreman, 1942, 68 S.D. 412, 3 N.W.2d 477. She argues that the petition must show legitimation in order for petitioner to have standing to seek custody of an illegitimate child. She assigns as error the deprivation of custody absent legitimation by the natural father.
We start with the proposition that there is a strong public policy favoring legitimation. In re Richard, supra. See also In re Kessler's Estate, 1956, 76 S.D. 158, 74 N.W.2d 599. The legislature has provided a method whereby the father of an illegitimate child may remove the stigma of illegitimacy. SDCL 25-6-1 provides:
"The father of an illegitimate child by publicly acknowledging it as his own, receiving it as such into his family, with the consent of his wife if he is married and otherwise treating it as if it were a legitimate child, thereby adopts it as such, and such child is thereupon deemed for all purposes legitimate from the time of its birth. The other provisions of law relating to adoption shall not apply in such cases."
That G. K. is the father of the child is not disputed. He has publicly acknowledged his paternity and has otherwise treated the child as his own. The only requirement lacking is receiving the child into his family.
While the typical situation contemplates actual physical presence in the father's home, actual receipt is not required where the father has done all that he reasonably can to fulfill that requirement. G. K. voluntarily provided a place for M. G. during her pregnancy, made repeated requests that she join him in Idaho, voluntarily provided support for the child after its birth, and visited the child when he was able to do so. That the child was not actually received into his home is due only to the actions of the defendant. In view of the strong policy favoring legitimation we find that the acts of petitioner amount to constructive receipt of the child into his home. In re Richard, supra; Blythe v. Ayres, 1892, 96 Cal. 532, 31 P. 915. See also, Moreno v. Richardson, 1973, 9 Cir., 484 F.2d 899; Rodriguez v. Rodriguez, 1971, D.C.N.D.Cal., 329 F.Supp. 597. Therefore we find that T. T. G. is the legitimate child of G. K. by virtue of the latter's compliance with SDCL 25-6-1.
The question thus distilled is one of custody between parents of a legitimate child.[3] The law is clear. SDCL 30-27-19 provides:
"In awarding the custody of a minor or in appointing a general guardian, the court or judge is to be guided by the following considerations:
(1) By what appears to be for the best interests of the child in respect to its temporal and its mental and moral welfare; and if the child be of a sufficient age to form an intelligent preference, the court or judge may consider that preference in determining the question;
(2) As between parents adversely claiming the custody or guardianship, neither parent is entitled to it as of right, but, other things being equal, if the child be of tender years, it *384 should be given to the mother; if it be of an age to require education and preparation for labor or business, then to the father."
In making an award of custody the trial court has broad discretion. The controlling factor is the best interests of the child. The court's exercise of discretion will not be disturbed on appeal unless the record presents a clear case of abuse.[4]Masek v. Masek, 1975, S.D., 228 N.W.2d 334; Anderson v. Anderson, 1972, 86 S.D. 757, 201 N.W.2d 394; Oursland v. Oursland, 1968, 83 S.D. 382, 159 N.W.2d 922. We find no abuse of discretion in this case.
In an action pursuant to a writ of habeas corpus to determine the custody of a child, the relative fitness of the parents as custodians is a proper subject of judicial inquiry only to the extent that this issue affects the child's welfare. Pugh v. Pugh, 1949, 133 W.Va. 501, 56 S.E.2d 901. It was the finding of the trial court that M. G. was not a fit and proper person to have the care, custody, and control of the child; that G. K. was a fit and proper person; and that the best interests and welfare of the child dictated that custody be granted to G. K. with reasonable visitation rights to M. G.
We find substantial evidence to support the finding that the mother was not a fit and proper person. The facts discussed above need not be reiterated here. While the father did not escape unscathed, we also find that the record supports the finding that G. K. is a fit custodian. He is college educated, earns $1,350/month, has had L.P.N. training including care of young children, has a good reputation in the community, is willing to provide proper care for the child, and intends to marry in the near future to a woman willing to receive the child as her own. There is nothing clearly erroneous about these findings. Cooper v. Hileman, 1974, S.D., 222 N.W.2d 299; In re Estate of Hobelsberger, 1970, 85 S.D. 282, 181 N.W.2d 455.
The best interests and welfare of the child dictate that custody go to G. K.[5] Therefore, the judgment giving custody of the child to G. K. with the right of reasonable visitation to M. G. is affirmed.
DUNN, Chief Justice, and COLER, J., concur.
WOLLMAN and ZASTROW, JJ., dissent.
ZASTROW, Justice (dissenting).
I find that the cases cited by the majority in support of the legitimation of T. T. G. by constructive receipt are not applicable to the situation presented here. Those cases deal with situations where the courts have found legitimation in order to establish inheritance rights or insurance benefits. Each involved situations where it was physically impossible for the natural father to receive the child into his home.[1]
*385 In none of the cases does it appear that the natural mother would have objected to legitimation. In South Dakota, a natural father can secure the right of inheritance for his illegitimate child by following the procedure of written acknowledgment without receipt into the family under SDCL 29-1-15. While it is true that receipt into the family is liberally construed, most states still require that there be some receipt. 10 Am.Jur.2d, Bastards, § 55; Annot. 33 A.L.R.2d, § 21, at 748.
The common law of the states and South Dakota, by statute (SDCL 25-5-10), creates a preference to the natural mother for custody of the illegitimate child. That preference is not absolute, nor is it exclusive. The natural father does have recognized legal rights in the child. Stanley v. Illinois, 1972, 405 U.S. 645, 92 S.Ct. 1208, 31 L.Ed.2d 551. He is entitled to visitation rights so long as he has acknowledged paternity, provided reasonable financial support for the child, and has shown a genuine interest in the child. This right to visitation will be withheld under those circumstances only if it is shown that such visits would be detrimental to the best interests of the child. See Annot., 15 A.L.R.3d 887, "Right of Putative Father to Visit Illegitimate Child."
The natural father does have a right to custody of the illegitimate child superior to all but the mother. He may enforce his right to custody by demonstrating that the natural mother (1) is unfit or unsuitable to have custody of the child, (2) has abandoned or permanently relinquished the child, (3) has neglected, mistreated, or abused the child, (4) has conducted herself in a manner detrimental to the welfare of the child, or (5) has failed to provide the necessities of life for the child.[2] Of course, the natural father must show that he is a fit and proper person to have custody and has not committed any of these same actions.
Habeas corpus is an available procedure to challenge custody of an illegitimate child. In this situation the application sufficiently stated a legal basis for the writ by alleging that the natural mother is "not a fit and proper person," has "failed to provide proper parental care" and "surrendered care and responsibility," and has "failed to contribute financial support" for the child. The application recites the father's public acknowledgment of paternity, financial support, and genuine concern for the child. Such factual allegations are sufficient to warrant the issuance of the writ under the equitable powers of the court. Application of Habeck, 1955, 75 S.D. 535, 69 N.W.2d 353; Nannestad v. Nannestad, 1921, 44 S.D. 241, 183 N.W. 541.
Under the principles, stated, I would reverse the judgment of the trial court and remand for further proceedings to determine the visitation rights of the petitioner. Although the trial court did find the mother unfit, in its memorandum decision it is stated that the mother has "established a life pattern of immoral sex," "alcoholism" and "will continue as a perennial welfare recipient." Finding of fact XIII finds specifically that the mother "has never been gainfully employed." The findings of fact emphasize that the mother is again pregnant, although still not married.
The emphasis by the court upon these areas of the mother's life requires further evaluation under the principles that were apparently overlooked by the trial court.
If the mother is otherwise suitable, her right to custody of her illegitimate child is not to be denied because the natural father is better able to provide the material advantages for the child. So long as the mother can provide the necessities of life and is otherwise providing a suitable home for the child, the father's superior income is only important in determining how much support he should be contributing.
The findings of the trial court that the mother has established a pattern of immoral conduct are apparently based upon the birth of T. T. G. and the current pregnancy of M. G. without the benefit of marriage. *386 It is sufficient to state that the mother is not to be deprived of the custody of an illegitimate child merely because she has been guilty of illicit conduct following the birth of the baby, unless her conduct is such that it demonstrates her unfitness to raise the child or is detrimental to the best interests of the child. Hershey v. Hershey, 1970, 85 S.D. 58, 177 N.W.2d 267.
In this case the petitioner apparently found the moral conduct of the mother quite acceptable and was desirous of marrying her after the birth of the child. Testimony concerning her conduct since that time shows that she has a new boyfriend by whom she is pregnant and who she intends to marry. Her conduct does not appear to be any less moral than the petitioner, but for the fact that she is pregnant and the petitioner is not.
The question of the "alcoholism" of the mother highlights another principle which should be considered, i. e., the fitness of the mother is to be determined at the time of the hearing and not past conduct which is no longer continuing. Admittedly, the mother has displayed some past conduct which is certainly indefensible; however, the testimony shows that that conduct was not occurring at the time of the hearing. In fact, the trial court apparently found the living conditions and conduct of the mother sufficient to leave T. T. G. in her custody pending this appeal.
Certainly both the mother and father have shown past conduct which is less than admirable; however, the custody of T. T. G. should be based upon present considerations. Just as the petitioner has conformed his life style to a more acceptable level, the mother should also be judged on her present conduct which she is attempting to improve.
I am authorized to state that Justice WOLLMAN joins in this dissent.
NOTES
[1]  The exhibits (receipt from money orders and cashier's checks) show that G. K. sent $265.00 to M. G. during this period. For some time prior to the hearing he had been voluntarily providing between $240.00 to $300.00/month for the child's support.
[2]  The record shows that sometime early in 1974 the maternal grandmother discovered T. T. G. in the care of a minor at the Mitchell Motel where M. G. was living at the time. The infant was lying on the floor, was running a temperature, and could hardly breathe. She took him to the hospital where it was discovered he had pneumonia.
[3]  Because we find the child is legitimated, it is not necessary to address defendant's contention that she is entitled to sole custody under SDCL 25-5-10. We also leave for another day the custody rights of the father of an illegitimate child.
[4]  Other standards apply in different custody settings. When someone other than another parent challenges the custody of a parent a clear showing of gross misconduct, unfitness or other extraordinary circumstances affecting the child's welfare is required. Blow v. Lottman, 1953, 75 S.D. 127, 59 N.W.2d 825. When custody pursuant to a judicial decree is challenged, the party seeking modification must show a substantial and material change in circumstances since the decree and that the welfare and best interests of the child require the modification. Miller v. Miller, 1976, S.D., 245 N.W.2d 501. When the state interferes with parental rights, neglect or dependency must be shown by a preponderance. People in Interest of D. K., 1976, S.D., 245 N.W.2d 644.
[5]  We do not find that the tender years presumption, SDCL 30-27-19(2) requires a different result. The rebuttable presumption is that all things being equal, the mother should have custody of younger children. We find the presumption sufficiently rebutted in this case. In re Marriage of Bowen, 1974, Iowa, 219 N.W.2d 683.
[1]  In Blythe v. Ayres, 96 Cal. 532, 31 P. 915, the child lived in England and the father lived in California in the 1890's, a period when travel conditions would have prevented easy access. In Rodriguez v. Rodriguez, D.C.N.D.Cal., 329 F.Supp. 597, the father, who was prevented from marrying the mother because of the refusal of his parents to give permission, was killed in Viet Nam. In Moreno v. Richardson, 1973, 9 Cir., 484 F.2d 899, an action for social security benefits, the father had not received the child into his family because the "requirements" of the welfare department prevented him from doing so.
[2]  The various cases involving these situations are collected in the Annotations, "Right of mother to custody of illegitimate child," at 98 A.L.R.2d 417; "Right of Putative Father to Custody of Illegitimate Child," at 45 A.L.R.3d 216.
