
    The TRAVELERS INSURANCE COMPANY (The Automobile Insurance Company of Hartford Connecticut), Petitioner, v. Barry JOACHIM, Respondent.
    No. 08-0941.
    Supreme Court of Texas.
    Argued Feb. 17, 2010.
    Decided May 14, 2010.
    Rehearing Denied Aug. 27, 2010.
    
      Jeffrey B. Jones, Christopher Bradley Slayton, Jones Flygare Brown & Wharton, Lubbock, for Petitioner.
    Stace Lawrence Williams, The Stace Williams Law Firm, P.C., Lubbock, for Respondent.
   Justice GREEN

delivered the opinion of the Court.

In this procedural dispute, we must decide whether a trial court’s erroneous dismissal of a suit with prejudice, following the plaintiffs filing of a nonsuit, operates to bar a later suit because of res judicata. We conclude that it does. Therefore, we reverse the coux-t of appeals’ judgment and order the case dismissed.

I

Barry Joachim sued his insurer, The Travelers Insurance Company, alleging he was entitled to benefits from Travelers for damages caused by Joachim’s accident with an underinsured driver. On the day before trial, Joachim filed a “Notice of Non-Suit” stating that he “no longer wishes to pursue his claims against Defendants,” and therefore “gives notice to all parties that his claims against the same are hereby dismissed without prejudice.” No motions or counterclaims were pending at that time. Several months later, the trial court sent notice that if a final order was not filed within 10 days of the notice, the court would dismiss the case for want of prosecution. Joachim asserts he did not receive this notice. The trial court then entered an order that the case “is hereby dismissed in full with prejudice for want of prosecution.” Joachim claims he did not receive a copy of that order either. Unaware of the dismissal order, Joachim neither contested it while the court retained plenary power, see Tex.R. Civ. P. 329b, nor perfected an appeal.

Joachim later refiled the same cause of action, and the case was assigned to a different trial court. Travelers filed a motion for summary judgment based on res judicata. The second trial court granted Travelers’ motion and ordered that Joa-chim take nothing by his suit. Joachim appealed that judgment. The court of appeals reversed, holding that a nonsuit removes a trial court’s jurisdiction to enter a dismissal with prejudice. 279 S.W.3d 812, 817 (Tex.App.-Amarillo 2008). The court of appeals therefore determined that the first trial court’s order was void, not merely voidable. Id. at 818. Thus, it concluded that Travelers failed to establish the defense of res judicata. Id.

II

We review a trial court’s summary judgment de novo. Provident Life & Accident Ins. Co. v. Knott, 128 S.W.3d 211, 215 (Tex.2003). The party relying on the affirmative defense of res judicata must prove (1) a prior final determination on the merits by a court of competent jurisdiction; (2) identity of parties or those in privity with them; and (3) a second action based on the same claims as were or could have been raised in the first action. Amstadt v. U.S. Brass Corp., 919 S.W.2d 644, 652 (Tex.1996); see Tex.R. Civ. P. 94 (identifying res judicata as an affirmative defense). “The judgment in the first suit precludes a second action by the parties and their privies on matters actually litigated and on causes of action or defenses arising out of the same subject matter that might have been litigated in the first suit.” Gracia v. RC Cola-7-Up Bottling Co., 667 S.W.2d 517, 519 (Tex.1984). Only the first element — prior final determination on the merits — is contested in this appeal.

“At any time before the plaintiff has introduced all of his evidence other than rebuttal evidence, the plaintiff may ... take a non-suit, which shall be entered in the minutes. Notice of the ... non-suit shall be served ... on any party who has answered or who has been served with process without necessity of court order.” Tex.R. Civ. P. 162. 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. See Villafani v. Trejo, 251 S.W.3d 466, 468-69 (Tex.2008); In re Bennett, 960 S.W.2d 35, 38 (Tex.1997) (per curiam); Hooks v. Fourth Court of Appeals, 808 S.W.2d 56, 59 (Tex.1991). 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.’ ” Univ. of Tex. Med. Branch at Galveston v. Estate of Blackmon ex rel. Shultz, 195 S.W.3d 98, 100 (Tex.2006) (per curiam) (quoting Shadowbrook Apts. v. Abu-Ahmad, 783 S.W.2d 210, 211 (Tex.1990) (per curiam)). It renders the merits of the nonsuited case moot. See Villafani, 251 S.W.3d at 469 (“One unique effect of a nonsuit is that it can vitiate certain interlocutory orders, rendering them moot and unappealable.”); Shultz, 195 S.W.3d at 101 (“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 ease moot.”); Gen. Land Office v. OXY U.S.A., Inc., 789 S.W.2d 569, 571 (Tex.1990) (“As a consequence of the trial court’s granting the nonsuit, the temporary injunction ceased to exist and the appeal became moot.... It was not necessary for the trial court to enter such a separate order because when the underlying action was dismissed, the temporary injunction dissolved automatically.”) (citation omitted).

