OPINION This mandamus proceeding arises out of a suit brought in 2018 by Relator, Fort Bend Independent School District (FBISD), under Texas Health & Safety Code chapter 711. The underlying proceeding sought judicial approval under section 711.010 of the Code to remove the dedication of an abandoned prison farm cemetery found during construction of a vocational school on property FBISD owns and to move human remains found there to a nearby municipal cemetery pursuant to an agreement reached by FBISD and the City of Sugar Land (the City), which owns and maintains the municipal cemetery, after months of input from a community task force of interested persons, the Texas Historical Commission (THC) and the Fort Bend County Historical Commission (FBCHC). At a hearing held in November 2018, the respondent district court[1] refused to approve the agreement as being in the public interest, as required by section 711.010. Instead, it appointed sua sponte a Master in Chancery, local attorney Michael W. Elliott, pursuant to Texas Rule of Civil Procedure 171, to oversee all proceedings. The district court’s order appointing the Master specifically authorize[d the Master] to work with the parties and other interested persons to assist in the investigation, to assist in the legal discovery in the case and to assist in the promulgation of options and potential resolution options for the Court to consider in the case in the form of an ultimate Written Report to the Court concerning the potential resolution options for the Court to Consider. The trial court also ordered “[t]he parties and their agents and/or employees and/or designees . . . to allow [the Master] access to the property and/or individuals with knowledge and/or information relevant to the case, but also to non-privileged documents and/or evidence in the case as appropriate.” And it ordered the parties “to cooperate with [the Master] to assist him in his Court Assigned Duties in the Case.” In December 2018, FBISD filed a petition for writ of mandamus in this Court, seeking to compel the trial court to vacate its order appointing the Master in Chancery. The petition for mandamus presented a single issue: whether the trial court abused its discretion in appointing the Master and granting him sweeping powers. FBISD argued that the order failed to meet the “exceptional case” and “good cause” criteria for appointment of a master under Rule 171 and that the powers granted the Master by the district court’s order far exceeded the statutory authority of a master and of the trial court itself and were improper. On June 10, 2019, while FBISD’s mandamus petition was still pending in the underlying action, the Governor signed a bill amending several sections of Health & Safety Code chapter 711. The Act amending the statute provides that “[t]he changes in law made by this Act apply only to a suit involving the removal of remains from an abandoned, unknown, or unverified cemetery pending in a trial court on the effective date of this Act or filed on or after that date.” Act of May 22, 2019, 86th Leg., R.S., ch. 817, § 4, 2019 Tex. Sess. Law Serv. 2275, 2276. Suits “involving the removal of remains from an abandoned, unknown, or unverified cemetery” in which a final order was rendered before the effective date of the Act continue to be governed by the law in effect on the date the order was rendered, and the prior law was continued in effect for that purpose. Id. No final order was entered in these proceedings before the effective date of the amendments to chapter 711. Accordingly, the Act as amended applies to these mandamus proceedings and any subsequently filed proceedings. On June 13, 2019, three days after the amendments to chapter 711 took effect, the Master in Chancery filed a letter brief in this mandamus proceeding informing this Court that FBISD’s petition for mandamus seeking to vacate the order appointing the Master was moot due to the expansion of powers granted to the trial court by the amendments to chapter 711. These included an amendment to subsection 711.010(c) that permits the trial court to “designate or appoint any person, party, court appointed representative, or official the court considers necessary to assist in determining whether the removal is in the public interest.” See Act of May 22, 2019, 86th Leg., R.S., ch. 817, § 2, sec. 711.010(c), 2019 Tex. Sess. Law Serv. 2275, 2275 (to be codified at Tex. Health & Safety Code Ann. § 711.010(c)). On July 25, 2019, FBISD filed a notice of nonsuit of the underlying proceeding, stating that it no longer sought to remove the cemetery dedication. The next day, the trial court, instead of entering an order dismissing the underlying proceeding, entered an order appointing Scott West as Guardian ad Litem “for the rights, interests and dignity of the 95 bodies” found in the cemetery on FBISD’s property. The trial court then issued an order “re-appointing” Elliott as a Master in Chancery. On August 5 and 7, FBISD filed two supplemental mandamus petitions in this Court seeking to compel the trial court to vacate these orders and to dismiss the underlying proceeding pursuant to FBISD’s nonsuit. We agree with FBISD that its filing of its nonsuit of the underlying suit to remove the cemetery dedication mooted all proceedings pending in the underlying suit in the trial court except as to the assessment of court costs. Accordingly, the trial court lost jurisdiction to act on the merits of the proceeding. We hold that the nonsuit moots FBISD’s original mandamus petition challenging the November 2018 appointment of the Master, and we therefore dismiss the original mandamus petition. We further hold that the trial court’s appointment of the Guardian ad Litem and reappointment of the Master are both ineffective because these appointments occurred after FBISD nonsuited the underlying proceeding. We therefore conditionally grant FBISD’s two supplemental mandamus petitions and order that the trial court vacate these two orders. Background A. Discovery of Abandoned Cemetery on FBISD’s Property and Petition to Disinter Human Remains On February 19, 2018, FBISD’s contractors discovered bones during construction of a vocational high school on property FBISD owns at 12300 University Boulevard, Sugar Land, Fort Bend County. FBISD stopped construction and, after contacting consultants, the medical examiner, and the THC, it confirmed that samples were human, and it filed the statutorily-required notice of discovery of cemetery. See Tex. Health & Safety Code Ann. § 711.011 (requiring person who discovers unknown or abandoned cemetery to file notice of discovery of cemetery with county clerk). On June 5, 2018, the trial court granted FBISD’s request under subsection 711.004(c) to exhume the remains for further investigation. The investigation concluded that there were ninety-five graves on the property and that the remains were likely from male African-American prisoners who were part of the state’s convict-leasing program from the 1870s through 1911. The State had previously operated the Imperial Prison Farm Camp Number 1 on the property. In the several months after the discovery of the abandoned cemetery, FBISD made reasonable efforts to identify the human remains found in the abandoned cemetery on its property and attempted unsuccessfully to identify next of kin. It also met several times with a citizens’ community task force that included the City and both the THC and the FBCHC to discuss how to handle the exhumed human remains, now referred to as the “Sugar Land 95.” Ultimately, they agreed to move the remains to the nearby Imperial Prison Farm Cemetery, owned and maintained by the City on an adjacent tract of land, and FBISD and the City signed an agreement to that effect. B. FBISD’s November 2018 Suit to Remove Dedication of Cemetery and to Disinter, Remove, and Rebury Remains On November 7, 2018, FBISD filed a one-party petition, as required under Health & Safety Code sections 711.004 and 711.010, to request judicial approval to remove the cemetery dedication from the abandoned prison farm cemetery and to move the remains in accordance with its agreement with the City. See id. § 711.004(c) (providing that if written consent to remove remains cannot be obtained from statutorily-prescribed list of persons, remains may be removed by permission of district court in county where cemetery is located); id. § 711.010(b) (providing that on petition of property owner, district court may order removal of cemetery dedication if court finds that removal of dedication is in public interest). However, at the hearing on FBISD’s petition, held on November 19, 2018, the trial court refused to approve FBISD’s request to remove the cemetery dedication and to move the human remains found there to the Imperial Prison Farm Cemetery as being in the public interest. Instead, it sua sponte signed an “Order of Reference Appointing Master in Chancery” (the November 2018 Order). This order, issued pursuant to Texas Rule of Civil Procedure 171, appointed Michael W. Elliott, a local attorney not otherwise involved in the case, as Master to assist the “parties” and “other interested persons” in “handling the case” by, among other things, overseeing investigation and discovery in this case and presenting “resolution options” to the court. The November 2018 Order stated: After receiving testimony and arguments from FBISD and many other interested individuals and agencies, it is apparent to the Court and the Court hereby finds that this case is in legal terms of Rule 171 of the Texas Rules of [Civil] Procedure an “Exceptional case” that can greatly benefit from the Assistance of an independent Master in Chancery who has some legal and specialized expertise in real estate law, mediation and civil litigation issues to assist the Court and the parties in handling the case as directed by the Court, to work with the parties and other interested persons to assist in the investigation, to assist in the legal discovery in the case and to assist in the promulgation of options and potential resolution options for the Court to consider in the case. As outlined to the Court by the pleadings, party(ies) and other interested parties, the subject matter of this litigation involves the substantial and personal rights of what will most likely be in excess of one hundred (100) individuals, families and other interested persons and/or entities that may well be of a significant historical value and must therefore be handled with a great deal of care, compassion and thoughtfulness to the deceased and all parties and interested people involved. THEREFORE, pursuant to Texas Rule of [Civil] Procedure 171, IT IS THE ORDER OF THE COURT that Fort Bend County, Texas Resident and Licensed Texas Attorney, Michael W. Elliott . . . is HEREBY APPOINTED by the Court as a Master in Chancery in this Cause of Action. Pursuant to [Rule] 171 of the Civil Rules of Procedure, it is further found that Michael W. Elliott is not currently an attorney for any parties in this case, nor is he related to either party. Lastly, the Court finds that Michael W. Elliott possesses legal and specialized expertise and employment background in [the] real estate title industry, has experience and expertise in the real estate law, is well versed and experienced in dealing with real estate and general civil litigation as well is versed and experienced with the mediation and case amicable settlement process and is therefore especially qualified to assist the Court with this important and complex case and that constitutes a sufficiently exceptional condition to justify his appointment. IT IS THE ORDER OF THE COURT that this reference and appointment of Michael W. Elliott, shall specifically authorize him to work with the parties and other interested persons to assist in the investigation, to assist in the legal discovery in the case and to assist in the promulgation of options and potential resolution options for the Court to consider in the case in the form of an ultimate Written Report to the Court concerning the potential resolution options for the Court to Consider. The parties and their agents and/or employees and/or designees are hereby ORDERED to allow Michael W. Elliott access to the property and/or individuals with knowledge and/or information relevant to the case, but also to non-privileged documents and/or evidence in the case as appropriate. The parties are also ORDERED to cooperate with Michael W. Elliott to assist him in his Court Assigned Duties in the Case. This Court reserves the right from time to time to amend and/or supplement the Masters in Chancery’s powers and duties in this case as the Court may deem reasonable and necessary under the circumstances. The Fee for the Special Master in Chancery for Michael W. Elliott will be paid for by the Fort Bend County as in other Court appointed cases subject to being reimbursed by the parties as cost[s] of court as apportioned by the Court and/or by direct payment by the Parties to Michael W. Elliott as the Court may subsequently Apportion and /Order as may [be] appropriate at the time. On November 30, 2018, FBISD filed an objection to the Order appointing Elliott as Master in Chancery and an objection to the Master’s status report contemplated in the trial court’s order. On December 18, 2018, the trial court held a status hearing and allowed both FBISD and the Master to appear and argue. FBISD argued, in objection to the court’s November 2018 Order appointing the Master, that the case did not meet the requirement of Rule 171, governing the appointment of masters, that the case must be “exceptional”; that the court failed to include a finding of “good cause” in the November 2018 Order, as required by Rule 171; that it was impermissible for the court to appoint as a Master “another lawyer to provide additional legal guidance” in that “the order essentially vests the Master in Chancery with the status of party”; and that the Texas Legislature, in the statutes relating to abandoned cemeteries, had “strictly defined who can be a party to the action,” namely, “the landowner who files [the] petition, known [descendants] of anyone who is buried in the cemetery, and upon intervention the Texas Historical Commission or County Historical Commission.” FBISD further argued, “There are no known [descendants] of the persons buried in the cemetery discovered on [FBISD]‘s property, and to date neither of the two commissions have intervened.” Therefore, there was only one party to the petition—FBISD—and the court’s November 2018 Order appointing and empowering the Master had “created a party that the statute doesn’t contemplate.” FBISD pointed out that the Master was seeking permission to conduct discovery from FBISD, which FBISD characterized as a function of a party “foreclosed by the statute” that also “violates the Texas Supreme Court’s clear restrictions on the use of a Master in Chancery.” FBISD also objected to the delays caused by the appointment of the Master and the trial court’s failure to rule on FBISD’s petition, which, it stated, had prevented the reinterment of the “95 human remains sitting in trailers,” caused “very real and very significant contractual delay costs . . . of about $180,000 a month,” and forced the “redesign [of] certain life safety components of the project and the expenses that are going to total about 7 million additional dollars that we are not budgeted.” FBISD characterized these factors as relating to the public interest determination the court was required to make in the proceeding under Health & Safety Code section 711.010. The Master defended his role, which he stated was “to help this Court conduct its inquiries and get information before the Court, and . . . [follow] the Court’s order and assisting in every way that [he] can.” The Master then summarized his actions, which included reviewing the filings, reports, and chronicles; giving information about the procedures to numerous groups and persons in meetings; corresponding with numerous individuals, including personnel with the state and local historical commissions, the Fort Bend County Attorney and his staff, and FBISD lawyers; and preparing his report to the trial court giving his legal analysis of the applicable statutes. The Master then reported on his conclusions, including his conclusions as to what the relevant statutes required and his conclusion that it might be possible to identify descendants of the deceased individuals. The trial court overruled FBISD’s objections. The court stated that, because there was only one party to the proceeding, “I’m trying to do the best I can with what I think the legislature intended.” The court was worried “that [FBISD is] concerned about having other people engaged in this process,” and it announced its intention to make “certain that the appropriate folks [are] engaged in the process.” The court encouraged those present who thought they had an interest that should be represented in the proceeding “to talk together, talk with an attorney, talk to the Master in Chancery about your desire to be part of it, if you do, so that we’ll know who ought to be part of it.” C. FBISD’s December 2018 Mandamus Petition Seeking to Vacate the Trial Court’s Order Appointing the Master That same day, December 18, 2018, FBISD filed this mandamus petition asking this Court to vacate the November 2018 Order on the basis that the trial court had abused its discretion by appointing the Master in Chancery and that there was no adequate appellate remedy from such an order. FBISD made the following arguments: (1) while the trial court found this case to be “exceptional,” it abused its discretion by failing to make the “good cause” finding required by Rule 171, and (2) the trial court abused its discretion by appointing a Master who did not possess special expertise not already possessed by the court, by appointing a Master to act as an advocate, and by improperly issuing a blanket referral of all matters to the Master. FBISD further argued that the members of the public for whom the trial court appointed the Master to act as advocate could not allege any injury distinct from the general public’s interest and therefore lacked standing, so that the trial court lacked subject matter jurisdiction to hear their positions. On January 9, 2019, the Master in Chancery, Elliott, filed a response as the real party in interest. The Master argued that the trial court’s Order had found that this case was exceptional and that it had implicitly found good cause to appoint him as Master. On January 14, 2019, FBISD filed a reply contending that: (1) the good-cause finding was not a formality and could not be inferred; (2) the Master could not act as a balance to FBISD’s position without becoming an adversary; (3) neither the court nor the Master could conduct genealogical investigations contemplated by the appointment; and (4) the Master’s real estate title experience, cited by the trial court in its appointment order, was immaterial to the legal questions regarding removing a cemetery designation. D. The June 10, 2019 Amendments to Chapter 711, FBISD’s July 25, 2019 Nonsuit, the Trial Court’s Continued Issuance of Orders, and FBISD’s Supplemental Petitions for Mandamus On June 10, 2019, while FBISD’s mandamus petition seeking to vacate the trial court’s November 2018 Order appointing the Master in Chancery under Rule 171 was still pending in this Court, the Governor signed the Act enacted by the Texas Legislature amending various sections of Health & Safety Code chapter 711 applicable to the removal of a cemetery dedication and the removal of human remains found therein. The amended statutes became effective immediately. One of the amendments allows the trial court to “designate or appoint any person, party, court appointed representative, or official the court considers necessary to assist in determining whether the removal [of a cemetery dedication] is in the public interest.” See Act of May 22, 2019, 86th Leg., R.S., ch. 817, § 2. On July 25, 2019, FBISD filed a notice of nonsuit of the underlying proceedings. The notice stated: “Because petitioner [FBISD] no longer seeks to remove the cemetery designation from the abandoned and unverified historical cemetery located on its property, it no longer has [a] basis to pursue this action.” It announced its intention to rebury the remains in their original location and to suitably commemorate their memory. The next day, July 26, 2019, the trial court entered an order appointing Scott West, a local attorney, as Guardian ad Litem “for the rights, interests and dignity of the 95 bodies found on property owned by” FBISD. This order stated that the guardian ad litem is “ORDERED to take such action as she/he deems necessary to preserve and protect the interests of the 95 bodies in these and related proceedings.” The order also provided that the guardian ad litem shall be entitled to a “reasonable fee” for his services, to be taxed as costs of court. FBISD filed with this Court a supplemental mandamus petition seeking to vacate the trial court’s order appointing the guardian ad litem. FBISD argues that the trial court’s appointment of a guardian ad litem was not authorized by Texas Rule of Civil Procedure 173, which generally governs the appointment of a guardian ad litem, or by any other rule or statute. FBISD also argues that the appointment order is void because it occurred after FBISD exercised its right to nonsuit the underlying proceedings. FBISD requests that this Court issue a writ of mandamus directing the trial court to vacate the order appointing West as Guardian ad Litem and to enter an order dismissing the underlying proceedings pursuant to the nonsuit. At FBISD’s request, on August 6, 2019, this Court issued an order staying the trial court’s order appointing the Guardian ad Litem. That same day, the trial court issued an order reappointing Elliott as Master in Chancery. Most of this reappointment order was identical to the trial court’s November 19, 2018 order initially appointing Elliot as Master, which is set out earlier in this opinion. The reappointment order did, however, include the following new language: Additionally, the Court recognizes as additional authority for this appointment, the Texas legislature has clarified and amended this Court[']s authority to appoint Section 711.010 of the Texas Health & Safety Code to specifically authorize the Court to “designate or appoint any person, party, court appointed representative, or official the court considers necessary to assist in determining whether the removal is in the public interest.” The amendment to Section 711.010(c) was signed into law on June 10, 2019 and was effective immediately as law. …. Lastly, the Court is aware of an attempted Non-Suit in this case filed by [FBISD] in this case, filed on or about July 25, 2019, however, that attempted/partial nonsuit does not in the Court’s opinion, resolve of all parties and/or open issues and many conflicts [are] still open and present in the case, including but not limited to handling and enforcing and the Open, Active and Un-Resolved Court’s Temporary Orders controlling the current status and keeping of the ninety-five [souls] that have been dug-up and [temporarily] stored in a storage container on the property by [FBISD] pending further Orders of the Court, the location and identification of legal Descendants of the ninety-five [souls], as well as cost, fees and other important open conflicts and live issues before the Court of re-internment direction(s) and/or authority to re- internment of the 95 [souls] in the case in a peaceful and dignified manner in the best interest of the public as the Health & Safety Code and public decency requires. …. This appointment does not authorize Mr. Elliott to make any legal Rulings in the Case which is solely reserved for the Court but specifically authorizes [Elliott] to facilitate the evidence and witness gathering and coordinating for the orderly presentation of the Court. . . . FBISD then filed a second supplemental mandamus petition, seeking to vacate the trial court’s order reappointing Elliott as Master in Chancery and seeking dismissal of the underlying proceedings pursuant to its nonsuit. FBISD argues that its nonsuit rendered the merits of its case moot. It argues that it was the only party to the underlying proceeding and, therefore, there were no claims for affirmative relief by an adverse party that survived its nonsuit. FBISD argues that mandamus relief is proper because the trial court had a ministerial duty to dismiss the case after its nonsuit, but the trial court did not do so. This Court stayed all underlying proceedings. We now address the effect of FBISD’s nonsuit on its original mandamus petition and its two supplemental mandamus petitions. Mandamus Standard of Review Mandamus is an extraordinary remedy, available only when the relator can show that: (1) the trial court clearly abused its discretion or violated a duty imposed by law; and (2) there is no adequate remedy by way of appeal. In re Ford Motor Co., 165 S.W.3d 315, 317 (Tex. 2005) (orig. proceeding) (per curiam); Walker v. Packer, 827 S.W.2d 833, 839-40 (Tex. 1992) (orig. proceeding). A trial court abuses its discretion if it acts arbitrarily, unreasonably, or without regard to guiding legal principles. In re J.B. Hunt Tramp., Inc., 492 S.W.3d 287, 293-94 (Tex. 2016) (orig. proceeding) (quoting Bocquet v. Herring, 972 S.W.2d 19, 21 (Tex. 1998)). A trial court has no discretion in determining what the law is or in applying the law to the facts. Id. at 294 (citing Walker, 827 S.W.2d at 840). Thus, the trial court’s failure to analyze or apply the law correctly constitutes an abuse of discretion. In re Nationwide Ins. Co. of Am., 494 S.W.3d 708, 712 (Tex. 2016) (orig. proceeding). Effect of FBISD’s Nonsuit Texas Rule of Civil Procedure 162 provides that “[a]t any time before the plaintiff has introduced all of his evidence other than rebuttal evidence, the plaintiff may dismiss a case, or take a non-suit, which shall be entered in the minutes.” Tex. R. Civ. P. 162. Rule 162 also provides that “[a]ny dismissal pursuant to this rule shall not prejudice the right of an adverse party to be heard on a pending claim for affirmative relief or excuse the payment of all costs taxed by the clerk” and that “[a] dismissal under this rule shall have no effect on any motion for sanctions, attorney’s fees or other costs, pending at the time of dismissal, as determined by the court.” Id. Further, a dismissal under Rule 162 that “terminates the case shall authorize the clerk to tax court costs against dismissing [the] dismissing party unless otherwise ordered by the court.” Id. A party has an absolute right to file a nonsuit, and a trial court is without discretion to refuse an order dismissing a case because of a nonsuit unless collateral matters remain. Travelers Ins. Co. v. Joachim., 315 S.W.3d 860, 862 (Tex. 2010). “The plaintiff’s right to take a nonsuit is unqualified and absolute so long as the defendant has not made a claim for affirmative relief.” In re Greater Houston Orthopaedic Specialists, Inc., 295 S.W.3d 323, 324 (Tex. 2009) (orig. proceeding) (per curiam) (quoting BHP Petroleum Co. v. Millard, 800 S.W.2d 838, 840 (Tex. 1990)). A nonsuit “extinguishes a case or controversy from the moment the motion is filed or an oral motion is made in open court; the only requirement is the mere filing of the motion with the clerk of the court.” Travelers Ins., 315 S.W.3d at 862 (quoting Univ. of Tex. Med. Branch at Galveston v. Estate of Blackmon ex rel. Shultz, 195 S.W.3d 98, 100 (Tex. 2006) (per curiam)). A nonsuit renders the merits of the case moot. Id.; In re Bennett, 960 S.W.2d 35, 38 (Tex. 1997) (orig. proceeding) (per curiam) (“Such a nonsuit may have the effect of vitiating earlier interlocutory orders and of precluding further action by the trial court, with some notable exceptions.”). A nonsuit does not affect any pending claim for affirmative relief by an adverse party, nor does it affect collateral matters such as motions for sanctions, attorney’s fees, or costs. Epps v. Fowler, 351 S.W.3d 862, 868 (Tex. 2011); Travelers Ins., 315 S.W.3d at 862; see also In re Midland Funding, LLC, 527 S.W.3d 296, 299 (Tex. App.—El Paso 2016, orig. proceeding) (“Although Rule 162 permits motions for costs, attorney’s fees, and sanctions to remain viable in the trial court, it does not forestall the nonsuit’s effect of rendering the merits of the case moot.”). When a plaintiff is entitled to a nonsuit, the trial court’s dismissal order is ministerial. Klein v. Hernandez, 315 S.W.3d 1, 4 (Tex. 2010); In re Greater Houston Orthopaedic Specialists, 295 S.W.3d at 325. “Mandamus relief is appropriate when a trial judge refuses to grant a nonsuit in the absence of a pending claim for affirmative relief.” In re Greater Houston Orthopaedic Specialists, 295 S.W.3d at 326; In re Midland Funding, 527 S.W.3d at 299; see also Greenberg v. Brookshire, 640 S.W.2d 870, 872 (Tex. 1982) (orig. proceeding) (per curiam) (granting mandamus relief and vacating trial court order entered after plaintiff filed notice of nonsuit). On July 25, 2019, FBISD filed a notice of nonsuit of its petition to remove the human remains of the Sugar Land 95 from the abandoned cemetery found on its property, to rebury them in the nearby Imperial Prison Farm Cemetery, and to remove the cemetery dedication from the abandoned cemetery. The nonsuit stated, “Because petitioner [FBISD] no longer seeks to remove the cemetery designation from the abandoned and unverified historical cemetery located on its property, it no longer has basis to pursue this action.” The mandamus record reflects that, at the time FBISD filed its notice of nonsuit on July 25, 2019, no person or entity—such as the THC or the FBCHC—had intervened, FBISD was the only party to the proceeding, no adverse party existed, and thus no adverse party had sought affirmative relief. As of July 25, 2019, no trial had been held on its petition. Rather, the trial court had refused to rule on FBISD’s petition following the November 2018 hearing and had, instead, appointed a Master in Chancery with broad powers in contemplation of additional discovery, the naming of unknown parties in addition to FBISD—the sole party before the court—and additional proceedings. We hold that FBISD had an absolute right to take a nonsuit on its petition See Travelers Ins., 315 S.W.3d at 862; In re Greater Houston Orthopaedic Specialists, 295 S.W.3d at 324. FBISD’s original mandamus petition challenges the validity of the trial court’s November 2018 appointment of the Master in the now nonsuited underlying proceeding. FBISD filed its nonsuit on July 25, 2019, which had the effect of extinguishing the underlying proceeding and rendering the merits of that proceeding moot. We thus conclude that FBISD’s original mandamus petition, challenging an appointment made in a controversy that is no longer live, was rendered moot by FBISD’s nonsuit. See Heckman v. Williamson Cty., 369 S.W.3d 137, 162 (Tex. 2012) (stating that court cannot “decide a case that has become moot during the pendency of the litigation”); Nat’l Coll. Athletic Ass’n v. Jones, 1 S.W.3d 83, 86 (Tex. 1999) (stating that appellate courts are “prohibited from deciding moot controversies” and that “[a] case becomes moot if at any stage there ceases to be an actual controversy between the parties”). We therefore dismiss FBISD’s original mandamus petition as moot. As no parties with interests adverse to FBISD had intervened or been named by the trial court as additional parties at the time of FBISD’s nonsuit, even under the expanded powers accorded the court by the June 10, 2019 amendments to chapter 711, the nonsuit was effective from the moment it was filed under the plain language of Rule 162 and controlling case law, and the trial court had a ministerial duty to dismiss the suit. See Tex. R. Civ. P. 162; Klein, 315 S.W.3d at 4. Instead, the trial court continued to exercise jurisdiction over the merits of the suit and to make appointments of a guardian ad litem and master in chancery it had lost the authority to make, there being no underlying suit on the merits over which it retained jurisdiction after FBISD’s nonsuit on July 25, 2019. See Travelers Ins., 315 S.W.3d at 862 (stating that nonsuit “extinguishes a case or controversy from the moment the motion is filed” and renders merits of case moot). As there was no pending case or controversy after July 25, 2019, the trial court abused its discretion in failing to perform its ministerial duty to dismiss the suit, and its actions of appointing the Guardian ad Litem and reappointing the Master in Chancery are ineffective as being taken when the trial court was without jurisdiction over the merits of the suit. FBISD’s supplemental mandamus petitions address the trial court’s appointment of the Guardian ad Litem on July 26, 2019, and its reappointment of the Master on August 6, 2019—actions taken after FBISD had nonsuited the underlying proceeding. As we have stated, the trial court had a ministerial duty to dismiss the underlying proceeding upon FBISD’s nonsuit. Because it did not do so, but instead continuing issuing orders after FBISD’s nonsuit extinguished the underlying controversy, the trial court abused its discretion in entering the orders appointing the Guardian ad Litem and reappointing the Master, and FBISD is entitled to mandamus relief on its supplemental mandamus petitions.[2] See Klein, 315 S.W.3d at 4; In re Greater Houston Orthopaedic Specialists, 295 S.W.3d at 326; In re Midland Funding, 527 S.W.3d at 299. Conclusion We dismiss FBISD’s original mandamus petition as moot, and we conditionally grant FBISD’s two supplemental petitions for mandamus relief. We lift the stay orders imposed by this Court on December 20, 2018, August 6, 2019, and August 8, 2019, and direct the trial court to vacate its July 26, 2019 order appointing the Guardian ad Litem and its August 6, 2019 order reappointing the Master in Chancery and to issue an order dismissing the underlying proceeding. We are confident the trial court will promptly comply. Accordingly, our writ will issue only if the trial court does not comply within thirty days of the date of this opinion. All pending motions are dismissed as moot. Evelyn V. Keyes Justice Panel consists of Chief Justice Radack and Justices Keyes and Landau.