
69 N.W.2d 353 (1955)
Application of Muriel HABECK and Mrs. Charles B. McGuire for a Writ of Habeas Corpus.
No. 9470.
Supreme Court of South Dakota.
March 28, 1955.
*355 Morgan & Fuller, Mitchell, Whiting, Lynn & Freiberg, Rapid City, for appellants.
Hendricksen & Morrison, Richard B. Denu, Rapid City, for respondents.
ROBERTS, Judge.
This is a proceeding in habeas corpus instituted in the Circuit Court of Pennington County to obtain the custody of the three children, aged six, seven and nine, of Muriel Habeck and her former husband, Orville Habeck. The proceeding was commenced by the mother and the paternal grandmother, Mrs. Charles B. McGuire. From a judgment awarding custody of the children to Frank and Margaret Wolff, Rapid City, South Dakota, applicants have appealed.
Muriel Habeck commenced an action for a divorce against Orville Habeck in the District Court of Cass County, North Dakota. On March 14, 1951, a decree was duly entered in that court granting to the plaintiff a divorce and awarding to her custody of their three children. On December 10, 1952, on motion of the defendant in the divorce action, the court finding that the mother was not a fit and proper person to have the care and control of the children awarded their custody to the father. On June 29, 1953, Muriel Habeck made application for modification of the decree insofar as it related to the custody and support of the minor children. Service of an order to show cause in the proceeding for modification was had on defendant at Chamberlain, South Dakota. He was not present at the hearing and was not represented. However, his counsel filed a special appearance for the purpose of objecting to the court's jurisdiction. On July 23, 1953, the court modified the divorce decree awarding custody of the children to the paternal grandmother, Mrs. Charles B. McGuire, residing in Fargo, North Dakota.
On October 9, 1953, Mrs. Habeck instituted an action in the Circuit Court of Douglas County, South Dakota, against her former husband for the enforcement of the North Dakota decree awarding custody to the paternal grandmother and obtained an order enjoining the removal of the children from the jurisdiction of the court. Defendant father thereupon filed an answer alleging invalidity of the modified decree of July 23, 1953, and also a cross-complaint praying that the court permit the children to remain in the care of Frank and Margaret Wolff. The cross-complaint was based upon the contentions that Mrs. McGuire to whom custody had been awarded was not a fit and proper person to have custody and that the Wolffs, having for the past nine months had the care and control of the children and having instituted proceedings for their adoption, would provide them with a normal home life. The application of the Wolffs to intervene was denied on the ground that the same having been made after trial was not timely. The court heard the evidence and expressly found that Mrs. McGuire is a fit and proper person to have custody. The court further found that no evidence was offered to disprove the findings of the North Dakota court or that there had been a change in circumstances following the entry of the modified decree in that case and gave full recognition to such decree and ordered that the children be surrendered by Frank and Margaret Wolff in whose care they were placed by the father and delivered into the custody of Mrs. McGuire.
The application for the writ of habeas corpus filed in the instant proceeding on March 23, 1954, sets forth the proceedings and decree in the Circuit Court of Douglas County as establishing the right of Mrs. McGuire to custody of the children and *356 alleges the illegality of their restraint. Writ of habeas corpus was issued and served upon Frank and Margaret Wolff. Although no return was filed, evidence was received as to the respective claims of the parties. The court found that "Mrs. Charles B. McGuire is a woman of 57 years of age, of good qualities and character and adequate financial means and property"; that when the children were placed in the care of the Wolffs in March of 1953 their condition "indicated a previous lack of adequate physical care, discipline, training, supervision and guidance"; and that the respondents are persons "of good qualities and character, with adequate financial means and property" and are "providing a good home for the said three children and are properly raising, training and educating them to become good citizens and are providing good Christian training for them." The court concluded that the best interest and welfare of the children demand that they remain with the Wolffs and that custody be awarded to them.
Appellants contend (1) that the trial court was without authority to proceed to a determination of the rights of the respondents in the absence of a return; (2) that the only question before the court in the instant proceeding was the legality of the restraint of the children by the respondents inasmuch as their best interest and welfare had been determined and their custody adjudicated by the Circuit Court of Douglas County, a court of concurrent jurisdiction; and (3) that as between a grandparent and third persons, adversely claiming custody of children, the grandparent is entitled to preference.
The purpose of an application for writ of habeas corpus is to secure the issuance of the writ and it ceases to function when the writ has issued. The writ requires a return and it may be controverted by denial or by allegations of other facts. SDC 37.5504. The return is the first and principal pleading and corresponds to a complaint in a civil action. 39 C.J.S., Habeas Corpus, § 88. The respondents should have filed a return, but the irregularity in the pleadings or proceeding in this regard has not affected the substantial rights of the parties. We have concluded to treat the record as though a return to the writ had been filed setting forth the claims that the award of the custody of the children as between the parties in prior decrees was not binding upon the respondents, not parties thereto, and that the best interest and welfare of the children required that their care and control be continued in the respondents.
The North Dakota court had jurisdiction in the divorce action both of the parties and of the children of the marriage. They were all domiciled and present in that state when the action was commenced and defendant husband was represented therein by counsel. Where jurisdiction to grant a divorce and award custody of the minor children of the marriage once attaches, that jurisdiction, under a statute in that state, is a continuing one and the court may vacate or modify a decree with reference to custody as existing conditions may demand. See Hedman v. Hedman, N.D., 62 N.W.2d 223, and cases cited. The removal of the children from the state by the father to whom they were awarded did not deprive the District Court of Cass County of jurisdiction to exercise the reserved and continuing power regarding their custody. 17 Am.Jur., Divorce and Separation, § 686; Annotation 9 A.L.R.2d 434. The special appearance filed by the father specified no grounds for his objection to the jurisdiction of the court. Insofar as it appears from the record, the father retained his domicile in North Dakota. In case of a divorce or separation, the domicile of a minor child is that of the parent to whose custody it has been legally awarded. The children were residing with the Wolffs under an arrangement between them and the father. Their custody in legal effect continued in the father and such being the case their domicile was not changed and was that of the father at the time of the modification of the divorce decree awarding custody to the paternal grandmother. May v. Anderson, 345 U.S. 528, 73 S.Ct. 840, 97 L.Ed. 1221, cited by respondents in support *357 of the contention that the modified decree is ineffective in this state, is distinguishable. There a father instituted a suit for a divorce and the only service of process upon the mother was the delivery to her in another state wherein she was domiciled of a copy of summons and petition. The mother entered no appearance and took no part in the proceeding. Because of the absence of personal service, the decree insofar as it awarded custody of their children to the father was not entitled to extra-territorial recognition.
It is true as respondents contend that the paramount and controlling issue in a contest concerning the custody of minor children is their best interest and welfare. Tompkins v. Lutheran Welfare Soc. of South Dakota, 74 S.D. 286, 52 N.W.2d 99; Sweeney v. Joneson, S.D., 63 N.W.2d 249. It is well settled, however, that after a court has heard evidence with reference to the custody of minor children and ruled upon the question the jurisdiction of the court cannot again be invoked to inquire into the same or other facts existing at the time or prior to the former decree. The rule is that there must be a change of circumstances arising after entry of the former decree to justify a modification. Matthews v. Matthews, 71 S.D. 115, 22 N.W.2d 27. Under the doctrine of comity prevailing among the states the same rule of finality applies; the provisions of a divorce decree in another state awarding custody, except as fraud or want of jurisdiction may affect their validity, are to be given full effect under the circumstances existing at the time of the entry of the decree. See Annotations in 20 A.L.R. 815; 72 A.L.R. 441; 116 A.L.R. 1299; and 160 A.L.R. 400. The Circuit Court of Douglas County indicated by its findings that as between the father and mother the facts upon which the North Dakota court based its modified decree awarding custody to Mrs. McGuire were res adjudicata and properly concluded that in the absence of a change of circumstances affecting the welfare of the children such decree was entitled to full faith and credit in this state.
The basis for the issuance of a writ of habeas corpus ordinarily is illegal detention. State ex rel. Anderson v. Jameson, 52 S.D. 524, 219 N.W. 118. There are two kinds of writs of habeas corpus involving infants. The one is directed toward freeing an infant from unlawful restraint of his liberty and the other is the exercise of the equity powers of a court over the person of an infant. 39 C.J.S., Habeas Corpus, § 41. In the view we take, we put aside the questions whether the court below had authority to inquire into the best interest and welfare of the three children and whether the only issue properly before the court whose jurisdiction was invoked to enforce a decree of a court of concurrent jurisdiction was the legality of restraint of the children by respondents. Even if it be assumed that the rights of respondents, if any they have, were not adjudicated by the decree of the Circuit Court of Douglas County and if the equitable powers of the court below to determine custody as the best interest and welfare of the children required were invoked we conclude that there was no such proof as would authorize awarding custody of the children to the respondents.
Respondents do not claim that they obtained legal and permanent custody of the children by adoption, guardianship or otherwise. Nor is this a case where a parent has left a child with a relative or other person for a long period of time and then seeks to recover custody. See Nannestad v. Nannestad, 44 S.D. 241, 183 N.W. 541. So far as it appears from the facts presented there is no reason for the state in the exercise of its sovereign protective power over destitute or homeless children found within its borders to intervene. There is no claim of abandonment or forfeiture or a legal surrender of parental rights. The fact that the father placed the children in the care of respondents did not give to them the legal right to permanent custody. The evidence shows that respondents are financially able to support and educate the children and their fitness to be awarded the care and custody of the children *358 is unquestioned. But a contest between a legal custodian and nonparents cannot be determined upon the factual issue as to which party will provide the greater comfort, the better education and the promise of the greater material advantages. People ex rel. Kropp v. Shepsky, 305 N.Y. 465, 113 N.E.2d 801; Ex parte Kirschner, N.J.Ch., 111 A. 737; Child Sav. Inst. v. Knobel, 327 Mo. 609, 37 S.W.2d 920, 76 A.L.R. 1068.
The record shows that the appellant, Mrs. McGuire, is the legally designated custodian of the children. In 43 C.J.S., Infants, § 7, it is said: "The court should not refuse an application for the custody of a child by a person who has the legal right to the custody, if the applicant is a fit person." We have said that where a mother is not shown to be an unfit person she has a right to the custody of her child superior to a relative. Blow v. Lottman, S.D., 59 N.W.2d 825; Sweeney v. Joneson, supra. The same burden of proof should apply where a nonparent would take or withhold custody of a minor from its legal custodian. In Child Sav. Inst. v. Knobel [327 Mo. 609, 37 S.W.2d 924], the exact contention was considered by the Supreme Court of Missouri. Two minor children had been placed by their father in the custody of the Child Saving Institute, a charitable institution located in Omaha, Nebraska. The children were taken by residents of the State of Missouri under an agreement either to adopt or return after a trial period. A decree of adoption as to one of the children was rendered in Missouri without notice to the institute. Concerning the right to custody notwithstanding the invalidity of the adoption proceeding the court said: "We start out with the proposition that the Child Saving Institute had the legal custody of these children at the time respondents took them from the institute. Has anything happened since that time to deprive the institute of its right to their legal custody? Respondents' custody of the children during the trial period, under an agreement to adopt them if they proved satisfactory and to return them to the institute in event they prove to be unsatisfactory or in event the institute demanded their return, did not give respondents the legal right to the permanent custody of the children or either of them. * * * Respondents make the further contention that although the decree of adoption be void, the best interest of the child, which is the guiding star in proceedings of this character, authorized the decree of adoption. We do not agree to this contention. * * * True, the evidence shows that respondents' financial ability to support the child and their moral fitness to be intrusted with its care and custody was unquestioned. But there was no substantial evidence that the Child Saving Institute was not supporting and maintaining the child and furnishing it proper moral and intellectual training. * * * The mere fact that respondents were financially able and morally fit to furnish the child a good home would not entitle them to take the child from the legal custodian without any showing that such custodian was not properly caring for the child."
There is no evidence in the instant proceeding that the circumstances upon which the modified decree awarding custody to Mrs. McGuire have changed and there is no finding that she, the legal custodian, is either unsuitable or unfit to have custody of the children. On the contrary, the court below made a finding of fitness. Under the law and the evidence, there was no basis for awarding custody to respondents. The judgment is reversed and cause remanded with directions to render judgment not inconsistent with this opinion.
LEEDOM, P. J., and SMITH and SICKEL, JJ., concur.
RUDOLPH, J., dissents.
RUDOLPH, Judge (dissenting).
Conceding that the judgment entered in Douglas County was binding as between the former husband and wife, it was not binding upon the Wolffs who were not parties to that proceeding. The court in *359 Douglas County, furthermore, did not base its decree upon the best welfare of the children. That court simply accepted the North Dakota decree and determined that Mrs. McGuire was a fit person.
The North Dakota decree was not based upon conditions shown to exist in the present proceeding. That decree was premised upon the finding that the father was in South Dakota, had remarried and was "living with his wife and seven children in a trailer house, and that he was moving from place to place, and that it is not for the best interests of the said children that they be left with the said defendant."
In this proceeding circumstances entirely different concerning the welfare of these children were disclosed to the Pennington County court by the Wolffs. It is my view that the court in this proceeding may consider these changed circumstances and determine in whose custody the welfare of the children will be best served.
This court has announced on numerous occasions that the best interests and welfare of the child are of paramount and controlling importance. Sweeney v. Joneson, S.D., 63 N.W.2d 249, and cases therein cited. Also that statutory and parental rights are not conclusive but must yield to the child's best interests and welfare. Nannestad v. Nannestad, 44 S.D. 241, 183 N.W. 541; Ashmore v. Hedblom, 64 S.D. 513, 268 N.W. 429. In Blow v. Lottman, S.D., 59 N.W.2d 825, it was held that the best interests of a child are served by being in the custody of a parent unless it is shown the parent is unfit but this holding is based upon the conclusive presumption to that effect. Certainly this presumption should not be extended to others, especially a grandmother 57 years old, living with a second husband who is not related to the child. Apart from a parent, therefore, it is not simply a question of fitness which determines the right of custody, but the question always is the best interests and welfare of the child.
More than a year elapsed between the time of the North Dakota decree awarding custody of the children to Mrs. McGuire, and the commencement of this proceeding and as stated above, the court in Douglas County only accepted this North Dakota decree and determined the fitness of Mrs. McGuire. The Arizona Court in the case of Dickason v. Sturdavan, 50 Ariz. 382, 72 P.2d 584, 587, stated what I think should be the rule, and which is entirely consistent with our prior holdings. That court said, "In deciding this question (custody of a child) the court should always be guided by what it believes to be the best interest of the child and this can only be ascertained from the facts presented when the matter is heard. The fact that some other court or a different judge of the same court, or even the same one, felt, when the question was presented to it three or four weeks or any other period of time prior thereto, that the child's best interest demanded that it be placed with one person, does not mean that this would necessarily be true then. The court before which the matter is later heard must consider it in the light of the child's surroundings then and, since these frequently change, the child's best interest at that time is the guide to a correct decision. * * * Neither stare decisis nor res adjudicata has any application in this situation." See also Roll v. Roll, 143 Kan. 704, 56 P.2d 61.
The court in Pennington County was confronted with a state of facts far different than those disclosing that the children were among a total of seven living in a trailer house with their father and stepmother and moving from place to place under unsavory conditions. At the time of the trial in Pennington County these children had been in the Wolff home for approximately one year. They were adjusted to this home which was in every respect a proper home in which to rear children. They had the love and affection of the Wolffs and returned this love and affection in kind. Before coming to the Wolff home they had been first with the mother then with the father, both of whom had been declared unfit by the North Dakota court. While not having been judicially *360 declared dependent or neglected the children were nevertheless such in fact, at the time they were taken into the Wolff home. They had really not known the meaning of a good home until it was provided by the Wolffs. The trial judge visited with the children with Mrs. McGuire present, again with the Wolffs present and then with the children when no one else was present. The children expressed a preference of staying with the Wolffs. It appears that Mrs. McGuire had not sought custody of these children of her own volition but only after urging by the mother. Nor did Mrs. McGuire institute the proceeding in Douglas County. It was the mother who brought that action. Mrs. McGuire is a woman 57 years of age who has had the children in her home only infrequently for short periods of timeshe is no doubt a fit person morally and financially to have custody of children, but by the time these children will most need guidance she will be well advanced in years. She has raised her family who are all grown and have families of their own. No doubt as the years pass the rearing of a second family would become more of a burden than she now anticipates and it is very probable that these children could not stay with her until their maturity.
Other facts appearing in the record no doubt were considered by the court in making its determination that it was for the best interests of these children to remain with the Wolffs. But the above is sufficient to disclose that the trial court's decision was based upon substantial evidence.
I respectfully dissent.