The parties agree that the first trial court’s order, which dismissed the case with prejudice, was erroneous because Joachim’s nonsuit was without prejudice to refiling. See generally Tex.R. Civ. P. 301 (“The judgment of the court shall conform to the pleadings, the nature of the case proved and the verdict, if any, and shall be so framed as to give the party all the relief to which he may be entitled either in law or equity.”). The question of whether Travelers established its res judicata defense turns on the issue of whether the trial court’s erroneous order was void, or merely voidable. “A judgment is void only when it is apparent that the court rendering judgment had no jurisdiction of the parties or property, no jurisdiction of the subject matter, no jurisdiction to enter the particular judgment, or no capacity to act.” Browning v. Prostok, 165 S.W.3d 336, 346 (Tex.2005) (internal quotation omitted). A void order is subject to collateral attaek in a new lawsuit, while a voidable order must be corrected by direct attack; unless successfully attacked, a voidable judgment becomes final. See Browning v. Placke, 698 S.W.2d 362, 363 (Tex.1985). After a non-suit, a trial court retains jurisdiction to address collateral matters, such as motions for sanctions, even when such motions are filed after the nonsuit, as well as jurisdiction over any remaining counterclaims. See Scott & White Mem’l Hosp. v. Schexnider, 940 S.W.2d 594, 596 (Tex. 1996) (per curiam) (holding that a trial court has authority to decide a motion for sanctions while it retains plenary power, even after a nonsuit is taken); Tex.R. Civ. P. 162 (“Any 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.”). We must determine, then, whether filing a nonsuit strips a trial court of jurisdiction to dismiss a case with prejudice.

We have held that an order dismissing a case with prejudice for want of prosecution, though mistaken, is merely voidable and must be attacked directly in order to prevent the order from becoming final for purposes of establishing res judicata. See El Paso Pipe & Supply Co. v. Mountain States Leasing, Inc., 617 S.W.2d 189, 190 (Tex.1981) (per curiam). That the order happens to follow a nonsuit does not make it void. Many litigants use a nonsuit as a procedural device to effectuate a settlement agreement, intentionally dismissing claims with prejudice. Indeed, in this case Joachim had taken a nonsuit with the first trial court “dismissing with prejudice all of Plaintiffs claims” against another defendant with whom Joachim had settled, before he filed the nonsuit as to Travelers. Just as the trial court has jurisdiction to enter a dismissal with prejudice upon the filing of a nonsuit to effectuate a settlement agreement, it must also have jurisdiction to enter a dismissal with prejudice in other nonsuit situations. See Wilmer-Hutchins Indep. Sch. Dist v. Sullivan, 51 S.W.3d 293, 294-95 (Tex.2001) (per curiam) (“A party cannot by his own conduct confer jurisdiction on a court when none exists otherwise.”). Such an order, even if erroneous, is not necessarily void. See Berry v. Berry, 786 S.W.2d 672, 673 (Tex.1990) (per curiam) (“Although a final judgment may be erroneous or voidable, it is not void and thus subject to collateral attack if the court had jurisdiction of the parties and the subject matter.”). Accordingly, we conclude that the trial court’s order in this case was voidable, not void. Therefore, the order was subject only to direct attack to avoid becoming a final judgment. See Placke, 698 S.W.2d at 363.

