Facts: Maricel ran away from her parents Antonio and Rosita Gallardo to live with her boyfriend. Maricel became pregnant and gave birth to Maryl Joy. Maricel's boyfriend left her. Maricel returned to her parents but ran away again and went to Noel and Lydia. There, she entrusted to the two the custody of Maryl, and left behind a note relinquishing her parental rights over Maryl in their favor.

When Spouses Gallardo learned about this, they tried to obtain the custody of Maryl but Noel and Lydia refused. Thus, Spouses Gallardo filed a petition for habeas corpus before the RTC. At the RTC, both parties agreed to a shared custody of Maryl, where the grandparents took custody of her during weekends. The Regional Trial Court approved the agreement. Unfortunately, Spouses Gallardo took Maryl away and brought her to Samar. Hence, Noel and Lydia filed a motion to cite in contempt Spouses Gallardo. They also filed a motion to dismiss the petition for habeas corpus based on Rule 17 of the Rules of Court, citing the plaintiff’s refusal to comply with a lawful order of the court.

The RTC cited Spouses Gallardo in contempt and dismissed the petition for habeas corpus filed by them for mootness, since Maryl was already in their custody. Noel and Lydia filed a Motion for Reconsideration alleging that the action should have been dismissed pursuant to Section 3, Rule 17, of the Rules of Court. They prayed that Maryl Joy be returned to them to preserve the status quo ante. The RTC denied the MR ruling that the sole purpose for the filing of the petition is to cause the production before the Court of the person of Maryl, not a determination of the legality or illegality of custody.


Issue: Was the sole purpose of the petition for habeas corpus the production of Maryl Joy before the trial court and that it would be moot upon said production?


Held:  No. Section 1, Rule 102, of the Rules of Court states that the writ of habeas corpus shall extend to all cases where the rightful custody of any person is withheld from the persons entitled thereto. In cases involving minors, the purpose of a petition for habeas corpus is not limited to the production of the child before the court. The main purpose of the petition for habeas corpus is to determine who has the rightful custody over the child.

The RTC erred when it hastily dismissed the action for having become moot after Maryl Joy was produced before the trial court. It should have conducted a trial to determine who had the rightful custody over Maryl Joy. In dismissing the action, the RTC, in effect, granted the petition for habeas corpus and awarded the custody of Maryl Joy to the Spouses Gallardo without sufficient basis.

It is true that Article 214 of the Civil Code states that in case of absence or unsuitability of the parents, substitute parental authority shall be exercised by the surviving grandparent. Article 216 also states that in default of parents or a judicially appointed guardian, the surviving grandparent shall exercise substitute parental authority over the child. However, in determining who has the rightful custody over a child, the child’s welfare is the most important consideration. The court is not bound by any legal right of a person over the child.

There are three requisites in petitions for habeas corpus involving minors: (1) the petitioner has a right of custody over the minor, (2) the respondent is withholding the rightful custody over the minor, and (3) the best interest of the minor demands that he or she be in the custody of the petitioner. In the present case, these requisites are not clearly established because the RTC hastily dismissed the action and awarded the custody of Maryl Joy to Spouses Gallardo without conducting any trial.

Case to the RTC for the purpose of receiving evidence to determine the fitness of the Antonio and Rosita to have custody of Maryl Joy. (Bagtas vs. Judge Santos, G.R. No. 166682, November 27, 2009)