
274 So.2d 654 (1973)
Adele Craig KROHN
v.
Betty Moore MIGUES.
No. 47369.
Supreme Court of Mississippi.
March 12, 1973.
McKoin & Johnson, Biloxi, for appellant.
Fred G. Cody, Biloxi, for appellee.
RODGERS, Presiding Justice.
This is an appeal from an order of a habeas corpus proceeding before the Chancery *655 Judge of the Eighth Chancery Court District sitting as judge on the habeas corpus hearing. The habeas corpus petition was instituted by the appellee, Betty Moore Migues, for the purpose of regaining custody of her minor child, Roy Anthony Migues (age three years) from Adele Craig (alias Krohn), and others.
The petition for habeas corpus was in the traditional form used to accord with the procedure under the authority of Section 2815, Mississippi Code 1942 Annotated (1956), et seq. The respondent filed no sworn answer as is required by Section 2829, Mississippi Code 1942 Annotated (1956) of the habeas corpus act.
During the trial, however, the respondent offered as a defense to the petition, a decree of adoption granted to John Henry Krohn and wife Adele Gertrude Krohn in which they were permitted to adopt Roy Anthony Migues, a minor. The decree also found as a fact that "all of the parties entitled to notice of this adoption are properly before the court in the manner and form required by law." The "complete file" in the adoption proceedings was offered in evidence by the respondent. The original petition for adoption alleged: "That the mother, Betty Ann Migues, is the only living parent entitled to notice of adoption of said child." An affidavit of consent signed by Betty Ann Migues was filed in the adoption proceedings and was offered in evidence in the habeas corpus proceedings. The consent affidavit alleged "That affiant, Betty Ann Migues, is the only living parent entitled to notice of the adoption of the minor child born on October 17, 1969, in the city of Biloxi, Harrison County, Mississippi at the new Howard Memorial Hospital."
The testimony shows that at the time the child was born, the mother, Betty Ann Migues, was then lawfully married to one Hudson Migues. They later obtained a divorce, and at the time the divorce was granted, the mother is said to have told the chancellor that Hudson Migues was not the father of her child. The record shows that although the adoption decree is in due form, nevertheless, the husband, Hudson Migues, was not summoned nor was he a party to the adoption proceedings.
The chancellor held that the adoption decree was void for lack of jurisdiction and that the child, Roy Anthony Migues, be returned to its mother, Betty Ann Migues, the petitioner.
The respondent, Adele Craig Krohn, has appealed to this Court and now contends that the chancellor had no authority to set aside the adoption, and that the chancellor erred in issuing the habeas corpus writ under the facts in this case.
The argument of the appellant is based upon the proposition that the judge in a habeas corpus hearing has no authority to set aside a solemn decree of adoption entered in the chancery court. We agree with this postulate, and we have tried to make this matter clear. See cases cited in Mitchell v. Powell, 253 Miss. 867, 179 So.2d 811 (1965). See also Cook v. Conn, 267 So.2d 296 (Miss. 1972) (concurring opinion).
The writ of habeas corpus will issue only to release persons illegally confined or persons wrongfully withheld from persons who are entitled to their custody. Section 2815, Mississippi Code 1942 Annotated (1956). The writ will not issue to release prisoners held under lawful judgment or those who are in lawful custody. Section 2816, Mississippi Code 1942 Annotated (1956). On the other hand  where the judgment by which a person is confined is void, a writ of habeas corpus will issue to release such person. Ex Parte Burden, 92 Miss. 14, 45 So. 1 (1907).
In the case of Ex Parte Chain, 210 Miss. 415, 49 So.2d 722 (1951) we had this to say:
"It is also well settled in Mississippi and elsewhere that the writ of habeas corpus cannot be made to perform the *656 functions of a writ of error or an appeal, and that a person in custody under a judgment or order of a court of competent jurisdiction cannot obtain his discharge on habeas corpus on account of errors or irregularities, however gross, in the judgment or in the proceedings on which the judgment was founded. State v. Boyd, 110 Miss. 565, 70 So. 692; Ex Parte Golding, 148 Miss. 233, 114 So. 385; Kelly, Sheriff v. Douglas, 164 Miss. 153, 144 So. 237; McLemore v. Love, 197 Miss. 273, 19 So.2d 828." 210 Miss. at 420, 49 So.2d at 724-725.
But, can a decree of the chancery court be attacked collaterally in a habeas corpus proceeding where the decree appears to be valid on its face? We have said that a decree of the chancery court cannot be amended by a writ of habeas corpus. Hinman v. Craft, 204 Miss. 568, 37 So.2d 770 (1948).
The general rule expressed by the text writer in 2 C.J.S. Adoption of Persons § 125, at 557 (1972) is as follows:
"An adoption decree which is void may be attacked collaterally by any interested person, and accordingly the power collaterally to attack a void decree of adoption has been granted to the natural parent ... A decree or judgment of adoption, however, which is not void, but merely voidable, cannot be attacked collaterally by persons claiming through a party to the adoption proceedings." 2 C.J.S. Adoption of Persons § 125, at 557-558 (1972).
Our Court has consistently followed the rule that a void decree or judgment could be attacked collaterally at any time. See the following cases: Harrison v. G. & K. Investment Company, 238 Miss. 760, 115 So.2d 918 (1959); Bryant v. Lovitt, 231 Miss. 736, 740-742, 97 So.2d 730, 731-732 (1957); Schwartz Bros. & Co. v. Stafford, 166 Miss. 397, 148 So. 794 (1933); City of Pascagoula v. Krebs, 151 Miss. 676, 691, 118 So. 286, 290 (1928); Paepcke-Leicht Lumber Co. v. Savage, 137 Miss. 11, 101 So. 709, 711 (1924); Theobald v. Deslonde, 93 Miss. 208, 214-215, 46 So. 712, 713-714 (1908); McComb v. Doe, 9 Miss. 189, 8 S. & M. 505 (1847); Campbell v. Brown, 4 Miss. 39, 6 How. 106 (1842).
In the case of Kelly v. Douglas, 164 Miss. 153, 144 So. 237 (1932) we said:
"... [W]hen the judgment or the proceedings are void on their face, so as to be subject to collateral attack, then the aggrieved party may resort to habeas corpus, and is not confined to appeal." (Emphasis added) 164 Miss. at 157, 144 So. at 237.
See also Ex Parte Phillips, 57 Miss. 357 (1879).
But  is the decree of adoption in this case void?
The pertinent part of our adoption statutes, Section 1269-03, Mississippi Code 1942 Annotated (Supp. 1972) is as follows:
"1. There shall be made parties to the proceeding by process or by the filing therein of a consent to the adoption proposed in the petition, which consent shall be duly sworn to or acknowledged and executed only by the following persons, but not before three (3) days after the birth of said child: (1) the parents, or parent, if only one ...
In the case of a child born out of wedlock, the father shall not be deemed to be a parent for the purpose of this act, and no reference shall be made to the illegitimacy of such child.
If such consent be not filed, then process shall be had upon the parties as provided by law for process in person or by publication, if they be nonresidents of the State ..."
The record on appeal shows that the mother of the child herein filed a sworn consent to the adoption of her child. The testimony shows that her husband, Hudson Migues, was not made a party to the proceedings *657 nor summoned, because he told the attorneys he was not the father of the child.
In the case of Graham v. Lee, 204 Miss. 416, 37 So.2d 735 (1948), one Graham and the mother of a child filed a petition to adopt a minor child. They alleged that the petitioner Graham was the natural father of the illegitimate child. The mother of the child was at the time of the birth of the child married to N.C. Lee. Mrs. Lee had been living with Graham, but she left him; whereupon, he sued for custody of the adopted child. The case was transferred to the court which authorized the adoption. At this point, the husband, N.C. Lee, filed a petition asking the court to set aside the adoption decree upon the ground that he was not made a party to the proceedings, and it was fraudulently obtained.
The court held that it is presumed that a child born in lawful wedlock is the child of the father, and that any proceedings to adopt a child without making the presumptive father a party is invalid under the due process provisions of our state and federal constitutions.
The presumption that a child born in wedlock is a legitimate child is not conclusive and is rebuttable, but it is one of the strongest presumptions known to law. Succession of Kneipp, 172 La. 411, 134 So. 376 (1931).
This presumption was so strong under the common law that it could not be rebutted unless the husband was incapable of procreation or was beyond the four seas; that is, he was absent from the realm, during the whole period of the wife's pregnancy. 10 C.J.S. Bastards § 3, at 20 (1938). This rule has been relaxed somewhat. Nevertheless, we said in Moore v. Smith, 178 Miss. 383 at 386, 172 So. 317 at 318 (1937) that "[A] child born during wedlock is presumed to have been begotten by the husband, which presumption continues until the husband is shown to have been incapable of procreation, or to have had no opportunity of access to the wife when the child was begotten."
We must conclude from the authorities above set out and the record of the adoption proceedings in this case, that Hudson Migues is the father of Roy Anthony Migues, and that he was a necessary party to the adoption proceedings in order for the court to decree an adoption of the child; therefore, the decree of adoption in this case was a nullity and could be attacked collaterally in a habeas corpus proceeding. 49 C.J.S. Judgments § 422(a), at 828 (1947).
We have been concerned, however, as to whether or not Betty Moore Migues, the mother of the minor, was estopped to challenge a decree which was brought about as a result of her acts in denying that her husband was the father of her child, and in filing a consent affidavit permitting the adoption.
As a general rule, a void decree, order or judgment may be assailed anywhere on a collateral attack, but the right to do so is limited to those who are not estopped by affirmative conduct which caused or resulted in the decree sought to be set aside. Harrison v. G. & K. Investment Company, 238 Miss. 760, 115 So.2d 918 (1959).
The testimony introduced in the habeas corpus proceedings shows that the respondent, Adele Craig Krohn, knew that Betty Moore Migues was married to Hudson Migues when the child was born. Nevertheless, at the time she filed the petition for the adoption of the child, she stated in her sworn petition that Betty Moore Migues was the only living parent entitled to notice of the adoption of the child. We hold that the appellant, Adele Craig Krohn, cannot now complain or be heard to contend that Betty Moore Migues is estopped to claim that her husband, Hudson Migues, was not made a party to the adoption proceedings.
*658 The order of the trial judge in the habeas corpus proceeding is correct under the facts in this case and must, therefore, be affirmed.
Affirmed.
INZER, ROBERTSON, WALKER and BROOM, JJ., concur.
