
263 P.3d 224 (2011)
Phillip EMERSON, Petitioner,
v.
The EIGHTH JUDICIAL DISTRICT COURT OF the STATE of Nevada, in and for the COUNTY OF CLARK, and the Honorable Douglas Herndon, District Judge, Respondents, and
Gregory J. Lioce and Farmers Insurance Exchange, Real Parties in Interest.
No. 55238.
Supreme Court of Nevada.
October 6, 2011.
*225 Lemons, Grundy & Eisenberg and Robert Eisenberg, Reno; Emerson & Manke, PLLC, and Phillip R. Emerson, Henderson, for Petitioner.
Coleman Law Associates and Edward S. Coleman, Las Vegas, for Real Party in Interest Gregory J. Lioce.
*226 Before SAITTA, C.J., HARDESTY and PARRAGUIRRE, JJ.

OPINION
By the Court, HARDESTY, J.:
In this petition for extraordinary writ relief, we consider whether the district court can impose sanctions after it enters an order dismissing a case with prejudice pursuant to a stipulation of the parties under NRCP 41(a)(1)(ii). In resolving this issue, we initially address whether the district court has jurisdiction to impose sanctions after a stipulated dismissal. We conclude that the district court retains jurisdiction after a case is dismissed to consider sanctions for attorney misconduct that occurred prior to the dismissal. Next, we address whether the district court may impose as a sanction attorney fees and costs incurred in the original trial when a new trial is ordered. We conclude that the district court did not abuse its discretion by imposing as a sanction attorney fees and costs incurred in the original trial. We, therefore, deny writ relief.

FACTS
This matter arose out of a multivehicle traffic accident, which led to a dispute over who was at fault for the incident. See Lioce v. Cohen, 124 Nev. 1, 9, 174 P.3d 970, 975-76 (2008). The plaintiff, Gregory Lioce, sued three defendants, Dana Cohen; her spouse, Morry Cohen; and John Wilson. Id. at 9, 174 P.3d at 975. At trial, Wilson's attorney, petitioner Phillip Emerson, made a series of statements to the jury that this court later deemed improper.[1]Id. at 9-10, 20, 174 P.3d at 975-76, 982. The jury eventually found for the defendants. Id. at 10, 174 P.3d at 976. As a result of Emerson's comments, Lioce moved for a directed verdict or a new trial, but the district court denied both motions. Id. Lioce challenged the denial of both motions before this court, and we ultimately concluded that Emerson's comments were improper and amounted to impermissible jury nullification because they reflected his "personal opinion about the justness of [the plaintiffs] cause[]." Id. at 21-22, 174 P.3d at 983-84 (citing RPC 3.4(e)). We then vacated the order denying a new trial and remanded the Lioce matter to the district court with instructions.
On remand, the district court determined that a new trial as to defendants Dana and Morry Cohen was not warranted. However, the district court found that Lioce was entitled to a new trial against defendant Wilson because "the verdict in favor of Wilson would have been different but for the misconduct of [Emerson]."
After the district court granted Lioce's motion for a new trial as to Wilson, Lioce filed a motion for sanctions based on Emerson's misconduct. In the motion, he did not request a specified amount of attorney fees or costs; instead, he contended that the district court should award attorney fees and costs as sanctions "to make up for the immense amounts of additional expense Emerson has caused."
At a hearing on the motion on July 22, 2009, the district court orally indicated its intent to grant sanctions in the amount of fees and costs "only as to the first trial." On August 19, 2009, the parties filed a stipulation and order dismissing the matter with prejudice, and the district court entered its order regarding the same on August 24, 2009. The parties did not address the pending motion for sanctions in their stipulation. On September 11, 2009, the district court entered an order granting Lioce's motion and imposing $19,330 in sanctions on Emerson, personally. The district court selected this amount based on a declaration submitted by Lioce's counsel, which indicated various costs and attorney fees incurred during the original trial, including the time counsel spent in trial and the cost of an expert witness who testified.
Emerson then filed a motion for reconsideration, arguing that the district court improperly imposed sanctions against him. However, he did not raise the issue of whether *227 the district court retained jurisdiction to consider the motion for sanctions after the case had been dismissed pursuant to the parties' stipulation. The district court denied the motion for reconsideration, after which Emerson petitioned this court for writ relief, requesting that we issue a writ directing the district court to vacate its order imposing sanctions.

