In April of 1974 an unwed mother gave birth to a baby girl, whom we shall call K. The young mother was unable to care for the child, and she relinquished her parental rights to the Nueces County Child Welfare Unit of the Department of Public Welfare. The Child Welfare Unit took responsibility as soon as the baby was released from the hospital, providing her with foster care and locating suitable adoptive parents. The instant legal proceeding was initiated to terminate the parent-child relationship, to afford the father of the child an opportunity to be heard if he wished, and for the designation of the Child Welfare Unit as managing conservator of the child as a predicate for ultimate adoption.
S.D.A. is the child’s father — only in the sense of that relationship which is the biological consequence of erotic ecstasy on a summer night. After learning of the moth*169er’s pregnancy, he showed no disposition to assist with her problem or expense, and within a month he was arrested for interstate transportation of a stolen vehicle and of a 14 year old girl. He has been confined in jail or penitentiary since October of 1973. After he was served with citation and the petition of the Child Welfare Unit, he filed his own petition for the voluntary legitimation of the baby girl and for the appointment of himself as her managing conservator. The trial court held a hearing on these two petitions. S.D.A. was present and testified. The State provided him with diligent counsel. Baby girl K was represented by her duly appointed guardian ad litem. The trial court found the father not to be a fit person to act as parent of the child and that the best interests of the child required the denial of his petition. Accordingly, the court granted the petition of the Child Welfare Unit and denied the petition of S.D.A. The Court of Civil Appeals affirmed. 520 S.W.2d 424. S.D.A. persists.
Our question is whether the rights of this biological father have been abused. He contends that he is entitled to the legitimation of the child and to full parental rights by virtue of the fact that he is the biological father. He further contends that those parental rights cannot be terminated except by proceeding under Sec. 15.02 of the Family Code and by proof that he has been guilty of some specific act or omission enumerated in Sec. 15.02(1). He finally argues that his contentions must be upheld by the Texas law if that law is to pass minimum requirements of the Equal Protection Clause of the Fourteenth Amendment of the United States Constitution, which he says entitles him to be treated in precisely the same manner as if he had been married to the mother of K at the time of the child’s birth.
We first look to the statute in effect at the time of the hearing in 1974 to see if the trial court complied with the enactment of the Legislature. Title 2 of the Family Code at that time was in the form enacted in 1973 and effective on January 1, 1974. Acts of the 63rd Legislature, Regular Session, 1973, Ch. 543. Reference will be made below to the change in Title 2 which was made in 1975 after the hearing in this case.
Under the Family Code a “parent” is not necessarily an immediate progenitor of the child; the term applies only to those named in Sec. 11.01 of the Code who are entitled to a legal relationship with all of the rights, privileges, duties and powers over the child enumerated in Sec. 12.04. Absent a married relationship between the father and mother of the child, the father is not a “parent” unless by force of Secs. 12.02 and 13.01. A person may have formerly been a legal “parent,” but if that relationship with the child is terminated under Chapter 15 of Title 2, the person is no longer a “parent” under the Code.
The alleged father of an illegitimate child is entitled by Sec. 11.09 to service of citation upon the commencement of any suit affecting the parent-child relationship between the child and the mother or any other person. The father then may seek voluntary legitimation under See. 13.01. S.D.A. has done so under 13.01(b) which provides as follows:
If a statement of paternity is filed with the State Department of Public Welfare, the father, the mother, or the department may institute a suit for a decree establishing the child as the legitimate child of the person executing the statement. On the consent of the mother, the managing conservator, or the court, and on the filing of the statement of paternity with the petition, the court shall enter a decree declaring the child to be the legitimate child of the person executing the statement of paternity.
Neither the mother of the baby girl K, nor the Child Welfare Unit as managing conservator, nor the trial court has consented that S.D.A. may obtain a decree establishing this child as the legitimate child of S.D.A. Such a decree would entitle S.D.A. to the legal relationship as a parent under the Code. S.D.A. argues that the only matter to be considered in the legitimation proceeding is the paternity of the child and that, since it is conceded that S.D.A. is in fact the father *170of this baby girl, the court has no discretion to deny him the decree of legitimation. We disagree. We fail to see why the Legislature would require the “consent” of the court if the biological fact is the only predicate for legitimation and, hence, entitlement to full parental rights. If the court must consent to the matter, discretion is thereby conferred upon the judge to see that the one who would assume parental rights and responsibilities is fit to do so and that a decree declaring this relationship is made only if it is in the best interest of the child.1
S.D.A. then points to Sec. 15.02 of the Code which provides that the court may terminate the parent-child relationship if a parent has consented or has been guilty of any of the grounds of abandonment, neglect or abuse there specified and if, in addition, the termination is in the best interest of the child. S.D.A. says that the United States Constitution assures that he must be treated in precisely the same manner. Thus, once he is shown to be the biological father of the child, his rights with respect to the child may not be terminated absent a showing of the same grounds required to terminate the rights of a father to whom a child is legitimately born.
It is clear that the law as S.D.A. says it ought to be is not the law of the Texas Family Code. Sec. 15.02 expressly applies to parents and not to all fathers. Sec. 15.02(1) was drafted in 1973 without thought of a biological father who terminated his relationship with the mother and the expected offspring nine months prior to the birth of the child. It may be questioned whether the trial court was restricted to these specific grounds of 15.02(1) if the father (even if a “parent”) were totally unfit to hold any responsibility or control of the child — even though it might not be said that he has yet engaged in conduct which has endangered the child. In any event, under the circumstances of this case the Legislature provided for the exercise of discretion by the trial court prior to the legitimation of the child as to the biological father, which discretion was to be exercised according to the best interests of the child. Since S.D.A. was not entitled to the decree of legitimation, the court was not required to look to the specific grounds of Sec. 15.02 which are relevant only for termination of the relationship between the child and one who has been given the legal status of a parent.
We come now to the constitutional question. S.D.A. contends that the United States Supreme Court has in Stanley v. Illinois, 405 U.S. 645, 92 S.Ct. 1208, 31 L.Ed.2d 551 (1972) equated fathers of illegitimate children with fathers of legitimate children and has required the states to do likewise. In that case the State of Illinois had removed three children from the father’s custody following the death of the children’s mother. The father had over pri- or years taken part in the care and custody of his children and was then living together with them as a family unit. Illinois denied the father an opportunity to appear in court to show why his family should not be dismembered, and he was denied a hearing on his fitness to keep his children. Despite the existing family relationship, because of the lack of a legal marriage to the deceased mother of the children, the State presumed the father to be unfit as a parent. The Supreme Court held:
We conclude that, as a matter of due process of law, Stanley was entitled to a hearing on his fitness as a parent before his children were taken from him and that, by denying him a hearing and extending it to all other parents whose custody of their children is challenged, the State denied Stanley the equal protection of the laws guaranteed by the Fourteenth Amendment. 405 U.S. 649, 92 S.Ct. 1211.
Counsel for S.D.A. reads Stanley to preclude any and all distinctions between fa*171thers of illegitimate children and other parents. We do not read the Supreme Court to have made such a holding, nor do we think that the Supreme Court has lost sight of the paramount rights of the child. The Stanley opinion emphasizes the importance of the family and the integrity of the family unit. The Court objects to the separation of children from a father who has sired and raised them until the father has been given an opportunity to show his fitness to keep that family with him.
Stanley does not decree that all unwed fathers have fundamental rights to full parental status or that every statutory discrimination against the unwed father is suspect. The overriding interest of state and courts is the welfare of the affected children. We are not nearly so far down the road to unrestrained egalitarianism as to hold that the Constitution guarantees an unwed father parental rights in violation of the best interests of the child.
The Court of Appeals of New York has upheld a New York statute which requires consent of the natural mother, without requiring consent of the natural father, for adoption of an illegitimate child. In re Adoption of Malpica-Orsini, 36 N.Y.2d 568, 370 N.Y.S.2d 511, 331 N.E.2d 486 (1975). That court wrote:
Of course, the primary concern of the Legislature and the courts is with the welfare of the children involved rather than with the allocation of rights between the mother and the usually uncertain and reluctant father of the children born out of wedlock. In this context, legislation and policy are governed by general conditions rather than the special circumstances of a sympathetic and idiosyncratic situation. Moreover, as noted earlier, the father in this case was given notice and an opportunity to be heard on the issue of what was in the best interest of the child. 36 N.Y.2d 579, 370 N.Y.S.2d 521, 331 N.E.2d 493.
There is a rational basis for the state, which has an interest in securing stable homes and supportive families for children, to distinguish between the father who has accepted the legal and moral commitment to the family and the father who has not done so. The biological father may be a sperm donor or a rapist or someone as S.D.A. who has simply engaged in a single hit and run sexual adventure. He may, on the other hand,, be devoted to child and family even though the legal contract has not been sealed. Texas law offers the biological father of an illegitimate child the opportunity to prove which category in which he falls and to show that he should not be treated differently from fathers legally committed to the mothers of their children. Thus S.D.A. sought and received a fair hearing. The evidence proved him to be an unfit person to act as parent of this child, and the denial of his petition for parental status was shown to be in the best interest of the child. His rights have been respected. The rights of society and baby girl K permit him nothing more.
The judgments below are affirmed.
. When Chapter 13 was amended by the Legislature in 1975 the Legislature specifically provided that the court may consent to a legitimation “[I]f the entry of the decree is in the best interest of the child . . Sec. 13.21(c). Acts of the 64th Legislature, Regular Session, 1975, Ch. 476.