
147 P.3d 238 (2006)
BRENT G. THEOBALD CONSTRUCTION, INC., A Utah Corporation, Appellant,
v.
RICHARDSON CONSTRUCTION, INC., A Nevada Corporation; and Hartford Fire Insurance Company, Respondents.
No. 43155.
Supreme Court of Nevada.
December 7, 2006.
*239 Durham Jones & Pinegar and Jeffrey N. Starkey, St. George, Utah, and Terry L. Wade, Las Vegas, for Appellant.
Parker Nelson & Arin, Chtd., and Robert P. Bettinger, Matthew Oravec, and Theodore Parker III, Las Vegas, for Respondents.
Before DOUGLAS, BECKER and PARRAGUIRRE, JJ.

OPINION
BECKER, J.
In this case, we confirm that a lawsuit dismissed under NRCP 41(e), unless dismissed without prejudice, is res judicata to a future lawsuit between the same plaintiff and defendant involving the same claims for relief. Appellant Brent G. Theobald Construction, Inc., filed a lawsuit, which the district court dismissed based on NRCP 41(e) for failure to prosecute. The district court did not state whether the dismissal was with or without prejudice. Without appealing the dismissal, Theobald filed a second lawsuit, which the district court dismissed as res judicata. Theobald cites to Home Savings Ass'n v. Aetna Casualty & Surety[1] for the proposition that the second lawsuit should not be subject to res judicata. We conclude that the district court correctly dismissed Theobald's second lawsuit based on res judicata, and we clarify our holding in Home Savings.

FACTS
Respondent Richardson Construction, Inc., was a general contractor on a project for the White Pine County School District. Richardson subcontracted with Theobald to provide labor, materials, equipment, and other services for the project. The subcontract provided that "[t]he Final payment of retention will be paid to Subcontractor 30 days after receipt of retention from the Owner." During construction, additional costs were allegedly incurred as a result of extras, changes, *240 delays, failures to provide access, and changes in the scope of the project. As a result, White Pine refused to pay Richardson the final payment and retention, and Richardson refused to pay Theobald until White Pine paid Richardson.
Theobald sued Richardson in April 1995 for breach of contract and unjust enrichment. Richardson, however, chose to arbitrate its dispute with White Pine and moved for a stay of litigation with Theobald while it pursued the arbitration. Richardson argued that the first lawsuit was premature because it had thirty days after receiving the final payment and retention to pay Theobald, it had not received payment, and it would pay Theobald after it had received payment from White Pine. Theobald opposed the motion, arguing that the money Richardson owed under the contract was immediately due and payable. The district court denied Richardson's motion in March 1997.
Nevertheless, instead of pursuing its claims, Theobald cooperated with Richardson in Richardson's arbitration with White Pine, providing documentation regarding charges owed to Theobald. Theobald then waited for the arbitration between Richardson and White Pine to be resolved so that Richardson could pay Theobald. Theobald and Richardson did not agree to extend the time for Theobald to bring the action to trial under NRCP 41(e).
Richardson and White Pine settled in December 1997. In February 2002, Theobald became aware of the settlement and requested payment from Richardson, which refused to pay. In March 2003, nearly eight years after it filed its complaint, Theobald moved for summary judgment against Richardson. Richardson moved to dismiss the lawsuit based on NRCP 41(e) for failure to prosecute. As the lawsuit had not been prosecuted within NRCP 41(e)'s five-year requirement, the district court dismissed the lawsuit. The district court did not indicate whether it dismissed the lawsuit with or without prejudice.[2]
Theobald did not appeal or ask for modification of that order. Instead, it filed a second complaint against Richardson in July 2003. Theobald again alleged breach of contract and unjust enrichment. Richardson moved to dismiss, arguing that Theobald was barred from further litigation because dismissal of the first lawsuit was not without prejudice and the statute of limitations had run. In response, Theobald cited Home Savings and argued that the previous district court abused its discretion when it did not dismiss the first lawsuit without prejudice because Richardson led Theobald to believe that it would be paid when Richardson was paid. Contrary to its earlier argument opposing Richardson's motion to stay the district court proceedings, Theobald also argued that Richardson's obligation to pay Theobald did not arise until White Pine paid Richardson. The district court dismissed the second complaint based on both NRCP 41(e) and the statute of limitations. Theobald appeals, arguing that, under Home Savings, a district court may consider whether the previous district court abused its discretion when it dismissed an earlier lawsuit without mentioning prejudice, and may refuse to apply the doctrine of res judicata if it determines that the earlier lawsuit should have been dismissed without prejudice.