The court of appeals held that because a nonsuit renders the merits of the case moot, the second trial court lacked jurisdiction to render judgment for lack of jus-ticiability. 279 S.W.3d at 816-17. The court stated that a nonsuit “returns the litigants to the positions they occupied before the plaintiff invoked the court’s jurisdiction.” Id. at 816. This conclusion is in tension with the trial court’s authority to address proper matters after a nonsuit is entered, as the court of appeals recognized. See id. at 818 (observing that the trial court “retained the power to address the ‘collateral’ matters listed in Rule 162”); Tex.R. Civ. P. 162 (allowing the trial court to consider motions for sanctions, attorney’s fees, or other costs “pending at the time of dismissal”). In Scott & White, we explored this tension further, considering circumstances beyond those contemplated by Rule 162. See 940 S.W.2d at 596. We held that in the case of collateral motions, such as a motion for sanctions, a trial court may consider them even if they are filed after a nonsuit. See id,. In Scott & White, a medical malpractice case, only some defendants were dismissed by non-suit. See id. at 595. After the trial court granted summary judgment for the remaining defendants, all of the defendants — including the nonsuited defendants — filed a motion for sanctions under Texas Rule of Civil Procedure 13, alleging that the suit against them was groundless and brought in bad faith. See id. The trial court’s authority to consider such a motion was proper in part because it advanced well-recognized policy goals. See id. at 596-97 (“Courts impose sanctions against parties filing frivolous claims to deter similar conduct in the future and to compensate the aggrieved party by reimbursing the costs incurred in responding to baseless pleadings. Rule 162 would frustrate these purposes if it allowed a party to escape sanctions by simply nonsuiting the aggrieved party.”). Here, too, the power to dismiss a case with prejudice after a nonsuit advances an express policy, as given by the Legislature: to hold a dismissal with prejudice void because it was entered after a nonsuit would undercut the finality of many cases that were dismissed with prejudice after a nonsuit was filed because the parties settled. See Tex. Civ. Prac. & Rem.Code § 154.002 (“It is the policy of this state to encourage the peaceable resolution of disputes ... and the early settlement of pending litigation through voluntary settlement procedures.”).

In addition, the court of appeals’ conclusion that the dismissal order was void confuses the subtle differences between mootness and related justiciability concepts, such as ripeness and standing. The court of appeals cited State Bar of Texas v. Gomez, 891 S.W.2d 243, 245 (Tex.1994), for the proposition that jurisdiction depends on justiciability. 279 S.W.3d at 816. It cited Patterson v. Planned Parenthood of Houston, 971 S.W.2d 439, 442 (Tex.1998), for the proposition that a moot case lacks justiciability. 279 S.W.3d at 816. Thus, it concluded that a court lacks jurisdiction over a nonsuited case, since the merits of such a case are moot. 279 S.W.3d at 816-17. However, by concluding that a nonsuit deprives the court of jurisdiction to dismiss a case with prejudice, the court of appeals applied these cases too broadly.

In Gomez, we said: “Subject matter jurisdiction requires that the party bringing the suit have standing, that there be a live controversy between the parties, and that the case be justiciable.” 891 S.W.2d at 245. Similarly, in Patterson, we observed that “[t]he constitutional roots of justiciability doctrines such as ripeness, as well as standing and mootness, lie in the prohibition on advisory opinions, which in turn stems from the separation of powers doctrine.” 971 S.W.2d at 442. However, neither case addressed mootness in general, or a nonsuit in particular. Gomez addressed a case that lacked justiciability from the outset, as certain plaintiffs sought to compel free legal services from the State Bar of Texas, “an entity that is powerless, acting alone, to implement” a mandatory pro bono program for Texas lawyers. 891 S.W.2d at 245 (“[F]or a controversy to be justiciable, there must be a real controversy between the parties that will be actually resolved by the judicial relief sought.”). Likewise, Patterson addressed a matter that was unripe, as it was still unclear whether Planned Parenthood would be deprived of federal funds if the Texas Department of Health implemented a state law that required parental consent to dispense prescription drugs to minors. 971 S.W.2d at 444 (“Without knowing what the federal government will do, Planned Parenthood cannot show a conflict between federal and state demands or that the state’s proposed action will cause it any injury.”). Unlike those cases, which lacked justiciability from the moment of pleading, here the nonsuit extinguished what was initially a live controversy, a justiciable case between proper parties. See Shultz, 195 S.W.3d at 100; accord Williams v. Lara, 52 S.W.3d 171,184 (Tex.2000) (“If a case becomes moot, the parties lose standing to maintain their claims.”). When a court initially has jurisdiction to grant relief to resolve a live controversy between parties with proper standing, a party’s filing a nonsuit — while rendering the merits of the case moot — cannot deprive the court of its entire jurisdiction. Rather, the court must retain certain limited authority to dispose of the case following a nonsuit, and today we hold that this includes the necessary authority to enter a dismissal with prejudice.

