So far as this order appealed from adjudges the respondent in the proceeding below in contempt, it seems to be unjustified. This proceeding was instituted under section 40 of the Domestic Relations Law (Chap. 272, Laws of 1896). It is there provided that a husband or ivife, being an inhabitant of this State, living in a state of separation without being divorced, who has a minor child, may *122apply to the Supreme Court for a writ of habeas corpus to have such minor child brought before such court; and that on the return thereof, the court, on due consideration, may award the charge and custody of such child to either parent for such time, under such regulations and restrictions and with such provisions and directions as the case may require, and may at any time thereafter vacate or modify such order. It has been held that the Supreme Court has no power at common law to inquire into the custody of a child. The court can proceed only under the authority conferred by the statute, and- the court in proceedings under this statute is bound by the rule prescribed in habeas corpus proceedings. (People ex rel. Keator v. Moss, 6 App. Div. 414, and cases there cited.) The writ of habeas corpus is regulated by article 3, title 2, chapter 16 of the Code (§§ 2015-2066). By section 2066 it is provided that “ Except as otherwise expressly prescribed by statute, the provisions of this article apply to and regulate the proceedings upon every common-law and statutory writ of habeas corpus, as far as they are applicable ; and the authority of a court or a judge to grant such a writ, or to proceed thereupon, by statute or the common law, must be exercised in conformity to this article, in any case therein provided for.”
Section 2015 prescribes the cases in which the writs may issue. A person imprisoned or restrained of his liberty within the State, for any cause or upon any pretense, is there given a writ of habeas corpus. By section 2019 it is provided that the petition must state in substance that the person in whose behalf the -writ is applied for is imprisoned or restrained in his liberty, the place where, unless it is unknown, and the officer or person by whom he is so imprisoned or restrained, naming both parties, if their names are known, and describing either party whose name is unknown. Section 2028 provides how the writ may be enforced. It provides that where a person has been duly served with the writ and refuses or neglects without sufficient cause shown by him fully to obey it, the judge before whom the writ is made returnable must issue á warrant of attachment, .designating the officer and commanding such officer to apprehend the person and bring him before the court, and that, upon the delinquent being so brought before the court, an order must be made committing him to close confinement in the jail of the county in which the court or judge is until he makes a return to the writ *123and complies with any order which may he made by the court or judge in relation to the person for whose relief the writ was issued. By section 2031 it is provided that the court or judge before which or whom a prisoner is brought by virtue of a writ of habeas corpus must, immediately after the return of the writ, examine into the facts alleged in the return and into the cause of the imprisonment or restraint of the prisoner. •
The petition upon which the writ in this case was granted alleged that the infant whose custody was sought, was imprisoned and restrained of her liberty at No. 243 East One Hundred and Twentieth street, in the city of New York, and in the borough of Manhattan, by Lillian Winston, and that the said Lillian Winston resided at such address in the city of New York. Hpon the return of that writ this allegation was denied. The return alleges that the said infant is now living at 108-110 Fourteenth street, Hoboken, N. J., the home of the respondent to the writ, and has been so living with the respondent from the 2d day of March, 1898, and that the said infant is not and has not been a resident of the State of New York since the last-mentioned date. To that return no traverse was interposed, and by it a material fact, required to be alleged in the petition upon which the writ was granted, was put at issue, and a question of fact was then presented upon which rested the jurisdiction of the court to pass upon the question which the relator sought to have determined. For, if the infant and her mother, in whose custody she was, were, at the time the writ was issued, bona fide residents of another State, and the infant was not within this State, the court evidently had no jurisdiction to pass upon the question of the custody of the infant and should have dismissed the proceeding. The relator, being a resident of this State, was entitled to apply to the court for a writ of habeas corpus requiring the child to be produced before the court; but, if the child at the time that writ was issued was actually a resident of another State, and was actually in that State under the care and custody of the mother, who was also a resident of that State, the right of the parent to _the_care. aiid___cystody. of the child cannot be determined by the court of the State in which the child was not a resident or was not""Fctifairy "present before the court. The fact of the resideuce*df the father in this State would justify the application to *124the courts of this State for the custody of the child, and if the child was actually within the jurisdiction of the court the question as to the custody could be determined. Jurisdiction over the child must be obtained, and that jurisdiction can only be obtained by the presence of the child before the court, as it is only when a person is detained in custody within this State that the writ of habeas corpus is applicable. There is no question here of a person actually a resident of this State removing a child who is also such a resident from the State for the purpose of avoiding the jurisdiction of the court. There was no traverse interposed to the return which presents such a question.
That the court has jurisdiction over its citizens to determine this question may be assumed, and where a citizen and resident of this State, for the purpose of avoiding the jurisdiction of the court, removes a child from the State, the court may enforce the return of the child to the State where it can obtain jurisdiction of the person in whose custody and control the child is, so that the court may have jurisdiction over the person of the child and thus determine the question as to its custody. In such a case, if the person in whose custody the child is were within the jurisdiction of the court, and if such person refused to obey the direction of the court to produce the child before it, the court would then have the power, under section 2028 of the Code, to issue an attachment and commit the person thus refusing to obey the direction of the court until such direction was obeyed; but until the child is actually produced before the court so that it is within its jurisdiction, it seems to me clear that there can be no adjudication upon the question as to the custody of the child. And where, upon the return to the writ, it appears that the child was not actually a resident of, or within this State, or not in the custody and under the control of a person who is a resident of this State, the court then has no jurisdiction to determine in such a proceeding the question of the custody of such non-resident.
It was also error for the court to award the custody of the child to a party to the proceeding without the child being before the court and without an examination into the merits of the application, even though the person in whose custody the child was had failed to make a return and was in contempt. The one consideration in determining a proceeding of this character is the welfare of the child. *125The character of the parents, when each claims the right to be awarded the care and custody of the child, is a matter to be inquired into by the court to determine to whom the custody of the child should be awarded; and upon the facts being ascertained, the court has to determine what would best subserve the interests of the child, and the custody of the child will not be taken from one parent and given to another merely to punish one of the parents for a failure to comply with an order of the court. This question received very careful consideration by this court in the case of People ex rel. Sternberger v. Sternberger (12 App. Div. 398), and it is only necessary to refer to that casé for the principles which should control the court in determining proceedings of this character.
I think, therefore,"that the order appealed from was unauthorized and should be reversed, with ten dollars costs and disbursements.
Van Brunt, P. J., Rumsey and Patterson, JJ., concurred.
Order reversed, with ten dollars costs and disbursements.