The West Virginia Department of Public Assistance is the petitioner in these two companion cases, one against Burgess Miller and Jessie Ann Miller, seeking a writ of habeas corpus ad subjiciendum directing the respondents to deliver to petitioner custody of an infant, Karen Dawn Underwood, and the other seeking a writ of prohibition against Robert M. Worrell, Judge of the Circuit Court of Wyoming County, and Burgess Miller and Jessie Ann Miller, prohibiting the respondent, Robert M. Worrell, Judge, from enforcing an order of said court entered on March 21, 1957, which awarded an injunction against the petitioner, The West Virginia Department of Public Assistance, from taking said infant, Karen Dawn Underwood, from the custody of said respondents, Burgess Miller and Jessie Ann Miller, for a period of sixty days from the date of said order.
The pleadings consist only of the petitioner’s petition and the joint answer of the respondents in the habeas corpus proceeding, and in the prohibition case the petitioner’s petition, a joint answer of the respondents, Burgess Miller and Jessie Ann Miller, and an answer of Robert M. Worrell, Judge. These cases come now to be heard upon the writ of habeas corpus gran bed in that proceeding and upon the rule to show cause issued in the prohibition proceeding. Compliance with the writ of habeas corpus was waived pending a final decision herein.
As these two cases relate to the same subject matter, and there are involved the same facts as the basis for the relief sought in the two proceedings, we shall treat them as companion cases for the purpose of stating the *857facts, our discussion of the law applicable, and our decision on the questions presented.
The facts material to the issues, as to which there is no substantial contradiction, are to the following effect:
Karen Dawn Underwood, an infant female child of Bernice Underwood, an unmarried woman, and of an unknown father, was born on January 18, 1956, at St. Luke’s Hospital in Bluefield, West Virginia; and on January 20, 1956, the petitioner, with the consent of the mother, placed the infant, Karen Dawn Underwood, in the home of the respondents. Bernice Underwood, being over twenty-one years of age, on March 6, 1956 executed and acknowledged in the manner required by law, a formal instrument relinquishing to the petitioner her parental rights in the said Karen Dawn Underwood and authorized petitioner to consent to the child’s adoption. The petitioner and the respondents, Burgess Miller and Jessie Ann Miller, had previously, namely, on May 19, 1955, entered into an agreement which will be hereinafter referred to as a “Foster Parents Agreement”, whereby, among other things, the respondents agreed:
“Department of Public Assistance of _ County
“Agreement by Foster Parents
“1. To treat children who are placed in our home as members of the family group.
“2. To take into our home, for foster care, only those children who are placed through the Department of Public Assistance.
# ifc *
“6. To give the Department of Public Assistance a reasonable amount of time (not less than two weeks) to make other plans for a child if we find it necessary to request removal of a child.
❖ ❖ sfc ❖ *
“13. That a child placed in our home will not be available to us for adoption.
*858“I have read the above statements and agree to accept children for care, under these provisions.”-
The other provisions of the' agreement relate to the welfare of any such child and the right of visits to and supervision of the child by the Department, and are not material to the questions involved in these proceedings.
On January 20, 1956, the petitioner placed Karen Dawn Underwood in the home of the respondents, Burgess Miller and Jessie Ann Miller, and agreed to and did provide for her maintenance in the sum of thirty dollars a month, which continued until about the time of the institution by the respondents of the suit to enjoin the petitioner herein from taking the custody of said infant child from the said respondents.
In March of 1957, the Department, petitioner, notified the respondents, Burgess Miller and Jessie Ann Miller, that in the latter part of that month they would take the child, as the Department had found adoptive parents for the child, but there was some delay in taking the child because she had been ill with a respiratory infection prior thereto, and so a period of convalescence was allowed. In order to prevent the petitioner from taking custody of the child, Burgess Miller and Jessie Ann Miller brought the suit in the Circuit Court of Wyoming County, filing a bill of complaint alleging that the child was seriously ill and praying for an injunction restraining the petitioner herein from taking the child at this time on the grounds that to take the child might cause irreparable injury to the child’s health and future welfare, and thereupon the respondent, Robert M. Worrell, Judge, entered an injunction order restraining, for a period of sixty days, the petitioner from removing the child from the custody of the Millers.
Respondents, Burgess Miller and Jessie Ann Miller, fallaciously it seems to us, claimed that the petitioner’s contracted rights to the custody of this child were terminated by the visit on March 20, 1957 of an employee of the Department at the home of the father of Jessie Ann *859Miller, accompained by a Wyoming County Deputy Sheriff, demanding custody of the child, which was refused by the father of Jessie Ann Miller because the latter was aware of the hearing scheduled within an hour later on the bill for the injunction, and the refusal thereafter to accept any money for the support of the child. Respondents also claimed that the Department was not entitled to the custody of the child for two other reasons: first, that the Department had only what is termed an “Agreement by Foster Parents”, which is the one hereinbefore recited, and that the same was executed the year before the child was placed with them, that the Department had no agreement with the respondents specifically pertaining to this child, and that the relinquishment agreement executed by the mother of the child was not executed until some six weeks after the child was placed with respondents; and secondly, that on July 9, 1956, the petitioner caused to be brought in the Juvenile Court of Wyoming County a proceeding for the purpose of declaring the infant, Karen Dawn Underwood, a dependent and neglected child, in which proceeding the relinquishment by her mother was shown and due notice given to the mother, and after hearing, an order was entered on July 20, 1956, adjudging such infant to be a dependent and neglected child, and committing her to the custody and guardianship of such Department of Public Assistance and investing such Department with power to consent to her adoption.
The answer of respondent, Robert M. Worrell, Judge, to the petition for a writ of prohibition, states that he has no knowledge of the attempt of the petitioner to remove the child from the Miller home pursuant to the terms of any contract between the parties involving this child, that he has no knowledge of the adoptive parents selected by petitioner or the method of such selection, that the bill for the injunction was filed and a hearing thereon had at which the illness of the child was shown and that under the circumstances “it was felt that the only reasonable action to take would be to stay or to maintain the status quo until the health of the child *860improved to the extent that it could be safely moved”, and that “The court also entertained the view that after 14 months of delay in finding a home that an additional 60 day period would not cause any undue hardship on the part of anybody until the stability of the health of the child was secured” and “For that reason and that reason alone the injunction was awarded” and also some other averments which we consider unnecessary to recite.
The petitioner contends in the habeas corpus proceeding that it is entitled to have the custody of the infant child in accordance with the terms of the Foster Parents Agreement made between the Department of Public Assistance and the Millers, dated May 19, 1955, and petitioner cites the case of State Department of Public Assistance v. Pettrey, 141 W. Va. 719, 92 S. E. 2d 917, in which the Department based its right to custody upon the same form of Foster Parents Agreement as is embraced in this case.
The respondents contend in the habeas corpus proceeding principally that the petitioner is not entitled to obtain custody of the child because there existed between the parties only the Foster Parents Agreement which was executed about a year prior to the time the child was delivered to them, that there was no supplemental agreement executed in regard to this particular child as in the Pettrey case, that the petitioner could not claim the right to custody under the Foster Parents Agreement because petitioner, in July, 1956, had had the Circuit Court of Wyoming County adjudge this child to be a dependent and neglected child, and that the Circuit Court of Wyoming County has jurisdiction of any child within the county until the child reaches the age of twenty-one years or is discharged by the court, relying upon the decision of this Court in Hammond v. Department of Public Assistance, 141 W. Va. 719, 95 S. E. 2d 345, and the further fact that the Circuit Court of Wyoming County has taken jurisdiction of the child in the injunction suit to which the rule in prohibition is directed in this proceeding.
*861We see no merit in respondent’s contention that the petitioner did not have a supplemental agreement as to this child as was had in the Pettrey case, because the terms of the Foster Parents Agreement are very comprehensive, and the parties acted in accordance with it. Any supplemental agreement would be merely confirmatory or cumulative insofar as the matters here involved are concerned. Nor do . we think that the action of the petitioner in July, 1956, having this child adjudged a neglected and dependent child destroyed the contractual obligation imposed by the Foster Parents Agreement, as that proceeding only confirmed certain powers in the petitioner with regard to the child.
The determination of the rights of the parties in these proceedings must take into consideration the extent of the applicability of the principles enunciated in the Pettrey and Hammond cases, decided by this Court and hereinbefore mentioned.
In the Pettrey case, this Court held that the Department of Public Assistance was entitled to the custody of the infant child which it had placed with the respondents therein pursuant to a relinquishment agreement executed by the unwed mother of the child, to the execution by the parties of a Foster Parents Agreement identical in form to that involved in this case, and to a supplemental agreement specifically relating to the child there involved. This Court held the Foster Parents Agreement was effective and binding under the circumstances.
In the Hammond case, this Court held that a juvenile court, having taken jurisdiction of the custody of a neglected child, may retain said jurisdiction, under the statute, until the child reaches the age of twenty-one years and that the custody of a neglected child, having been awarded by a juvenile court in accordance with the welfare of such child and without violation of parental rights, will not be disturbed on appeal.
We are of the opinion that there is no conflict in the principles expressed and the decisions rendered in the *862Pettrey and Hammond cases, and that any application of those principles depends, as it did in those cases, upon the circumstances of each case. We consider the Foster Parents Agreement here, so far as this record discloses, a valid and binding agreement between the parties, and we recognize the principle that the courts have jurisdiction, under proper circumstances, over a temporary control of infant children when necessary to protect their health and welfare, regardless of the matter of legal right to the custody of the child, under the general rule that a court with equity jurisdiction has, in the absence of adequate remedy at law, jurisdiction in proper cases to protect persons, including infants, and property from injury or destruction.
In the cases now here, while the petitioner has, according to the record as it now stands, shown its legal rights under the Foster Parents Agreement, the respondents have shown that the Circuit Court of Wyoming County has taken jurisdiction to determine what should be done temporarily for the best interests of the child, such jurisdiction having been taken in a pending suit with a temporary injunction of sixty days granted against the petitioner on a bill of complaint alleging illness of the child and the necessity for delay on that account in the removal of the child from the home of the Millers to the petitioner. Regardless of sufficiency of notice or service of process upon petitioner of the respondents’ intention to apply for the temporary injunction by that court, the suit is still pending, for all necessary service, pleadings and proceedings which may be taken or had in the matter, and inasmuch as the rights of the parties can be determined in that suit by adhering to the principles governing the rights of the petitioner as we have construed them in the Pettrey case, and of the respondents as we have construed them in the Hammond case, we are of the opinion that according to the present state of the record in the case so pending, the Wyoming County Circuit Court has properly taken jurisdiction, regardless of whether or not it should retain it, and that the parties *863hereto can there proceed to have the injunction case adjudicated according to the proper application of the law and the rules of equity, without violating the terms of the Foster Parents Agreement between the Millers and the petitioner.
We think that under the facts of this case, to grant the writ of habeas corpus and to deny the writ of prohibition would be inconsistent and productive of possible serious consequences, and that both should either be granted or refused.
We, therefore, hold that the writ of habeas corpus be discharged and that the writ of prohibition be denied, for the reason that all matters in controversy between the parties can and should be determined in the first instance in the injunction proceeding now pending in the Circuit Court of Wyoming County.
Writ of habeas corpus discharged; writ of prohibition denied.