The question is, whether the mother of Nellie Dunlap, a child of about sixteen years of age, was entitled to its custody. The facts are, that in the month of August, 1894, and when the little girl was about eleven years old, she was surrendered to the care of the New York Juvenile Asylum for a period of two years, which period has long since expired. The surrender of the child by Mrs. Dunlap to the defendant was made because of her destitution and inability to support her. On the. 22d of April, 1896* the child was indentured to one Frederick Bauman, of Mt. Pulaski, Logan county, 111. The mother ■alleges that before suing out the writ she demanded the return of the child, which was refused. The defendant’s return, after setting out the fact of the indenture and that the child was in Illinois, stated further that she was not willing to return to her mother, and that neither the defendant nor any of its officers had the custody or control of Nellie Dunlap at the time of the service of the writ or since that time. In the traverse that fact was denied. No proof was given on that point. In the case of People ex rel. Billotti v. New York Juvenile Asylum (57 App. Div. 383) it was established that, although the person who is restrained of his liberty is without the State, an • order requiring his production may nevertheless be made if the defendant took that person out of the State in violation of the rights of the one primarily entitled to his custody, unless it appears that the defendant has not the. control or custody of the person and is not able to deliver him.
It will' be seen that the fact whether the defendant had the control or custody of the child was put in issue by the pleadings. In a case where habéas corpus is brought to relieve one from imprisonment, the statute provides that where material allegations of the *135return are denied, or any allegations of fact are made showing either that the imprisonment or detention is unlawful, or that the prisoner is entitled to his discharge, the court must proceed in a summary way to take proof and dispose of the prisoner as justice may require. (Code Civ. Proc. § 2039.) By analogy to the rule there laid down, where a writ of habeas corpus is sued out to establish the right to the custody of a child, we think it was the duty of the court, upon an issue raised, as to a fact necessary to entitle the relator to relief, to require proof to enable the court to determine it. No proof was given on the question whether the defendant had the control or custody of the child, and for that reason we think that it was erroneous to make the order requiring its production and delivery to its mother.
There is also another, matter which we think the court should have considered before making this final" order. Undoubtedly if the father of this girl is not living the mother is prima facie entitled to her custody, unless she is not a proper person to have it, and except for very good reasons the court would not refuse to award the custody to her. But, after all, the question in this case does not depend upon the absolute legal right of the parent to the custody of the child, but the important thing to be determined in any such case is ■the interest of the child itself. If it appears that the mother, either because of her poverty or for any other good reason, is not a proper person to be intrusted with the custody of the young person, the courts will refuse it. It does not appear in this case whether the father of the child is living or not. It does appear, however, that the mother was in 1894 in such destitute circumstances that she gave up the control of the child because she was not able to care for or ■support it. Before the court should deliver the child it is its duty to ascertain whether the mother is the one entitled to its custody, and if so, whether her circumstances are so changed that she is in a condition to support and sustain her child. The custody of the child is not to be returned to her solely because of her legal right, to the end that she may have the benefit of its labor and be supported by it, but whether the court will deliver the child is a matter within its sound discretion upon the facts made to appear.
In this view also we think that it was error for the court, without proof as to the ability of the mother to properly provide for the *136child, to award her custody to the mother, and the order must be reversed and the ease sent back to the Special Term for another hearing, upon that hearing to take such testimony as may be proper.
Yah Brunt, P. J., and Ingraham, J., concurred; Hatch and O’Brien, JJ., dissented.