
8 So.3d 322 (2008)
L.A.C.
v.
T.S.C. and St. Clair County Department of Human Resources.
2070313.
Court of Civil Appeals of Alabama.
November 7, 2008.
S. Philip Bahakel and Donna J. Beaulieu of S. Philip Bahakel & Associates, Pelham, for appellant.
Submitted on appellant's brief only.
THOMPSON, Presiding Judge.
L.A.C. ("the mother") and T.S.C. ("the father") were married on December 5, 1998. Two children were born of the parties' *323 marriage; the children had not yet reached the age of majority at the time of the final hearing in this matter. On August 23, 2007, the mother filed a complaint in the St. Clair Circuit Court ("the circuit court") seeking, among other things, a divorce from the father and custody of the parties' minor children. The father answered on September 13, 2007, and he counterclaimed for a divorce. The father also sought custody of the parties' two minor children.
On September 13, 2007, the father filed a motion for a temporary restraining order and a petition for pendente lite relief. The father requested that the circuit court enter an order preventing the mother from, among other things, harassing or intimidating him or committing acts of violence towards him, and he requested that the circuit court award him custody of the children. On September 14, 2007, the mother filed a petition for protection from abuse against the father based on, among other things, the father's alleged threats to injure her and her belief that the father might remove the children from the state. The circuit court subsequently entered an ex parte protection order protecting the mother from the father.
On November 2, 2007, the circuit court conducted a hearing in the parties' divorce action to resolve the issue of custody of the children. The record does not indicate whether the November 2, 2007, hearing was intended to resolve the issue of pendente lite custody of the children or whether it was intended to result in a final determination regarding custody of the children. While on the record, the circuit court expressed concern for the safety of the children, and it ordered from the bench that the St. Clair County Department of Human Resources ("DHR") take custody of the children. The record reveals that the circuit court took issue with the mother's living with a married man. The circuit court also expressed concern that the father might be abusing the prescription drug Xanax because of a positive drug test on November 2, 2007, and erratic behavior on the date of the hearing. The children were subsequently removed from the mother's and the father's custody. The circuit court did not enter a written order at that time.
After it orally ordered the children in DHR's custody, the circuit court did not enter an order in the record pursuant to Rule 58, Ala. R. Civ. P. The record reveals that the mother did not request that the circuit court enter an order pursuant to Rule 58 or file a petition for a writ of mandamus challenging the circuit court's decision to remove the children from the parties' custody.[1]
On November 21, 2007, T.C. and B.C., the children's paternal grandparents, petitioned the circuit court seeking to intervene in the divorce action. In their petition, the paternal grandparents alleged that the parties' children were in DHR custody and that DHR had temporarily placed the children in their home. On November 21, 2007, the paternal grandparents also filed a petition for modification of custody, visitation, and support, asking, among other things, that the circuit court award them temporary custody of the children and order the parties to pay child support for the benefit of the children. On November 29, 2007, the circuit court granted the paternal grandparents' petition to intervene in the divorce action.
*324 On November 21, 2007, the mother filed a petition for a writ of habeas corpus in the divorce action requesting that the children be returned to her custody. In her habeas petition, the mother contended, among other things, that the circuit court had not complied with § 12-15-60 and § 12-15-153, Ala.Code 1975, because it had failed to conduct a hearing within 72 hours after removing the children from her custody. Both § 12-15-60(a) and § 12-15-153 require a trial court to hold a hearing within 72 hours when a child is summarily removed from parental custody. K.S. v. G.A.B., 911 So.2d 1085, 1097 (Ala. Civ.App.2005). On December 20, 2007, the circuit court denied the mother's habeas petition.
On November 26, 2007, M.S., the children's maternal grandmother, filed dependency petitions in the St. Clair Juvenile Court ("the juvenile court") alleging that the children were dependent, thereby invoking the jurisdiction of the juvenile court. See § 12-15-30(a) and (b)(1), Ala. Code 1975 (a juvenile court has original jurisdiction in proceedings in which a child is alleged to be dependent and in proceedings to determine the custody of a child who is otherwise before the juvenile court). The dependency petitions were assigned case numbers JU-07-613 and JU-07-614. The record reveals that the same trial judge who presided over the divorce proceedings in the circuit court also presided over the dependency proceedings in the juvenile court.
On December 4, 2007, DHR filed a dependency petition in the juvenile court proceeding that had been initiated by the maternal grandmother, alleging that the children were in the care of DHR at that time due to their dependency. DHR requested, among other things, that the juvenile court declare the children to be dependent, award DHR temporary legal custody of the children, and conduct a 72-hour hearing on the petition. DHR included on the face of its dependency petition the case number assigned to the divorce action and the case numbers assigned to the pending juvenile actions.
On December 6, 2007, the trial judge, then sitting as a juvenile court judge, entered an order in the dependency proceedings finding the children to be dependent, finding "it would be in the best interest of [the] minor children for the legal custody of the minor children to be vested with ... DHR with discretion in planning and placement," and setting the matter for a hearing to be held on December 20, 2007. The juvenile court appointed a guardian ad litem for the minor children for the first time at that point in the proceedings. The December 6, 2007, order of the juvenile court was the only adjudication of dependency in this matter.
On December 17, 2007, the mother filed in the circuit court a postjudgment motion in which she purported to challenge the December 6, 2007, dependency order entered in the juvenile proceedings. On December 19, 2007, the children's maternal grandmother filed a motion in the circuit court to consolidate the two dependency actions pending in the juvenile court with the divorce action. On December 20, 2007, the maternal grandmother filed a motion in the circuit court to intervene in the divorce action. The trial judge, on December 20, 2007, granted the maternal grandmother's motion to intervene and the motion to consolidate the juvenile proceedings and the divorce action. Hereinafter, we refer to the trial judge, whether acting in his capacity as the circuit court judge or in his capacity as the juvenile court judge in these consolidated proceedings, as "the trial court."
Also, on December 20, 2007, the trial court denied the mother's postjudgment *325 motion; at that point, the actions had been consolidated. The trial court also entered an order on December 20, 2007, requiring DHR to conduct home studies of the parents' respective homes, as well as of the homes of the paternal grandparents and the maternal grandmother, and awarding the father and the mother visitation with the children. On January 3, 2008, the mother timely filed a notice of appeal.
As an initial matter, we note that several of the issues raised by the mother on appeal challenge the trial court's authority with regard to its removal of custody of the children from the mother at the November 2, 2007, hearing. The mother contends, in one part of her brief submitted to this court, as she did in her petition for writ of habeas corpus, that the trial court erred by removing the children from her custody without notice, without entering a written order, and without conducting a hearing as required by §§ 12-15-151 through -153, Ala.Code 1975, and § 12-15-60(a), Ala.Code 1975. Given the nature of the mother's arguments pertaining to the November 2, 2007, removal of the children from her custody, we have elected to construe that part of her brief asserting those arguments as a challenge to the trial court's December 20, 2007, denial of her petition for a writ of habeas corpus; we treat those arguments as seeking review by a petition for a writ of mandamus. See Johnston v. Johnston, 440 So.2d 1112 (Ala. Civ.App.1983) (the denial of a writ of habeas corpus is interlocutory in nature and is reviewable by a petition for a writ of mandamus); see also Fowler v. Merkle, 564 So.2d 960 (Ala.Civ.App.1990) (an appellate court has discretion to treat an appeal as a petition for a writ of mandamus).
The record before this court reveals that at the time the trial court removed the children from the mother's custody at the conclusion of the November 2, 2007, hearing, no allegations of dependency had been made by any one. The trial court made no express finding at that time that the mother was unfit to have custody of the children. In order for a trial court to award custody to a nonparent, it must make an express determination that the parent is unfit. Ex parte Terry, 494 So.2d 628 (Ala. 1986). In Serio v. Serio, 3 So.3d 937 (Ala. Civ.App.2008), this court reversed a trial court's judgment awarding custody to a nonparent based on its failure to make an express determination of unfitness, stating:
"[T]he trial court did not make an express determination that the father was unfit or refer to the standard set out in Ex parte Terry, 494 So.2d at 632, in its judgment. This court has held that `when a trial court awards custody to a nonparent in a contest with a parent, the trial court must make an express finding of unfitness.' Lawrence v. Cannon, 998 So.2d 1070, 1072 (Ala.Civ.App.2008)(citing C.P. v. W.M., 806 So.2d 395, 398 (Ala.Civ.App.2001)). The trial court's judgment is, therefore, reversed based on the trial court's failure to make an express determination of unfitness pursuant to Ex parte Terry and its progeny."
Serio v. Serio, 3 So.3d at 939.
In this case, the trial court erred when it made no express finding that the parents were unfit before awarding custody of the children to DHR at the conclusion of the November 2, 2007, hearing. Furthermore, our review of the evidence in the record before this court reveals that, had the trial court indeed determined that the mother was unfit, that finding would not be supported by clear and convincing evidence. See Ex parte Berryhill, 410 So.2d 416 (Ala.1982) (a finding of unfitness must be supported by clear and convincing evidence). We address the lack of clear *326 and convincing evidence in the record later in this opinion.
The trial court further erred when it failed to enter a written order and failed to conduct a 72-hour hearing following the removal of the children from the mother's custody. See § 12-15-151, Ala.Code 1975 ("A protection ... order may be entered after notice and hearing, upon proper showing ... that such an order is necessary to protect the health or safety of the child or is otherwise in the child's best interest."). In this case, 34 days passed from the day the trial court removed the children from the mother's custody to the day that the trial court entered an order finding the children dependent. During those 34 days, the children were in the custody of DHR based on a directive of the trial court that had not been formally entered on the record. The trial court waited to make a determination of dependency until prompted to do so by the filing of dependency petitions by the maternal grandmother and DHR. We conclude that the trial court erred by removing the children from the mother's and the father's custody without entering a written order or conducting a hearing. In light of the foregoing, we issue a writ of mandamus directing the trial court to vacate its denial of the mother's petition for habeas corpus and direct the trial court to grant that motion.
We now turn to the arguments presented for review by appeal. The mother contends that the December 6, 2007, judgment finding the children to be dependent is due to be reversed because, she argues, the evidence does not support a finding of dependency. Specifically, the mother argues that the trial court erred by basing its finding of dependency on her relationship with a married man when the evidence did not demonstrate that her relationship with the married man adversely affected the parties' children. DHR has not filed a brief in response to the arguments presented by the mother on appeal.
In its December 6, 2007, judgment finding the children to be dependent, the trial court, referring to testimony offered at the November 2, 2007, hearing, found, in pertinent part, as follows:
"In testimony, the mother admitted to living with a man not her husband, with the children in the home. The mother showed a total disregard for the court in her own testimony. The court, having serious concerns regarding the living conditions and the environment [of] the children, ordered the children removed from the home of the mother due to the actions and non actions of the mother and additional concerns over the [father's] mental stability. Further, the court found to allow the children to remain in the home of the [mother] or to place the children with the [father] at this time would be contrary to the welfare of the children and that removal from both parents is in the best interest of the children."
Our standard of review of dependency determinations is well settled.
"A finding of dependency must be supported by clear and convincing evidence. § 12-15-65(f)[, Ala.Code 1975]; M.M.S. v. D.W., 735 So.2d 1230, 1233 (Ala.Civ.App.1999). However, matters of dependency are within the sound discretion of the trial court, and a trial court's ruling on a dependency action in which evidence is presented ore tenus will not be reversed absent a showing that the ruling was plainly and palpably wrong. R.G. v. Calhoun County Dep't of Human Res., 716 So.2d 219 (Ala.Civ. App.1998); G.C. v. G.D., 712 So.2d 1091 (Ala.Civ.App.1997); and J.M. v. State *327 Dep't of Human Res., 686 So.2d 1253 (Ala.Civ.App.1996)."
J.S.M. v. P.J., 902 So.2d 89, 95 (Ala.Civ. App.2004). This court has stated that clear and convincing evidence is
"`[e]vidence that, when weighed against evidence in opposition, will produce in the mind of the trier of fact a firm conviction as to each essential element of the claim and a high probability as to the correctness of the conclusion. Proof by clear and convincing evidence requires a level of proof greater than a preponderance of the evidence or the substantial weight of the evidence, but less than beyond a reasonable doubt.'
"§ 6-11-20[(b)](4), Ala.Code 1975."
L.M. v. D.D.F., 840 So.2d 171, 179 (Ala. Civ.App.2002).
The dependency statute defines, in part, a "dependent child" as a child
"c. Whose custody is the subject of controversy; or
"....
"f. Who is in a condition or surroundings or is under improper or insufficient guardianship or control as to endanger the morals, health, or general welfare of the child; or
"....
"m. Who for any other cause is in need of the care and protection of the state."
§ 12-15-1(10), Ala.Code 1975.
The testimony presented to the trial court at the November 2, 2007, hearing revealed the following pertinent facts. The mother and the father were married for eight years before separating. After the mother and the father separated but while they were still married, the mother began a romantic relationship with G.H. Following the mother and father's separation, the mother and the children moved out of the marital home and lived with the maternal grandmother in a two-bedroom house. Approximately two to three weeks later, G.H. began living in the maternal grandmother's house with the mother and the children. G.H. had separated from his wife at the time he began living with the mother and the children. When asked about how her relationship with G.H. might affect the children, the mother testified that she did not believe it would have any detrimental effects on the children so long as the children did not "realize the circumstances." The father testified that G.H., whose employer had conducted a background check on him, did not have a "bad background."
S.H., G.H.'s wife, testified that there was nothing in G.H.'s background that would justify preventing G.H. from spending time with the children. S.H. described G.H. as a "good person" who was "good to kids." S.H. testified that there was no reason that anyone should have trouble with G.H. raising their children.
The father testified that, after G.H. moved into the maternal grandmother's house, the children were forced to sleep in a "closed-in" porch that he said formerly housed large dogs. According to the father, the children slept on air mattresses. The mother testified that the porch at the maternal grandmother's house had been converted into a bedroom with improvements that included new floors, new paint, and new air ducts that were installed before the children slept in the room.
At the time of the November 2, 2007, hearing, the mother had moved out of the maternal grandmother's house and was living with G.H. and the children in a three-bedroom house owned by the mother's grandparents. The record contains no evidence regarding the condition of the house the mother lived in at the time of the *328 November 2, 2007, hearing. The children were ages eight and six at the time of the hearing. The mother testified that the children's performance at school was excellent. According to the mother, the children were making almost straight A's on their report cards.
The trial court heard conflicting testimony regarding the father's drug use. The father explained that he had been diagnosed with post-traumatic stress disorder ("PTSD") in 1997 after serving with the United States Navy. The father stated at the hearing that he no longer suffered from PTSD. At the time of the hearing, the father was taking Xanax and azithromycin prescribed for him by his treating physician; the father explained that he used those prescription medications to help him sleep and because his "nerves have been tore up" from the mother's leaving him and filing for a divorce. According to the father, he had been prescribed the medication two weeks before the November 2, 2007, hearing.
The father admitted that he had smoked marijuana in the past, and he testified that the mother had also smoked marijuana in the past. Both the father and the mother testified that they had not smoked marijuana in years. The trial court ordered the father and the mother to submit to drug tests during the November 2, 2007, hearing. The results of the mother's drug test were negative, and the results of the father's drug test revealed that he was positive for benzodiazepines.[2]
In this case, the trial court based its dependency determination, in large part, on the living conditions to which the children were exposed by the mother's adulterous relationship with G.H. Regarding the living conditions that the children were exposed to, the evidence revealed that, immediately following the mother and father's separation, the children slept in an enclosed porch that had been converted into a bedroom at the maternal grandmother's house. At the time of the November 2, 2007, hearing, the mother and the children were no longer living with the maternal grandmother; instead, they were living in a three-bedroom house owned by the mother's grandparents. The record contains no evidence regarding the condition of the mother's new house.
With regard to the mother's relationship with G.H., it is undisputed that the mother and G.H. lived together in the same house as the children at the time of the November 2, 2007, hearing. Although we do not condone the mother's decision to live with a married man in the same house with the children, the mother's choice to do so does not, in and of itself, support a finding of dependency. We also note that the maternal grandmother's pleadings allege that G.H. had moved out of the mother's house before any dependency petitions were filed in the trial court and, consequently, before the trial court entered its judgment finding the children dependent.
In V.W. v. G.W., 990 So.2d 414 (Ala.Civ. App.2008), the father in that case filed a "Petition for Custody" alleging, among other things, that the mother in that case had associated with drug users and that police had "raided" the mother's house while the parties' child was present in search of illegal drugs. 990 So.2d at 415. In response to the father's petition, the juvenile court in V.W. v. G.W. awarded the father pendente lite custody of the child. Following a hearing, the juvenile court found the child dependent, removed the child from the mother's custody, and awarded custody of the child to the father. The mother appealed, arguing that the *329 juvenile court's judgment of dependency was contrary to § 12-15-1(10), Ala.Code 1975. 990 So.2d at 415-16. At a hearing before the juvenile court, the father had expressed concern about the mother's going to nightclubs and consuming alcoholic beverages and about the people that he knew the mother had had around her. The father explained that his decision to seek custody of the child stemmed from his observations of K.W., a male acquaintance of the mother's, who appeared to be cohabiting with the mother and the child. 990 So.2d at 416. The father also testified to having been informed of a police search for illicit drugs in the mother's residence. The mother admitted that the police had conducted a search of her residence, but she denied that it was related to illegal drugs. The mother further admitted that she had had a relationship with K.W., but she testified that she had had no contact with that man since the juvenile court had awarded the father pendente lite custody of the child. V.W. v. G.W., supra.
Based on the evidence presented to the juvenile court in V.W. v. G.W., this court reversed the finding of dependency, stating:
"Under the circumstances of this case, after a review of the evidence in the record, we are constrained to agree with the mother that the child's dependency was not demonstrated under Alabama law so as to support the juvenile court's adjudication and disposition of the child. The record lacks evidence tending to show, as the father contends, that under the mother's care the child's `morals, health, or general welfare' would be in any current danger or that the mother has failed to provide proper care or guardianship ...."
V.W. v. G.W., 990 So.2d at 417. In reversing the juvenile court's judgment, this court noted that the "emergency" basis for the father's custody petition stemmed almost exclusively from the mother's previous relationship with K.W., and we recognized that "`in order to make a disposition of a child in the context of a dependency proceeding, the child must in fact be dependent at the time of the disposition.'" V.W. v. G.W., 990 So.2d at 417 (quoting K.B. v. Cleburne County Dep't of Human Res., 897 So.2d 379, 389 (Ala.Civ.App.2004) (Murdock, J., concurring in the result)).
In this case, the maternal grandmother and DHR failed to present clear and convincing evidence indicating that the children were dependent as alleged in their respective dependency petitions. The maternal grandmother and DHR, as petitioners in the dependency proceedings, were required to present clear and convincing evidence of dependency. Ex parte Floyd, 550 So.2d 982 (Ala.1989). In its December 6, 2007, dependency order, the trial court relied solely on evidence presented at the November 2, 2007, hearing to find the children dependent. The evidence presented at that hearing revealed that the mother was involved in a romantic relationship with G.H. and that the children were aware of that relationship. However, the evidence presented to the trial court did not reveal if or how the mother's relationship with G.H. adversely impacted the lives of the children. Testimony elicited from the father and S.H. revealed that G.H. did not have a criminal background and that he was good with children. Further, there was no evidence presented that called into question the mother's parenting skills or her ability to parent the children.
Given the evidence presented to the trial court in this case, we must conclude that the evidence did not support a finding of dependency. Therefore, we reverse the trial court's judgment finding the children dependent.
*330 PETITION FOR WRIT OF MANDAMUSPETITION GRANTED; WRIT ISSUED; APPEALREVERSED AND REMANDED.
PITTMAN, BRYAN, THOMAS, and MOORE, JJ., concur.
NOTES
[1]  Even if the circuit court had properly entered an order pursuant to Rule 58, the order would be interlocutory and, therefore, mandamus relief would be the appropriate remedy. See Ex parte A.M.P., 997 So.2d 1008, 1014 (Ala.2008) ("A petition for a writ of mandamus is an appropriate remedy for challenging an interlocutory order.").
[2]  The record indicates that benzodiazepines include Xanax.