DISCUSSION
Richardson moved to dismiss Theobald's complaint under NRCP 12(b)(5)[3] for failure to state a claim. "An order granting a motion to dismiss under NCRP 12(b)(5) for failure to state a claim is subject to a rigorous standard of review on appeal."[4] All factual allegations in the complaint must be regarded as true, and all inferences must be *241 drawn in favor of the nonmoving party.[5] "`A complaint should only be dismissed if it appears beyond a reasonable doubt that the plaintiff could prove no set of facts, which, if true, would entitle him to relief. Dismissal is proper where the allegations are insufficient to establish the elements of a claim for relief.'"[6]
The district court dismissed Theobald's complaint as res judicata under NRCP 41(e), which provides, in relevant part, that
[a]ny action . . . shall be dismissed by the court . . . unless such action is brought to trial within 5 years after the plaintiff has filed the action. . . . A dismissal under this subdivision (e) is a bar to another action upon the same claim for relief against the same defendants unless the court otherwise provides.
Thus, NRCP 41(e) mandates dismissal of an action five years from the date it was filed if trial has not commenced.[7] The district court has discretion to dismiss the case with or without prejudice.[8] However, unless the district court states in its order that dismissal is without prejudice, dismissal with prejudice is presumed[9] and "is res judicata and bars any other suit on the same claim."[10]
Under the plain terms of NRCP 41(e), the district court properly dismissed Theobald's second complaint as res judicata. Theobald filed its first lawsuit against Richardson in April 1995. Theobald failed to prosecute the lawsuit until March 2003, eight years later, and the district court dismissed the case under NRCP 41(e) without mentioning prejudice. Under NRCP 41(e), dismissal with prejudice must be presumed. Theobald failed to appeal or to seek clarification of this order.[11] Instead, in July 2003, Theobald filed its complaint in the present litigation with the same claims against the same defendant. NRCP 41(e)'s express language rendered this second complaint res judicata, and the district court dismissed the complaint.
Nevertheless, on appeal, Theobald argues that the district court erred because, under Home Savings, when a case is dismissed under NRCP 41(e) and a subsequent lawsuit is filed by the same plaintiff against the same defendant involving the same claims, the court in the second case can review the NRCP 41(e) dismissal and may allow the second case to proceed if the NRCP 41(e) dismissal should have been granted without prejudice.
On review of Home Savings, the facts are vague as to why we had jurisdiction to consider the initial NRCP 41(e) dismissal. Thus, Theobald's interpretation is plausible  even if it conflicts with this court's previous interpretations of NRCP 41(e). However, the procedural history of Home Savings, which we now clarify, disproves Theobald's interpretation.
In Home Savings, H.S. Service Corporation and Home Savings sought declaratory relief in November 1981 against Aetna Casualty and Surety Company. H.S. and Home Savings argued that their insurance policies with Aetna covered certain constructional defect litigation and that Aetna had a duty to defend them. The district court bifurcated the trialH.S. proceeded against Aetna while Home Savings awaited the outcome. H.S. prevailed at trial in October 1984 and on appeal in February 1987. Home Savings *242 then sought summary judgment against Aetna in October 1988.[12]
Just after Home Savings sought summary judgment in the first case, Home Savings and H.S. filed a second complaint against Aetna in November 1988 seeking the same declaratory relief and other damages.[13] Without mentioning prejudice, the district court granted Aetna's NRCP 41(e) motion to dismiss Home Savings from the first case.[14] Home Savings then moved to clarify that the dismissal was without prejudice. The district court eventually denied Home Saving's motion, but before it did so, it consolidated the 1981 and 1988 cases.[15]
Although Home Savings immediately appealed the district court's NRCP 41(e) dismissal, we dismissed that appeal as premature because the district court's dismissal only disposed of one of the two consolidated actions and was not a final judgment.[16] Eventually, the district court entered partial summary judgment against Home Savings in the second case based on res judicata and dismissed the case upon the parties' stipulation for dismissal. Home Savings and H.S. then appealed this final judgment, challenging the earlier NRCP 41(e) dismissal order.[17] Thus, both the NRCP 41(e) dismissal of Home Savings' first complaint and the subsequent order finally resolving both cases were before us in Home Savings. We therefore had jurisdiction to consider whether the district court abused its discretion when it did not dismiss the first case without prejudice.
This case is in a different procedural posture. The two district court actions were not consolidated. And, Theobald did not appeal the district court's NRCP 41(e) dismissal order in its first case. Because that dismissal is not before us, we have no jurisdiction to consider whether the district court abused its discretion by not dismissing the case without prejudice. Consequently, under NRCP 41(e), Theobald is barred from bringing a second lawsuit against Richardson with the same claims. Therefore, we conclude that the district court did not abuse its discretion when it granted Richardson's motion to dismiss.[18]

