delivered the opinion of the court.
This was a habeas corpus proceeding brought by Nemesio Baba to recover the possession of his legitimate daughter. In. opposition to his pretensions the evidence tended strongly to show that his daughter, who was 16 years old, voluntarily left the house of her father to take refuge in the home of her maternal grandmother; that his general behavior and his conduct toward his daughter were of such a corrupt nature that he ought not to have the custody of his daughter. The court so found and held that the well-being of the girl required that she be left in the custody of her grandmother.
The complainant and appellant does not at this time attack the facts as found by the court. He goes much further. He concedes even that if the facts are true he should be deprived of the patria potestas, but he insists that he can not be deprived of a right to the custody of his child until he is first deprived of the said right of patria potestas; that he can only be deprived of such a right by a proceeding begun for that purpose and that such a right can not be determined or examined into in a habeas corpus proceeding. Necessarily involved therein is the contention that he has a permanent right to the custody of his child; that the writ of habeas corpus should avail him to recover the said custody and that no issue may be raised herein except as to the existence of the said right of patria potestas.
Section 236 of the Civil Code provides as follows:
‘ ‘ The courts may deprive parents of the patria potestas or suspend the exercise thereof, if thejr treat their children with excessive harshness, or give them commands, advice or examples of a corruptive nature, and shall name a tutor, in accordance with law, for the per*455sons of the said children. In snch cases, they shall also deprive the parents of the nsnfrnct and administration of the property of the children, and adopt snch measures as they shall deem expedient in the interests of the latter.”
Conceding- that this section is only applicable in a direct proceeding in which the father is the defendant, it by no means follows that the custody of a child must inevitably be surrendered on the presentation of a petition in habeas corpus. This is a case of a girl 16 years old who prefers to remain with her grandmother, able to provide for her, and where the child decidedly will be better placed.
The father has been shown to be an.improper person for the custody. The well-being of the child would demand that she be left with her grandmother.
The appellant petitioned for this writ himself. While the writer, in Ex parte Chabert, 30 P.R.R. 712, expressed some doubts, this is the kind of a ease calculated to dissipate doubts and he has arrived at the conclusion that in Porto Bico the well-being of a child may be inquired into in habeas corpus proceedings presented by a father. There is nothing in any code in Porto Eico that prevents snch a determination. A court is a parens patria and can look out for the interests of a child and protect it. It would work a hardship to cause this girl to be returned even temporarily.
The action of the court below was to1 dismiss the petition. Even if we were doubtful whether or not the essential well-being of a child could be inquired into by a writ of habeas corpus, we still should not reverse the action of the court. The writ of habeas corpus is discussed under Title XII, section 469 et seq. of the Code of Criminal Procedure. Section 469 provides:
“Every person unlawfully imprisoned or restrained of his liberty, under any pretense whatever, may prosecute a writ of habeas corpus, to inquire-into the cause of such imprisonment or restraint.”
This child is not imprisoned or restrained, within the *456intendment of this section. A woman, or almost a woman, she voluntarily sought her present shelter.
Section 480 provides:
“The party brought before the court or judge, on the return of the writ, may deny or controvert any of the material facts or matters set forth in the return, or except to the sufficiency thereof, or allege any fact to show either that his imprisonment or detention is unlawful, or that he is entitled to his discharge. The court or judge must thereupon proceed in a summary way to hear such proof as may be produced against such imprisonment or detention, or in favor of the same, and to dispose of such party as the justice of the case may require, and have full power and authority to require and compel the attendance of witnesses, by process of subpoena and attachment, and to do and perform all other acts and things necessary to a full and fair hearing and determination of the case.”
The writ is not available to commit an injustice. Applicable to some of these foregoing considerations are Yon v. Gómez, 14 P.R.R. 677; LeHardy v. Acosta, 18 P.R.R 438. In the former case we said:
“The remedy of habeas corpus is not a measure established by the law to punish the disobedience of the daughter and force her to return to the house of her parents. The defendant, Lorenzo Gómez, cannot be compelled to restore and deliver said young woman to her father, the petitioner, because it does not appear from the evidence that he has her under his custody, nor that he is compelling her to live with hint by restraining her of her liberty.
•“The young woman is 18 years of age, and it cannot be either presumed or supposed that like an infant of tender years, she acts unconsciously or that in her acts there is any restraint or limitation of liberty.”
While the grandmother has the child with her she is not restraining the child or compelling the child to live with her.
The justice of the ' case requires that the child be left with her grandmother, and the judgment will be affirmed.
Mr. Justice Aldrey dissented. Mr. Justice ITutchison took no part in the decision of this ease.