The question remains whether the trial court’s voidable order of dismissal is suffi-dent to establish Travelers’ affirmative defense of res judicata. We conclude it is. Because Joachim failed to attack the trial court’s order directly, it became a final judgment for purposes of res judicata. Joachim alleges that he never received notice of the judgment dismissing his cause of action with prejudice. Certainly, if this is true, the lack of notice would not bind him to the effects of the first trial court’s erroneous judgment without some potential remedy. However, there is a remedy: an equitable bill of review is a direct attack on a judgment. See Tex.R. Civ. P. 329b(f) (providing that a judgment may be set aside by the trial court by bill of review for sufficient cause); McEwen v. Harrison, 162 Tex. 125, 345 S.W.2d 706, 709 (1961) (“A bill of review filed in the proper court and against proper parties is one authorized method of making a direct attack on a judgment.”); Baker v. Goldsmith, 582 S.W.2d 404, 406 (Tex.1979) (“A bill of review is an independent equitable action brought by a party to a former action seeking to set aside a judgment, which is no longer appealable or subject to motion for new trial.”); see also Levit v. Adams, 850 S.W.2d 469, 470 (Tex.1993) (per curiam) (allowing a bill of review to proceed because when a party first receives notice of a final judgment more than 90 days after the order is signed, the time limit under Texas Rule of Civil Procedure 306a(4), a bill of review is a proper method of seeking relief); Wolfe v. Grant Prideco, Inc., 53 S.W.3d 771, 775 (Tex.App.-Houston [1st Dist.] 2001, pet. denied) (reversing summary judgment dismissing a bill of review claim filed after the plaintiffs earlier case was dismissed for want of prosecution). Had the trial court set aside the judgment, either by timely motion for new trial or by bill of review, Joachim’s underlying claim would no longer be barred by res judicata, as there would no longer be a final determination on the merits. Yet, because the first trial court’s order stands, Joachim’s claim is barred. Accordingly, we reverse the court of appeals’ judgment and render judgment dismissing Joachim’s cause of action with prejudice based on Travelers’ defense of res judicata.

Ill

We hold that because a trial court has jurisdiction to enter orders dismissing a case with prejudice upon filing of a non-suit, the trial court’s order here was voidable, not void, and subject only to direct attack. Because Joachim failed to attack the trial court’s order directly, it became a final determination on the merits for purposes of res judicata. Therefore, we reverse the court of appeals’ judgment and render judgment dismissing the ease with prejudice. 
      
      . The parties agree that The Automobile Insurance Company of Hartford, Connecticut issued Joachim's policy. For convenience, however, we refer to the respondent in this case as Travelers because The Travelers Insurance Company is the entity Joachim named first in his trial court petitions.
     
      
      . Joachim's first petition included several insurance companies as defendants.
     
      
      .We have used similar language in discussing a dismissal. See Crofts v. Court, of Civil Appeals, 362 S.W.2d 101, 104 (Tex.1962) (“It is elementary that a dismissal is in no way an adjudication of the rights of parties; it merely places the parties in the position that they were in before the court’s jurisdiction was invoked just as if the suit had never been brought.”). However, Crofts did not involve a nonsuit. The court in Crofts dismissed a divorce petition, while a related suit was pending in Maryland. See id. at 103. Crofts held that a trial court could not be ordered by writ of mandamus to give possession of children to a mother after the trial court had dismissed the case. See id. at 104-05. Even if the circumstances of that dismissal could be considered analogous to a nonsuit, however, we do not read the Crofts language so strictly as to deprive the trial court of all authority after it dismisses a case — or after it should dismiss a case, as in a typical nonsuit scenario.
     
      
      .In Scott & White, our holding was limited to the situation where the trial court granted a collateral motion for sanctions during the period when it retained plenary power. See 940 S.W.2d at 596. In this case, however, the trial court’s plenary power is not at issue because after Joachim filed his nonsuit, tire record shows that the trial court never entered a judgment until it entered its dismissal with prejudice. See Tex.R. Civ. P. 329b(d) (“The trial court, regardless of whether an appeal has been perfected, has plenary power to grant a new trial or to vacate, modify, correct, or reform the judgment within thirty days after the judgment is signed.”); Shultz, 195 S.W.3d at 100 (observing that although a nonsuit is effective upon its filing, expiration of plenary power is determined from the date on which a trial court signs an order dismissing the suit).
     
      
      . We note that none of Joachim's allegations in the trial court, even when construed liberally, can plausibly be considered as being in the nature of a claim for bill of review or similar relief.
     
      
      . The United States Supreme Court recently observed, for instance, that comparable relief under Federal Rule of Civil Procedure 60(b)(4) (relief from a final judgment that is void) "applies only in the rare instance where a judgment is premised either on a certain type of jurisdictional error or on a violation of due process that deprives a party of notice or the opportunity to be heard.” United Student Aid Funds, Inc. v. Espinosa, 559 U.S. -, -, 130 S.Ct. 1367, 1377, 176 L.Ed.2d 158 (2010). Here, however, although Joachim mentions his lack of notice, Joachim asserted only jurisdictional error as a legal argument.
     
      
      .We offer no opinion as to whether Joachim might have succeeded in having the trial court set aside its judgment by pursuing an equitable bill of review or any other remedy in the trial court.
     