DISCUSSION
"A writ of prohibition `serves to stop a district court from carrying on its judicial functions when it is acting outside its jurisdiction.'" Stephens Media v. Dist. Ct., 125 Nev. ___, ___, 221 P.3d 1240, 1246 (2009) (quoting Sonia F. v. Dist. Ct., 125 Nev. 38, ___, 215 P.3d 705, 707 (2009)); see also NRS 34.320. "`A writ of mandamus is available to compel the performance of an act that the law requires as a duty resulting from an office, trust, or station or to control an arbitrary or capricious exercise of discretion.'" Williams v. Dist. Ct., 127 Nev. ___, ___, ___ P.3d ___, ___ (2011) (quoting International Game Tech. v. Dist. Ct., 124 Nev. 193, 197, 179 P.3d 556, 558 (2007)); see also NRS 34.160. A writ will not issue if the "`petitioner has a plain, speedy, and adequate remedy in the ordinary course of law,'" Williams, 127 Nev. at ___, ___ P.3d at ___ (quoting Mineral County v. State, Dep't of Conserv., 117 Nev. 235, 243, 20 P.3d 800, 805 (2001)); see also NRS 34.170; NRS 34.330, and "[m]andamus will not lie to control discretionary action, unless discretion is manifestly abused or is exercised arbitrarily or capriciously," Round Hill Gen. Imp. Dist. v. Newman, 97 Nev. 601, 603-04, 637 P.2d 534, 536 (1981) (internal citation omitted).
Because Emerson was not a party to the litigation below, he cannot appeal, and therefore he has no other remedy available at law. Additionally, Emerson raises an issue of first impression: whether the district court retains jurisdiction to consider sanctions following the voluntary dismissal of a case. Accordingly, we exercise our discretion to consider this writ petition.

The district court has jurisdiction to consider sanctions
In his writ petition, Emerson argues that the district court was without jurisdiction to impose sanctions once it dismissed the underlying matter pursuant to the parties' stipulation. Whether the district court had ongoing jurisdiction to impose sanctions is a question of law this court reviews de novo. See American Sterling Bank v. Johnny Mgmt. LV, 126 Nev. ___, ___, 245 P.3d 535, 538 (2010). Although Emerson failed to raise this argument in the district court, this failure is not fatal to his writ petition because the parties can raise subject matter jurisdiction at any time. Landreth v. Malik, 127 Nev. ___, ___, 251 P.3d 163, 166 (2011).
We have previously held that jurisdiction over matters related to the merits of a case terminates upon dismissal. Jeep Corp. v. District Court, 98 Nev. 440, 443-44, 652 P.2d 1183, 1186 (1982); SFPP, L.P. v. Dist. Ct., 123 Nev. 608, 612, 173 P.3d 715, 718 (2007). In Jeep Corp., the district court sua sponte entered a judgment on the merits after the parties stipulated to dismiss the case without prejudice[2] and filed a notice to that effect. 98 Nev. at 442, 652 P.2d at 1185. We held that the district court lacked jurisdiction to consider any action on the merits of the case because the dismissal "terminated [the action] and the court is without further jurisdiction in the matter." Id. at 444, 652 P.2d at 1186. Similarly, in SFPP, L.P., the parties stipulated to dismiss the dispute between them, and we concluded that the "district court lost jurisdiction over the judgment once the order for dismissal with prejudice was entered and lacked jurisdiction to conduct any further proceedings with respect to the matters resolved in the judgment unless it was first properly set aside or vacated." 123 Nev. at 612, 173 P.3d at 718. Jeep Corp. and SFPP, L.P. thus leave open the question of whether the district court retains jurisdiction to consider collateral matters such as sanctions for attorney misconduct when, as here, *228 the parties stipulated to dismiss the case with prejudice.
The United States Supreme Court has held that a lower court may impose sanctions under Federal Rule of Civil Procedure 11 after a plaintiff files a voluntary notice of dismissal. Cooter & Gell v. Hartmarx Corp., 496 U.S. 384, 395, 110 S.Ct. 2447, 110 L.Ed.2d 359 (1990). The Court noted several other collateral issues over which federal courts exercise ongoing jurisdiction, including "costs after an action is dismissed for want of jurisdiction," attorney fees, and criminal contempt charges. Id. at 395-96, 110 S.Ct. 2447. Similarly, this court has held that the district court retains jurisdiction to award attorney fees in the underlying matter after an appeal is filed. Kantor v. Kantor, 116 Nev. 886, 894-95, 8 P.3d 825, 830 (2000) (holding that, although a timely notice of appeal divests the district court of jurisdiction and vests jurisdiction in this court, the district court had jurisdiction to award attorney fees while an appeal of the underlying divorce decree was pending because the "collateral matter did not affect the merits of [the appellant's] appeal"). Other jurisdictions have similarly held that the district court retains jurisdiction to consider sanctions following a voluntary dismissal, or after an appeal has been filed. See Toumajian v. Frailey, 135 F.3d 648, 657 (9th Cir.1998) (holding that "despite a lack of subject matter jurisdiction, a district court may properly award sanctions under Fed.R.Civ.P. 11" because "an award of sanctions involves the determination of a collateral issue and not an adjudication of the merits of a `case or controversy'"); Schering Corp. v. Vitarine Pharmaceuticals, Inc., 889 F.2d 490, 496 (3d Cir.1989) (holding that "the district court had jurisdiction to entertain and decide the Rule 11 motion after defendants suffered a voluntary dismissal under Rule 41(a)(1)(i)"); Thomas v. Capital Sec. Services, Inc., 812 F.2d 984, 987 (5th Cir.1987) (holding that even though an appeal is pending, "the district court retains jurisdiction to entertain and resolve a motion requesting attorney's fees or sanctions").
Allowing the district court to retain jurisdiction to impose sanctions is consistent with other jurisdictions' rationale for sanctioning attorney misconduct. The purpose of these sanctions is to "command obedience to the judiciary and to deter and punish those who abuse the judicial process." Red Carpet Studios Div. of Source Advan. v. Sater, 465 F.3d 642, 645 (6th Cir.2006). Like FRCP 11 violations, and similarly, NRCP 11 violations, attorney misconduct and any resulting sanctions are wholly separate and distinct from adjudicating the merits of an underlying claim because they are affronts on the judicial process unrelated to the substantive merits of a proceeding. See Sater, 465 F.3d at 645. As such, the violation for which the sanction is imposed begins and ends at the time of the act, irrespective of any agreement to settle and dismiss the matter. Cooter & Gell, 496 U.S. at 395, 110 S.Ct. 2447. We also recognize that collateral matters have no preclusive or res judicata effect on the underlying claims because they do not affect the parties' ability to adjudicate the merits of the case. Id.; see also Kantor, 116 Nev. at 895, 8 P.3d at 830 (district courts retain jurisdiction to adjudicate matters that do not affect the merits of the appeal).
In Red Carpet Studios Division of Source Advantage v. Sater, the parties settled a case after the district court granted a motion for sanctions but before it calculated the final amount. 465 F.3d at 645 (interpreting FRCP 41(a)(1)(A)(ii)). The Sixth Circuit Court of Appeals held that, even though the parties voluntarily dismissed the case pursuant to a stipulation, this fact did not affect the district court's ability to impose sanctions. Id. at 644-45. We agree and conclude that a district court retains jurisdiction over collateral matters when a case is dismissed under either NRCP 41(a)(1)(i) or (ii). Additionally, this court treats dismissals pursuant to NRCP 41(a)(1)(i) or (ii) coextensively. See Jeep Corp., 98 Nev. at 444, 652 P.2d at 1186 ("The only difference between subsection (i) and subsection (ii) of the rule is that the former is a unilateral dismissal by plaintiff before issues are joined and the latter is a stipulated dismissal which may be filed at any time," and "[i]n both instances, the action is terminated and the court is without further [subject matter] jurisdiction in the matter."). *229 Thus, the means of dismissal does not affect whether the district court has jurisdiction to impose sanctions.
Accordingly, we now hold that the district court retains jurisdiction to consider collateral matters, including sanctions for attorney misconduct, after the parties stipulate to dismiss a case with prejudice. We now address whether the district court properly awarded attorney fees and costs incurred in the initial trial as a sanction for Emerson's misconduct, when a new trial was ordered as a result of that misconduct.

The district court did not abuse its discretion in awarding most of the costs and fees incurred in the original trial as a sanction for Emerson's misconduct
"This court reviews a district court's award of attorney fees and costs, as a sanction, for an abuse of discretion." Berkson v. LePome, 126 Nev. ___, ___, 245 P.3d 560, 568 (2010).
Emerson challenges the imposition of sanctions on three grounds: (1) the Lioce opinion set forth new standards for misconduct, so imposing those standards on Emerson violated his due process rights because he did not have proper notice of what constituted misconduct; (2) NRS 7.085 allows the district court to impose additional costs resulting from a grant of a new trial, but not the costs incurred during the prior trial; and (3) the amount of sanctions imposed here was grossly disproportionate to the misconduct. Emerson's first argument is without merit because Lioce did not set forth new standards for misconduct; rather, it clarified the standards by which district courts must evaluate misconduct when considering new trial motions. Emerson's second argument is also without merit because neither party raised this issue, or any other issue relating to NRS 7.085, in the district court.[3]See In re AMERCO Derivative Litigation, 127 Nev. ___, ___ n. 6, 252 P.3d 681, 697 n. 6 (2011) (explaining that "we decline to address an issue raised for the first time on appeal"). Accordingly, we only address Emerson's third argument.
While the district court did not provide a statutory basis for its imposition of sanctions against Emerson, we note that district courts have broad discretion to impose sanctions for professional misconduct at trial. See Young v. Johnny Ribeiro Building, 106 Nev. 88, 92, 787 P.2d 777, 779 (1990); see also Lioce, 124 Nev. at 26, 174 P.3d at 986 (explaining that "sanctions for professional misconduct at trial in civil cases are best considered in the first instance by the district court. Therefore, the district court may, on a party's motion or sua sponte, impose sanctions for professional misconduct at trial..."). This broad discretion permits the district court to issue sanctions for any "litigation abuses not specifically proscribed by statute." Young, 106 Nev. at 92, 787 P.2d at 779. Therefore, we conclude that the district court had inherent power to impose sanctions for Emerson's misconduct.[4]
Having concluded that the district court had inherent power to impose sanctions against Emerson, we next consider whether, *230 as Emerson argues, the sanctions were grossly disproportionate to Emerson's misconduct. We conclude that the district court did not abuse its discretion when it awarded sanctions in the amount of fees and costs incurred by Lioce in the original trial.
Despite the district court's broad discretion to impose sanctions, "[a] district court may only impose sanctions that are reasonably proportionate to the litigant's misconduct." Heinle v. Heinle, 777 N.W.2d 590, 602 (N.D.2010). "Proportionate sanctions are those which are `roughly proportionate to sanctions imposed in similar situations or for analogous levels of culpability.'" In re Disciplinary Proceeding Against Hicks, 166 Wash.2d 774, 214 P.3d 897, 905 (2009) (quoting In re Disciplinary Proceeding Against Dynan, 152 Wash.2d 601, 98 P.3d 444, 454-55 (2004) (further internal quotations omitted)). "However, the fact that no other court has imposed like sanctions for such behavior does not mandate a conclusion that the trial court has abused its discretion in ordering such sanctions...." Couch v. Private Diagnostic Clinic, 146 N.C.App. 658, 554 S.E.2d 356, 364 (2001). Moreover, "[s]uch comparisons will seldom be determinative, given the infinite variety of misconduct and of aggravating and mitigating factors." Matter of Disciplinary Pro. Against Noble, 100 Wash.2d 88, 667 P.2d 608, 612 (1983).
In this case, to support his argument that the fees the district court imposed were excessive, Emerson cited other cases where this court awarded only nominal sanctions for an attorney's trial misconduct. See Randolph v. State, 117 Nev. 970, 982, 36 P.3d 424, 432 (2001) (this court found that a prosecutor's restatement of the reasonable doubt standard was sanctionable); Greene v. State, 113 Nev. 157, 170, 931 P.2d 54, 62 (1997) (this court imposed a $250 sanction on the prosecutor for improper comments during the opening statement), overruled on other grounds by Byford v. State, 116 Nev. 215, 235-36, 994 P.2d 700, 713-14 (2000); Williams v. State, 103 Nev. 106, 112 n. 6, 734 P.2d 700, 704 n. 6 (1987); McGuire v. State, 100 Nev. 153, 159-60, 677 P.2d 1060, 1064-65 (1984) (this court ordered sanctions in the amount of $500 because of the prosecutor's misconduct).
We conclude that the cases upon which Emerson relied do not support the conclusion that the sanctions were grossly disproportionate to the misconduct. The cases are distinguishable because they are criminal cases and this court imposed sanctions instead of the district court. More importantly, none of the cases involved misconduct that warranted the granting of a new trial.
In contrast to the cases upon which Emerson relied, the district court in this case granted Lioce's motion for sanctions because it determined that a new trial against defendant Wilson was appropriate because of Emerson's misconduct during the first trial. While the district court's order expressed the court's intention to award attorney fees and costs incurred by Wilson in preparing for and attending the first trial, the ultimate amount awarded was limited to attorney fees and costs incurred during the trial. Specifically, the district court awarded $19,330 based on a declaration submitted by Lioce's counsel for the time counsel spent during trial and the cost of an expert witness who testified. Accordingly, because Emerson's misconduct caused a new trial to be granted, and the district court limited the sanctions to the fees and costs that Lioce incurred in the original trial, we conclude that the sanctions are not disproportionate to the misconduct. Therefore, we conclude that the district court did not abuse its discretion by exercising its inherent power to impose such sanctions. See Young, 106 Nev. at 92, 787 P.2d at 779 ("Even if we would not have imposed such sanctions in the first instance, we will not substitute our judgment for that of the district court.").
Accordingly, we deny Emerson's writ petition.
We concur: SAITTA, C.J., and PARRAGUIRRE, J.
NOTES
[1]  Emerson's improper statements are more fully discussed in Lioce v. Cohen, 124 Nev. 1, 9-10, 20, 174 P.3d 970, 975-76, 982 (2008).
[2]  Pursuant to NRCP 41(a)(1), dismissal by stipulation is without prejudice unless the notice of dismissal indicates otherwise. In Jeep Corp. v. District Court, 98 Nev. 440, 652 P.2d 1183 (1982), the parties did not indicate that they were dismissing the matter with prejudice.
[3]  We further note that the district court did not cite NRS 7.085 as its basis for imposing sanctions. That statute grants district courts authority to award sanctions for "additional" costs incurred in "all appropriate situations to punish for and deter frivolous or vexatious claims and defenses...." NRS 7.085(2). It is not necessary to address whether the district court's sanction of Emerson for misconduct during the trial fits within frivolous claims or defenses punished under the statute.
[4]  Other jurisdictions have similarly concluded that a district court has inherent power to impose sanctions. See, e.g., Couch v. Private Diagnostic Clinic, 146 N.C.App. 658, 554 S.E.2d 356, 362-64 (2001) (explaining that while the trial court did not have express statutory authority to impose attorney fees as sanctions for an attorney's improper closing statement, the trial court had the inherent authority to do so); Persichini v. Beaumont Hosp., 238 Mich.App. 626, 607 N.W.2d 100, 109 (1999) ("[A trial] court's inherent power to sanction misconduct and to control the movement of cases on its docket includes the power to award attorney fees as sanctions when the egregious misconduct of a party or an attorney causes a mistrial."). We further note that the United States Supreme Court has determined that a federal district court has the inherent power to impose attorney fees as sanctions. Chambers v. NASCO, Inc., 501 U.S. 32, 45-46, 62, 111 S.Ct. 2123, 115 L.Ed.2d 27 (1991); see Couch, 554 S.E.2d at 363 (applying Chambers to state trial courts).
