The issue presented by this appeal is whether the laws of Texas may constitutionally grant legitimate children a judicially enforceable right to support from their natural fathers and at the same time deny that right to illegitimate children.
In 1969, appellant filed a petition in Texas District Court seeking support from appellee on behalf of her *536minor child. After a hearing, the state trial judge found that appellee is “the biological father” of the child, and that the child “needs the support and maintenance of her father,” but concluded that because the child was illegitimate “there is no legal obligation to support the child and the Plaintiff take nothing.” The Court of Civil Appeals affirmed this ruling over the objection that this illegitimate child was being denied equal protection of law. 466 S. W. 2d 41. The Texas Supreme Court refused application for a writ of error, finding no “reversible error.” We noted probable jurisdiction. 408 U. S. 920.
In Texas, both at common law and under the statutes of the State, the natural father has a continuing and primary duty to support his legitimate children. See Lane v. Phillips, 69 Tex. 240, 243, 6 S. W. 610, 611 (1887) ; Tex. Fam. Code §4.02 (1970) (husband's duty).1 That duty extends even beyond dissolution of the marriage, Tex. Rev. Civ. Stat., Art. 4639a (Supp. 1972-1973); Hooten v. Hooten, 15 S. W. 2d 141 (Tex. Ct. Civ. App. 1929), and is enforceable on the child’s behalf in civil proceedings and, further, is the subject of criminal sanctions. Tex. Penal Code § 602. The duty to support exists despite the fact that the father may not have custody of the child. Hooten v. Hooten, supra. The Court of Civil Appeals has held in this case that nowhere in this elaborate statutory scheme does the State recognize any enforceable duty on the part of the biological father to support his illegitimate children and that, absent a statutory duty to support, the controlling law is the *537Texas common-law rule that illegitimate children, unlike legitimate children, have no legal right to support from their fathers. See also Home of the Holy Infancy v. Kaska, 397 S. W. 2d 208 (Tex. 1965); Lane v. Phillips, supra, at 243, 6 S. W., at 611; Bjorgo v. Bjorgo, 391 S. W. 2d 528 (Tex. Ct. Civ. App. 1965). It is also true that fathers may set up illegitimacy as a defense to prosecutions for criminal nonsupport of their children. See Curtin v. State, 155 Tex. Cr. R. 625, 238 S. W. 2d 187 (1950); Beaver v. State, 96 Tex. Cr. R. 179, 256 S. W. 929 (1923).
In this context, appellant’s claim on behalf of her daughter that the child has been denied equal protection of the law is unmistakably presented. Indeed, at argument here, the attorney for the State of Texas, appearing as amicus curiae, conceded that but for the fact that this child is illegitimate she would be entitled to support from appellee under the laws of Texas.2
We have held that under the Equal Protection Clause of the Fourteenth Amendment a State may not create a right of action in favor of children for the wrongful *538death of a parent and exclude illegitimate children from the benefit of such a right. Levy v. Louisiana, 391 U. S. 68 (1968). Similarly, we have held that illegitimate children may not be excluded from sharing equally with other children in the recovery of workmen’s compensation benefits for the death of their parent. Weber v. Aetna Casualty & Surety Co., 406 U. S. 164 (1972).3 Under these decisions, a State may not invidiously discriminate against illegitimate children by denying them substantial benefits accorded children generally. We therefore hold that once a State posits a judicially enforceable right on behalf of children to needed support from their natural fathers there is no constitutionally sufficient justification for denying such an essential right to a child simply because its natural father has not married its mother. For a State to do so is “illogical and unjust.” Id., at 175. We recognize the lurking problems with respect to proof of paternity. Those problems are not to be lightly brushed aside, but neither can they be made into an impenetrable barrier that works to shield otherwise invidious discrimination. Stanley v. Illinois, 405 U. S. 645, 656-657 (1972); Carrington v. Rash, 380 U. S. 89 (1965).
The judgment is reversed and the case remanded for further proceedings not inconsistent with this opinion.
It is so ordered.