CONCLUSION
Home Savings timely appealed the district court's dismissal of its case under NRCP 41(e). Here, however, Theobald did not appeal the district court's order dismissing, under NRCP 41(e), its first case. Therefore, we have no jurisdiction to consider whether the district court abused its discretion when it did not dismiss the first case without prejudice. Thus, under NRCP 41(e), Theobald is barred from bringing the same claims against Richardson, and we conclude that the district court did not abuse its discretion when it granted Richardson's motion to dismiss. Accordingly, we affirm the district court's order.
DOUGLAS and PARRAGUIRRE, JJ., concur.
NOTES
[1]  109 Nev. 558, 854 P.2d 851 (1993).
[2]  NRCP 41(e).
[3]  Richardson stated in its motion to dismiss that it was moving to dismiss under NRCP 12(b)(6), which is a motion to dismiss for "failure to join a party under Rule 19." NRCP 12(b)(5) is the rule governing failure to state a claim in Nevada. FRCP 12(b)(6) is the corresponding rule in federal court. As the district court and the parties treated Richardson's motion as a motion to dismiss for failure to state a claim, we do so as well.
[4]  Stockmeier v. State, Dep't of Corrections, 122 Nev. ___, ___, 135 P.3d 220, 223 (2006) (citing Hampe v. Foote, 118 Nev. 405, 408, 47 P.3d 438, 439 (2002)).
[5]  Hampe, 118 Nev. at 408, 47 P.3d at 439.
[6]  Stockmeier, 122 Nev. at ___, 135 P.3d at 223 (quoting Hampe, 118 Nev. at 408, 47 P.3d at 439).
[7]  Home Savings, 109 Nev. at 563, 854 P.2d at 854.
[8]  Id. at 563-64, 854 P.2d at 854.
[9]  See Erickson v. One Thirty-Three, Inc., 104 Nev. 755, 758, 766 P.2d 898, 900 (1988).
[10]  Id.; NRCP 41(e) ("A dismissal under this subdivision (e) is a bar to another action upon the same claim for relief against the same defendants unless the court otherwise provides.").
[11]  A district court's "discretion is not unbridled" and factors such as "whether plaintiff offers [an] adequate excuse for the delay and whether plaintiff's case lacks merit" must inform the district court's decision to order the dismissal with or without prejudice. Home Savings, 109 Nev. at 563-64, 854 P.2d at 854. On appeal, this court may consider these factors and reverse the district court's order if it has abused its discretion when dismissing a case under NRCP 41(e) with prejudice. Id.
[12]  Id. at 560-61, 854 P.2d at 852-53.
[13]  Id. at 562, 854 P.2d at 853.
[14]  Id. at 561-62, 854 P.2d at 853.
[15]  Home Savings Ass'n v. Aetna Cas. & Surety, Docket No. 19978, 105 Nev. 1035, 810 P.2d 328 (Order Dismissing Appeal May 31, 1989).
[16]  Id.; see NRAP 3A(b); Mallin v. Farmers Insurance Exchange, 106 Nev. 606, 608-09, 797 P.2d 978, 980 (1990).
[17]  Home Savings Ass'n, 109 Nev. at 563, 854 P.2d at 854. The parties agreed that the district court's order finally disposed of all pending matters. See Consolidated Generator v. Cummins Engine, 114 Nev. 1304, 1312, 971 P.2d 1251, 1256 (1998) (noting that interlocutory orders entered before the final judgment may be considered on appeal from the final judgment).
[18]  As our conclusion that the district court correctly dismissed this case as res judicata is dispositive, we do not address the district court's findings regarding the statute of limitations.
