The Texas Department of Family and Protective Services (the Department) appeals from the district court’s order granting the modification of a previous divorce decree between R.S.-L. (Mother) and T.L. (Father) and naming the Department and R.S.-L. as joint managing conservators of T.V.L. (Child), Mother and Father’s 16-year-old child.[1] We will vacate the trial court’s order and remand the case to the trial court for further proceedings. BACKGROUND Mother and Father divorced in June 2010. The district court’s final decree of divorce named Mother and Father as joint managing conservators of Child with Mother having the right to designate the child’s primary residence. Mother agreed to set Father’s child support at zero, Father was ordered to pay $57.00 in monthly medical support, and both parents were ordered to pay fifty percent of the child’s healthcare expenses. In November 2021, the Department was notified that Mother and her husband, J.O. (Stepfather) were abusing Child by yelling at her and calling her names and that Stepfather had hit Child for no reason. This caused Child to be hospitalized due to suicidal ideations. In December 2021, the Department was notified that Mother had choked Child and slammed her face against a wall, causing injury. On March 12, 2022, the Department was notified that Child had on three occasions threatened to stab someone in the home. The Department was told that Child threatened to stab Mother with a screwdriver; that she had stolen money from Mother; that she repeatedly snuck out of the house and refused to bathe; and that her room was filled with trash and decomposing food. Tension in the home escalated to a physical altercation among Mother, Stepfather, and Child during which Child threatened to stab Stepfather with a six-inch kitchen knife. On March 14, 2022, the Department received additional reports that Mother was refusing to accept parental responsibility for Child, who was at a secure facility, that Child did not want to return to the home, and that Mother did not want Child to return to the home. The Department was informed that Child was at the secure facility because it had been determined that she made a terroristic threat against Mother and Stepfather. On March 14, 2022, at the Department’s request, the court ordered that the Department take temporary managing conservatorship of Child because Mother refused to let her return to the home. Child was then released into the Department’s custody. The Department then filed a motion to modify Mother and Father’s divorce decree to remove Mother and Father as Child’s joint managing conservators. The Department requested that, in the event it was unable to reunify the family, the court appoint either the Department or a suitable competent adult as Child’s managing conservator. The Department also sought a court order for Mother and Father to participate in services including attending counseling and parenting classes and submitting to psychological or psychiatric examinations. After a hearing in April 2022, the court found that it was not in Child’s best interest to remain in Mother’s home and that, despite the Department’s reasonable efforts to enable Child to return to Mother’s home, doing so would create a substantial risk of continuing danger to Child. The court appointed the Department and Mother as Child’s joint temporary managing conservators and ordered that Mother have weekly supervised visitation with Child. From March 2022 until February 2023, Child remained in the Department’s custody and the court was notified of “serious incidents” involving Child at her placements. The court was also notified of instances in which Child was in “runaway status” because she had left her placement without permission and remained missing for short periods of time, typically overnight, after which she returned to the placement. The court was also notified, through periodic status reports, that Child was uncooperative about engaging in services and stated that she did not want to return to Mother’s home. Throughout the year, the court made orders related to obtaining appropriate psychological treatment for Child. The court made several orders regarding appropriate placements for Child, who continually left her placements without permission. Because of concerns that Child was using drugs and engaging in sexual activity while in runaway status from her placements, the court ordered that she submit to drug testing and pregnancy testing and that the Department make an appointment for Child at Planned Parenthood “to discuss safe sex options and contraception.” On December 22, 2022, the court held a hearing that resulted in the court making the following findings: in the preceding thirty day period Child had been without placement and in the direct care of the Department and had run away from Department caregivers at least twelve times; after running away, sometimes Child would return on her own accord and other times she was found in a location known for easy access to illicit drugs and alcohol and that drug testing indicated she had marijuana and methamphetamines in her system; Child had been prescribed medications, including psychotropic medications for mental health stability but that she did not take her prescribed medications when she was on runaway status; Child’s psychiatrist had recommended acute hospitalization to re-examine Child’s medications and stabilize her to prepare her to be transported to Southern Peaks Regional Treatment Center in Colorado for placement. The court ordered that Child be admitted for acute hospitalization as recommended, that she remain hospitalized until discharged by the providers or until she was mentally stable enough to be transported to Southern Peaks Regional Treatment Center in Colorado. The court ordered that the Department notify the court if placement at Southern Peaks had not occurred by January 6, 2023. On January 11, 2023, after a hearing, the court made the following findings: Child had remained hospitalized at Cedar Crest Hospital & Residential Treatment Center pursuant to the court’s emergency detention order; Child was likely to suffer serious physical harm unless she was taken into the physical custody of law enforcement officers to provide for Child’s safe interim placement at Southern Peaks Regional Treatment Center and that doing so was requested by Mother as well as Child’s clinical consultant. The court ordered that, at the Department’s request, law enforcement officers take physical custody of Child and provide for her safe interim placement at Southern Peaks. On January 20, 2023, the court was notified that Child had left the Southern Peaks facility by climbing over the gate and running away. After the police department was unable to locate her, Child returned to Southern Peaks three hours later. The court then ordered the Department to begin the process for applying for Supplemental Security Income for Child with the Social Security Administration. On February 17, 2023, Mother filed her original answer and counterpetition in which she requested that all relief sought by the Department be denied, that she be appointed Child’s sole managing conservator instead of joint managing conservator with Father. Mother also sought modifications of the original divorce decree including changes to the child support award. Mother stated, in the alternative, that if she was not named sole managing conservator, it was in Child’s best interest that a maternal relative, fictive kin, or other appropriate person be named sole managing conservator and she should be named possessory conservator with possession and access pursuant to a standard possession order. Mother requested that the court make temporary orders appointing her temporary sole managing conservator, requiring that Father have supervised visitation and pay child support, and dismissing the Department and all other parties from the case. Mother sought no affirmative relief from the Department. In May 2023, the court was notified that Child had been placed in a Child Watch placement in Temple because the Department’s Child Placing Unit could not locate a placement for Child.[2] Thereafter the court was notified of repeated instances of Child leaving the placement without permission and returning either several hours later or the next day. At the end of May, Child was hospitalized to address suicidal ideation, was released from the hospital the same day “upon stabilization” and transported to a different “Child Without Placement” (CWOP) location in Temple. The Department filed a number of “serious incident reports” in June describing repeated behavioral issues involving alcohol use, damage to property, and sexual contact between Child and other minors at the placement. On June 15, the court ordered the parties to participate in a facilitated meeting, ordered the Department to “visit with the child’s mental health treatment providers to determine if acute hospitalization is necessary to ensure the child is stabilized on her medications,” and ordered the child advocates and Mother to come up with a plan for how Child could use a cellphone. After receiving notifications of several more instances of Child leaving her placement without permission, the court ordered the Department to consult with a CWOP clinician “for guidance on stability/goals” for Child. The court also ordered the Department to pursue “searches for placement, including out of state options.” During the remainder of June and throughout July and August 2023, the Department filed numerous serious incident reports and reported repeated instances of Child leaving her placement without permission. In August 2023, the Department notified the court that Child had run away from her CWOP placement the night of August 6 and that it had assigned a special investigator to assist with locating her. On August 28, the Department filed a “Request for Judges to Confer” in which it stated that it had been notified by the police department in Monroe County, Tennessee that it had T.V.L. in its possession. The Department had determined that Child was likely being trafficked, and Child was found by the Monroe County police alone on the side of the road. Child reported to the police that she had been picked up in Texas and taken to Tennessee and that she had gotten into an argument with an older male individual who had left her on the side of the road. The Tennessee police department was working to locate the individual with whom the Child reported she had been. The Tennessee court had taken Emergency Temporary Conservatorship of Child and, seeking to have Child returned to Texas, the Department requested that the court confer with the Monroe County Court to determine which state would continue to exercise jurisdiction over Child. On August 29, 2023, the court, after a hearing, made the following findings: the Department confirmed involvement by the FBI and other officials pursuing an unrelated male involved with the transport of Child across state lines and there were indicators of trafficking/exploitation associated with the runaway status and recovery of Child; and since Child had been in the temporary managing conservatorship of the Department, there had been “66 separate Notice of Runaway filed, as well as 31 CWOP Serious Incident Reports, and 4 Notice of Detention/Arrest” for Child. The court ordered that Child was “prohibited from being located or placed at a designated [Department] CWOP location anywhere in the State of Texas” and that the Department “shall not cause or allow [Child] to be located or placed at a designated CWOP location anywhere in the State of Texas at any time.” The court also ordered the Department to continue to actively pursue Child’s return to Texas. On September 7, 2023, the Department notified the court that Child had been admitted to “mental health unit, inpatient hospitalization, at Dell Children’s Hospital in Austin, Texas.” The court scheduled a hearing in the case for September 13, 2023. The Department, the CASA supervisor, Child’s CASA guardian ad litem, and counsel for Mother attended the hearing. Also present was Dr. Richard Yuen, a licensed psychologist and Child’s clinical case consultant and Dr. Sommer Howser with Ascension Texas and Dell Children’s Medical Center. After the court asked for “updates” on Child, the Department stated that Child had returned to Texas on September 5th and was admitted to Dell Children’s Hospital. She remained there until September 7th, when she was admitted into a psychiatric placement at Dell Children’s Hospital and had remained there. The Department reported that it had worked with Unbound, human trafficking advocates, who had sent a representative to the hospital when Child was admitted. The Department reported that it had also been working with a human trafficking social worker and a mental health unit social worker at Dell Children’s Hospital. The Department reported that, with the help of the social workers, they had identified three possible placement options for Child. The first possible placement was a girls only human trafficking placement that did not work with “wards of the state” and would require that Mother, rather than the Department, bring and sign Child in. The second possible placement, a human trafficking placement in Garland, Texas, had notified the Department that “per their policy, they do not work with CPS youth” and in order to be accepted there, “the Department would need to be dismissed.” The Department stated that this second placement was “completely free of cost to Texas residents.” The third possible placement was a human trafficking placement in Louisiana, which “would be able to do placement through Mother” and “would require no payment and work with” Mother’s primary medical insurance for Child. The Louisiana placement told the Department that Child “would be a good fit for the program and they would be able to keep her until she is 21 years old.” The Department reported that it had conferred with Mother and the Dell Children’s social workers and that the social workers stated that they would be able to stay involved and work closely with Mother if the Department was dismissed from the case to enable Child to qualify for placement at one of the three options. The Department stated that Child would continue to have assistance from the human trafficking advocates who would stay involved, along with “Travis County care coordination,” if the Department was dismissed. The Department stated that during the time Child was in the Department’s care she had run away over 71 times and that although the Department “works with five agencies out of state,” the Department had “exhausted all of those placement options several times throughout the case, both in state and out of state.” The Department stated that it wished to dismiss its case so that Child could continue to work with the community providers, without the Department’s involvement, since the three suitable placement options available to Child would not accept her if she was in the Department’s care. The Department stated that it was “in Child’s best interest for the Department to be dismissed and for care, custody, and control to be returned to Mother so she can pursue all of these placement options that are needed to meet Child’s therapeutic needs.” The Department also stated that Child had told all her care providers that she did not want to be in the Department’s care and wanted to return to her mother. The Department informed the court that it had met with social workers who would provide “wraparound” services for Child and that it had spoken to another organization that “would be able to do a permanency roundtable after dismissal [of the Department's case] to help support any future endeavors that Mother would need to plan out.” Counsel for Mother then addressed the court. She stated that Mother did not agree with the Department’s dismissal of its case. She stated that, under the Department’s care, Child had been in CWOP placements that she had run away from 71 times and that she was trafficked to the State of Tennessee. Mother objected to having Child returned to her care and to being “solely responsible for making sure of all of her mental health, physical, mental, emotional needs.” Counsel acknowledged that there was no placement through the Department’s contracts that would accept Child and that there was no other placement available for her. Mother’s counsel stated that Child “is not going to go to any of the three places that have been suggested by the Department” and that “at this point, Mother is reluctantly in the position to agree for Child to return home, but wants the Department to remain involved so that it can provide and secure the wraparound services that are going to be critically important for her success.” The court heard the statements of physicians involved in Child’s care who stated that Child needed to go to a sex-trafficking-specific treatment facility that could support potential substance abuse but that such a facility was difficult to find and there was a “fear that we may not be able to find a placement for her before it is time for her discharge” from Dell Children’s Hospital. At the conclusion of the hearing, the court made the following findings on the record: that during the time in which Child was in the temporary managing conservatorship of the Department, she has been reported as a runaway by the Department 71 times; while in the temporary managing conservatorship of the Department, Child experienced being trafficked across state lines; that Child has diagnoses of post-traumatic stress disorder, attention-deficit/hyperactivity disorder, major depressive disorder, cannabis use disorder, and has a historical diagnosis of disruptive mood dysregulation order, and is currently hospitalized; the Department has created circumstances that caused risk of harm, and that the Department has caused or allowed Child’s physical, mental, and emotional wellbeing to be harmed, and has allowed Child to be neglected while in the temporary managing conservatorship of the Department; the Department has exacerbated the negative long-term impact of any trauma that Child previously had and has created additional and more substantial trauma; and that it is the State’s responsibility to support the recovery of Child who was harmed, neglected, and experienced trauma while in its care. Based on these findings, the court ordered that the Department and Mother be appointed joint managing conservators of Child. Subsequently, the court signed a Final Order including the following: possession and access of Child by Mother shall be unsupervised and as agreed by the conservators in consultation with the Attorney ad Litem and Guardian ad Litem or, if the conservators could not agree, possession and access would be determined by agreement of the ad litems; ordering the Department to make timely referrals for all medical, psychological, psychiatric, therapeutic, and other services for Child; ordering the Department to maintain Child on Medicaid at all times; ordering the Department to be responsible for 100% of any costs for medical, dental, and mental health services for Child, including unreimbursed expenses; ordering the Department to reimburse Mother for any insurance co-pay or other medical, dental, and mental health expense for T.V.L. that was incurred during Child’s stay at Dell Children’s Hospital in August-September 2023; and ordering the Department to keep the parties informed of the status of the Social Security Disability application for Child and if benefits are received, provide a monthly account of those benefits to the parties. The Department perfected this appeal, arguing in seven issues that (1) the trial court erred in rendering judgment in this case rather than dismissing it upon the Department’s notice of nonsuit; (2) the trial court had no jurisdiction to render judgment in this case because it failed to commence trial before the expiration of the statutory dismissal date, see Tex. Fam. Code § 263.401; (3) the trial court erred by rendering judgment without providing the Department an opportunity to present its case in chief, call witnesses, cross-examine witnesses, or offer evidence; (4) because no evidence was presented to the court on the issue, the evidence was insufficient to support the court’s appointment of the Department as Child’s joint managing conservator nor was there any evidence to support that doing so was in Child’s best interest; (5) the trial court abused its discretion by ordering the Department to pay child or medical support because doing so violated the Texas Constitution and was barred by sovereign immunity; (6) the trial court’s order prohibiting the Department from placing Child in a CWOP location was unreasonable and unsupported by the evidence; and (7) the trial court’s findings after the non-evidentiary hearing were arbitrary, unreasonable, based on factually and legally insufficient evidence and constituted an abuse of discretion. DISCUSSION We first address the Department’s assertion that the trial court erred by rendering judgment appointing it one of Child’s joint managing conservators and ordering it to make payments and take certain actions with regard to Child rather than dismissing it after the Department notified the court that it was taking a nonsuit of its request to modify the previous conservatorship order regarding Child that was included in Mother and Father’s final decree of divorce. We note that the Texas Family Code provides that “a suit to terminate [parental rights] may not be dismissed nor may a nonsuit be taken unless the dismissal or nonsuit is approved by the court.” See Tex. Fam. Code § 161.203; Reyna v. Department of Family & Protective Servs., No. 01-05-00985, 2006 WL 1098805, at *4 (Tex. App.—Houston [1st Dist.] Apr. 27, 2006, no pet.) (mem. op.) (Texas Family Code section 161.203 vests trial court with authority to disapprove of agreement to dismiss or nonsuit Department’s suit to terminate parental rights). Here, however, the Department did not seek to terminate Mother’s parental rights to Child but, rather, to modify a conservatorship order contained in a divorce decree pursuant to Texas Family Code section 156.101. See Tex. Fam. Code § 156.101 (providing that court may modify conservatorship order if modification would be in child’s best interest). Suits to modify conservatorship orders brought under Texas Family Code chapter 156 are governed by the Texas Rules of Civil Procedure. See id. § 156.004 (“The Texas Rules of Civil Procedure applicable to the filing of an original lawsuit apply to a suit for modification under this chapter.”). The Texas Rules of Civil Procedure provide that a plaintiff may nonsuit a case “[a]t any time before the plaintiff has introduced all of his evidence other than rebuttal evidence,” so long as dismissal does not “prejudice the right of an adverse party to be heard on a pending claim for affirmative relief . . . .” Tex. R. Civ. P. 162; BHP Petroleum Co. v. Millard, 800 S.W.2d 838, 840 (Tex. 1990) (“The plaintiff’s right to take a nonsuit is unqualified and absolute as long as the defendant has not made a claim for affirmative relief.”). Granting a nonsuit is a ministerial act, and a plaintiff’s right to a nonsuit exists from the moment a written motion is filed or an oral motion is made in open court, unless the defendant has, prior to that time, sought affirmative relief and the defendant’s right to be heard on a pending claim for affirmative relief would be prejudiced. In re Greater Houston Orthopaedic Specialists, Inc., 295 S.W.3d 323, 325 (Tex. 2009) (citing Greenberg v. Brookshire, 640 S.W.2d 870, 872 (Tex. 1982) (per curiam)). “To qualify as a claim for affirmative relief, a defensive pleading must allege that the defendant has a cause of action, independent of the plaintiff’s claim, on which he could recover benefits, compensation, or relief, even though the plaintiff may abandon his cause of action or fail to establish it.” General Land Office v. OXY U.S.A., Inc., 789 S.W. 2d 569, 570 (Tex. 1990). If a party’s claim for affirmative relief is not prejudiced by the nonsuit, the plaintiff has an absolute right to the nonsuit. Id. Here, the Department sought to modify the conservatorship order to appoint the Department or a suitable competent adult recommended by the Department as Child’s managing conservator. Mother in turn requested that the court deny the relief sought by the Department, that it appoint her as the child’s managing conservator, and that it dismiss the Department and all other parties from the case. Mother, who was not a defendant in the case, sought no affirmative relief against the Department. Moreover, a nonsuit of the Department’s case would in no way prejudice Mother’s own request to modify her divorce decree and be named Child’s sole managing conservator. Thus, the Department had an absolute right to nonsuit its case, and the trial court abused its discretion by refusing to dismiss the case and, instead, rendering judgment appointing the Department Child’s joint managing conservator and ordering it to make payments and take other actions with regard to Child. We sustain the Department’s first issue.[3] CONCLUSION The trial court abused its discretion in rendering judgment appointing the Department as Child’s joint managing conservator and ordering it to make payments and take certain actions with regard to Child rather than dismissing the Department’s case after it notified the court that it was nonsuiting its request to modify the prior conservatorship order. Consequently, we vacate the trial court’s judgment, dismiss the Department’s claim seeking modification of Mother and Father’s divorce decree, and remand the case for further proceedings regarding Mother’s request to modify the conservatorship, child support, and possession provisions of her divorce decree. Thomas J. Baker, Justice Before Justices Baker, Triana, and Smith Vacated and Remanded Filed: February 29, 2024