Does the subsequent marriage of the natural parents of an illegitimate child have the effect of depriving the court of jurisdiction to proceed with an adoption previously consented to by the mother, without obtaining the consent of the father? This is the question raised in this proceeding by appellant petitioners who appeal from an order dismissing their petition to adopt Baby Boy Laws.
The mother of Baby Boy Laws lived with intervener from May 1959 to May 20, 1960, although she was still married to Robert L. Laws by whom she had a previous child. This child was also living with her. It was during this period that Baby Boy Laws was conceived. On May 20, 1960, the natural mother and intervener ceased living together. Subsequently, on June 10, 1960, the natural mother obtained a final decree of divorce from husband Laws. Baby Boy Laws was born on August 25, 1960.
Prior to the child’s birth the natural mother learned of petitioners and afterwards placed her child with them for adoption. She allegedly told the child’s father that Baby Boy Laws had died. The child has been with the petitioners since birth, and they filed their petition for adoption on September 15, 1960, approximately two weeks after the child entered their home upon its release from the hospital. On October 18, 1960, the natural mother was interviewed by an adoption worker of the Los Angeles County Bureau of Adoptions (herein referred to as the “bureau”) and there freely and willingly signed a consent to the child’s adoption by the petitioners on the form prescribed by the State Department of Social Welfare.
On October 27, 1960, the natural father was married but separated from that wife in December of 1960, and on February 6, 1961, this marriage was annulled. After separating from that wife he commenced living again with the mother of Baby Boy Laws.
The natural father alleges that in March of 1961 he first learned the child was alive and had been placed for adoption. On April 27, 1961, he and the child’s mother were married. On May 1, 1961, a little over eight months after the child’s birth and six months after the mother’s consent to the adop*496tion, the natural parents appeared at the bureau, revealed their marriage and demanded the child. The father stated he had not consented to the child’s adoption and did not wish to do so. On May 5 the bureau filed a report recommending that appellant’s petition for adoption be denied because “The natural father, who claims joint custody of minor, has not and does not wish to consent to the adoption of the minor by the petitioners.” The bureau reported to the court that “According to a recent report from the child’s doctor, the minor is in good health and appears to be developing normally,” and that petitioners “appear to have a stable marriage and to be able to offer the minor both emotional and financial security.”
On May 18, 1961, the natural mother filed a petition for withdrawal of consent to adoption followed by an amended petition on June 23, 1961. On June 29 the natural father filed a motion to dismiss the adoption. Both matters were set for hearing on the same day. By agreement of counsel the hearing was confined to the natural father’s motion; time for notice of the motion was waived; and all the allegations of the natural father’s declaration in support thereof were deemed controverted, except that of the paternity of the child and of the subsequent marriage of the natural parents. The latter were admitted for the purpose of the hearing only. At the conclusion of the hearing the court expressed its belief that it had no jurisdiction to grant an adoption without the natural father’s consent but indicated that if it could legally have done so it would have denied the motion to dismiss. The court indicated it felt it had no power to look into “. . . what is the best interests of the child at this time. ...” On July 13, 1961, the court entered its order granting the natural father’s motion to dismiss the petition for adoption from which the petitioners appeal. The child remains with the appellants pending appeal.
Under California law a legitimate child cannot be adopted without the consent of its parents, if living, nor an illegitimate child without the consent of its mother, if living. (Civ. Code, § 224.) Thus, at the time the mother gave her consent to the adoption of Baby Boy Laws by the petitioners only her consent was necessary and the court had full jurisdiction to proceed. Subsequently thereto the natural parents married, thereby legitimating the child since the child born before wedlock becomes legitimate by the subsequent marriage of its parents. (Civ. Code, § 215.) Had the adoption proceeding *497been completed in the meantime, certainly the subsequent marriage of the natural parents of the child could not have had the effect of nullifying the proceedings. If such were not the rule, then there would be no finality to a decree of adoption. What effect, if any, then, should the subsequent marriage of the natural parents have upon a previously commenced adoption proceeding ?
In Lavell v. Adoption Institute, 185 Cal.App.2d 557 [8 Cal.Rptr. 367], the court ruled that the legitimation of a child under Civil Code section 230 may be accomplished prior to its birth. In that case the parents separated in California without the prior knowledge of the father and just eight days before the birth of the child. The child was placed by the mother in the care of an adoption agency and she relinquished the child for adoption as a single woman. Thereafter the child was placed in the hands of prospective adopting parents. The child’s father made a diligent search for the mother and finally located her after the mother and an older child of the parties had returned to Michigan. The father then commenced an action to recover the custody of both children. He also filed an affidavit acknowledging their paternity pursuant to the statutes of Michigan which had the effect of legitimating the children under the Michigan law.
When the father learned of the whereabouts of the second child he returned to California and made a demand upon the adoption agency for the return of the child. Upon its refusal to deliver the child he commenced an action which resulted in a judgment declaring he was entitled to the custody of the child. The adoption agency appealed from this decision. The principal question before the court on the appeal was whether or not the legitimation of a child under Civil Code section 230 could be accomplished prior to its birth. The agency took the position that the requirements of that section could not be complied with until after the birth of the child. This section provides that the father of an illegitimate child may legitimate it “. . . by publicly acknowledging it as his own, receiving it as such, with the consent of his wife, if he is married, into his family, and otherwise treating it as if it were a legitimate child, ...” Under Civil Code section 29 an unborn child is to be deemed an existing person so far as may be necessary for its interests in the event of its subsequent birth. The court held the unborn child of unwed parents, under the provisions of this section, is to be deemed an existing person for the purpose of adoption and that such *498child is capable of being received into the family of the father. The court pointed out the evidence showed the father had provided a home for the child’s mother and supported her until their separation shortly before the birth of the child. The father did not deny parenthood, nor did he treat the child in any way other than as a legitimate child; he did not neglect the child or fail in any duty towards it. The court therefore sustained the trial court, holding in effect that the child had been legitimated prior to its birth and therefore the consent of the mother to the adoption of the child, given after its birth, was insufficient.
The facts in the case before us are clearly to be distinguished from those in the Lavell case (Lavell v. Adoption Institute, supra, 185 Cal.App.2d 557) since there can be no contention that any efforts were made by the father in this case to legitimate the child either prior to its birth or subsequent thereto until the marriage of the natural parents of the child some eight months after the child’s birth and six months after the natural mother’s consent to the adoption. For this court to hold that the natural parents of a child, previously placed for adoption and relinquished by written consent of the mother, could, by their subsequent marriage, thereby deprive the court of its power to proceed with the adoption would be to open the door to practices which could conceivably discourage adopting parents from opening their hearts and homes to unwanted children and also subject them to the possibility of becoming the prey of designing persons.
It is the cardinal rule of adoption proceedings that the court consider what is for the best interests of the child. (Adoption of Barnett, 54 Cal.2d 370, 377 [6 Cal.Rptr. 562, 354 P.2d 18].) Certainly the subsequent marriage of the natural parents of a child is a circumstance which should be considered by the court prior to the entry of a final decree of adoption; however, the marriage should in no way limit the court’s jurisdiction to proceed.
Under circumstances somewhat similar to the facts in the case before us, in In re Adoption of a Minor, 338 Mass. 635 [156 N.E.2d 801], the natural parents, who had married subsequent to the placing of the child for adoption by the natural mother, intervened in the adoption proceedings claiming the court had no jurisdiction to grant the adoption without the father’s consent. The court rejected this contention and concluded that the interests of the natural parents in such a case must be completely subordinated to the paramount *499interest of the child. (See also In re Adoption of Anderson, 235 Minn. 192, 198-199 [50 N.W.2d 278]; In re Adoption of Morrison, 260 Wis. 50 [49 N.W.2d 759, 51 N.W.2d 713]: In re Simaner's Petition, 16 Ill.App.2d 48 [147 N.E.2d 419].) In the latter case the court said at page 56, “A child is not a chattel. It would be a repudiation of the public policy as declared by the legislature, and contrary to the best interests of the child, to hold, as the intervening petitioners urge, that the laggard putative father, by a marriage with the mother occurring at any time before the filing of the petition for adoption, is vested with the right to control the adoption proceedings by either giving or refraining from giving his consent thereto.”
In the ease of In re Barents, 99 Cal.App.2d 748 [222 P.2d 488], the mother placed her child directly with the adopting parents, as was done in the ease before us, and two months later signed her consent to adoption. Thereafter, section 226a was added to the Civil Code providing that once given a consent to an adoption could not be withdrawn except with court approval. After this statutory change and without obtaining court approval to withdraw her consent, the natural mother sought to regain custody of the child on habeas corpus. While holding that the statutory change was not retroactive, in denying habeas corpus the court said at page 753-754, “Suppose here, for instance, that after consent and before adoption the natural father should come forward and marry the child’s mother, as the mother here alleges is their mutual intent, thus legitimating the infant, such legitimation, considering its effect on the child’s welfare alone, might persuade the court that adoption should not be ordered. In saying this we do not pass upon the question of whether such marriage during adoption proceedings would make it jurisdictional that the consent of the natural father should then be secured, as was held in In re Adoption of Doe [infra] . . . since that question is not before us.”
In the North Carolina case referred to in the Barents case (In re Barents, supra, 99 Cal.App.2d 748), In re Adoption of Doe, 231 N.C. 1 [56 S.E.2d 8], the natural parents married after the child was relinquished to a county adoption agency and on appeal it was held that the mother’s consent was no longer sufficient to render the child a proper subject for adoption. In effect it held that the consent previously given was revoked by operation of law. Shortly after this decision the North Carolina Legislature revised the adoption statute to *500provide that when a child is released and a general consent to adoption given by the mother to a designated official or to a licensed child placement agency (as had been done in the Doe case) the release and consent could not be revoked after 30 days; and, second, that in the case of an illegitimate child the mother’s consent alone was sufficient for adoption if the child had not been legitimated before the consent was given. (North Carolina General Statutes, 1949, §§ 48-6, 48-11.)
Under the facts of the case before us there can be no doubt that when the mother’s consent to adoption was executed the child was illegitimate. All parental rights then existed solely in the child’s mother. (Darwin v. Ganger, 174 Cal.App.2d 63 [344 P.2d 353].) The natural father was then not even entitled to preference or special consideration in a proceeding by others to adopt the child. (See In re Campbell, 9 Cal.App.2d 622 [51 P.2d 138].) He had no present existing or vested parental rights. He did have certain inchoate rights of parenthood which would vest if he elected to legitimate his child.
In effect, during illegitimacy, the natural mother acts in her own behalf and as the father’s agent in all matters affecting the child. Her agency is implied in law and extends to the transfer or renunciation of parental rights on his behalf as well as her own. This view was adopted by the Massachusetts court in In re Adoption of a Minor, supra, 338 Mass. 635, at pages 642-643, wherein it was said, “At the time the mother’s consent was given, she alone had authority to speak for the natural parents under e. 210 § 2, and did so. The father’s consent then was not necessary. . . . Her consent, conclusive when given, should be treated as binding on him, as the other natural parent. Permission to withdraw that consent should be given by the probate judge only when the best interests of the child so dictate.’’
It is fundamental, with certain limited exceptions, that a court having acquired jurisdiction of the subject matter and of the parties to an action retains that jurisdiction until final judgment is entered. (Kennedy v. Industrial Acc. Com., 50 Cal.App. 184 [195 P. 267].) This was held to be true in an adoption matter (Adoption of Barnett, supra, 54 Cal.2d 370) wherein the court said at page 377, “Jurisdiction of the subject matter and of the essential parties, once acquired, is not lost by the mere circumstance that one of the adopting parents, through death or divorce, ceases to be a petitioner. ’ ’
In some states, under statutes which vary somewhat from ours, it has been held that the consent of the natural father to *501adoption is required where there has been legitimation of a child by the marriage of his natural parents and the acknowledgment of the child by its father. (Sklaroff v. Stevens, 84 R. I. 1, 6-8 [120 A.2d 694]; Harmon v. D'Adamo, 195 Va. 125, 128-129 [77 S.E.2d 318]; Re a Minor, 191 Wash. 452, 457-458 [71 P.2d 385].) Decisions in other jurisdictions are consistent with the view that legitimation by marriage subsequent to the giving of consent to adoption by a mother, then unmarried, does not retroactively operate to make the father’s consent necessary. (Ex parte Combs (Ohio) 150 N.E.2d 505; Davis v. Sears (Tex. Com. App.) 35 S.W.2d 99, 102-103; Adoption of a Minor, 338 Mass. 635 [156 N.E.2d 801]; Adoption of Anderson, 235 Minn. 192, 198-199 [50 N.W.2d 278]; Adoption of Morrison, 260 Wis. 50, 63-65 [49 N.W.2d 759, 51 N.W.2d 713]; In re Simaner, 16 Ill. App.2d 48, 56 [147 N.E.2d 419]; see annot., 51 A.L.R.2d 497, 503-509.)
We hold that the rule of the latter line of cases is more in harmony with the statutes and decisions of the courts of California because it requires that consideration be given by the court to the welfare of the child. It is in harmony with In re Barents, supra, 99 Cal.App.2d 748, 753. which declared: “The welfare of the child can never be excluded from the issues, no matter what preliminary action its parent or parents may have taken. The changed conditions of either the proposed adopters or of the consenting parents may heavily weight the scales for or against the granting of the petition.”
We hold, therefore, that if a child is subsequently legitimated by his natural father the latter may act in his own right and petition under section 226a to withdraw the consent given by the mother, but only with court approval as therein prescribed. Under such a construction either the mother or the father, assuming that he has subsequently legitimated the child either through marriage or under the provisions of section 230 of the Civil Code, can proceed to file a petition for withdrawal of consent under the provisions of section 226a. Such a petition would then be set for hearing. The court would have before it the full report of the State Department of Social Welfare or licensed county adoption agency, which would also be required to appear at the hearing to represent the interests of the child. If the court finds that withdrawal of the consent to adoption is reasonable in view of all of the circumstances and will be for the best interests of the child, the court may then approve the withdrawal. *502Otherwise, it will withhold its approval all as provided for in the section.
We hold that the court erred in granting the intervener’s motion to dismiss the petition for adoption and that portion of the minute order dated July 13, 1961, is reversed. The cause is remanded for proceedings on the merits pursuant to sections 226a and 227 of the Civil Code.
Jefferson, J., and Balthis, J., concurred.
The petition of objector and respondent for a hearing by the Supreme Court was denied May 9, 1962. Traynor, J., and Peters, J., were of the opinion that the petition should be granted.