Plaintiff manufactures painting equipment. This suit arises out of an action brought in the federal district court against plaintiff for damages arising out of a painting system it had supplied. In the course of that suit, plaintiff apparently violated a court order and was found to be in contempt. The federal district court indicated that plaintiff would have to pay a fine to purge its contempt. Apparently, the amount of the fine has not yet been determined.
On November 4, 1994, plaintiff filed this action in the circuit court in an attempt to require defendant, plaintiff’s general liability insurer, to pay the contempt fine. On October 27, 1995, defendant filed a motion for summary disposition pursuant to MCR 2.116(C)(8). In December, while defendant’s motion was pending, plaintiff filed another suit in the federal district court. This new federal action contained a claim identical to the circuit court claim, along with *561additional claims. Plaintiff then filed a motion for voluntary dismissal in the circuit court.
On January 3, 1996, the trial court heard both defendant’s motion for summary disposition pursuant to MCR 2.116(C)(8) and plaintiff’s motion for voluntary dismissal. The trial court granted both motions without prejudice. Defendant refused to stipulate an order, arguing that summary disposition under C(8) should be with prejudice. Despite defendant’s objections, the trial court entered an order granting both motions without prejudice. Defendant appeals, arguing that a grant of summary disposition under MCR 2.116(C)(8) must necessarily be with prejudice.
Proper resolution of this appeal requires an understanding of MCR 2.116(C)(8). This court rule allows the court to grant summary disposition where “[t]he opposing party has failed to state a claim on which relief can be granted.” MCR 2.116(C)(8). “A motion for summary disposition brought pursuant to MCR 2.116(C)(8) tests the legal sufficiency of the plaintiff’s complaint and should be granted only if the claims are so clearly unenforceable as a matter of law that no factual development could possibly justify recovery.” Int’l Brotherhood of Electrical Workers, Local 58 v McNulty, 214 Mich App 437, 443-444; 543 NW2d 25 (1995). Where a motion is brought under C(8), the trial court should liberally permit the parties to amend their pleadings unless amendment “would not be justified.” MCR 2.116(I)(5).
The question whether a motion for summary disposition under C(8) should be granted with or without prejudice has rarely been addressed in Michigan. This Court has affirmed a number of cases where a C(8) motion was granted with prejudice but did not com*562ment on this question. See Kauffman v Shefman, 169 Mich App 829, 831; 426 NW2d 819 (1988); Smith v Pontiac, 169 Mich App 559, 561; 426 NW2d 704 (1988); Simonds v Tibbitts, 165 Mich App 480, 481; 419 NW2d 5 (1987). In the only case in which this issue was expressly addressed, Gardner v Stodgel, 175 Mich App 241; 437 NW2d 276 (1989), this Court held that a motion for summary disposition under MCR 2.116(C)(8) was properly granted with prejudice on the basis of the facts of that case. Gardner, supra at 251. Unfortunately, this Court gave no insight into its reasoning in Gardner.1
The decision whether to grant dismissal with or without prejudice, by definition, determines whether a party may refile a claim or whether the claim is permanently barred. Thomas v Michigan Employment Security Comm, 154 Mich App 736, 742; 398 NW2d 514 (1986). Thus, in deciding whether dismissal should be with or without prejudice, the trial court should consider whether the doctrine of res judicata would bar subsequent actions involving the same claim. “The doctrine of res judicata is a manifestation of the recognition that interminable litigation leads to vexation, confusion, and chaos for the litigants, resulting in the inefficient use of judicial time.” Schwartz v Flint, 187 Mich App 191, 194; 466 NW2d 357 (1991). “For [res judicata] to apply, (1) there must have been a prior decision on the merits, (2) the issues must have been resolved in the first action, *563and (3) both actions must be between the same parties or their privies.” Moore v Wicks, 184 Mich App 517, 519-520; 458 NW2d 653 (1990). Where a trial court dismisses a case on the merits, the plaintiff should not be allowed to refile the same suit against the same defendant and dismissal should therefore be with prejudice.
In the instant case, the trial court specifically indicated that it was not making a decision on the merits. However, it is logically inconsistent to grant a motion for summary disposition under C(8) “not upon the merits.” That is the equivalent of saying that “without looking at the merit, the complaint is legally without merit.” Thus, summary disposition under C(8) is necessarily a decision on the merits.2 To grant such a motion “without prejudice” is equally incongruous. That is the equivalent of saying that the plaintiffs claim is without legal merit but he may refile the exact same claim. Logically, then, a grant of summary disposition under subrule C(8) should always be with prejudice.
*564This conclusion does not, of course, preclude a plaintiff from requesting leave to amend its complaint before the trial court rules on a motion under C(8). In fact, under MCR 2.116(I)(5), the trial court should normally allow such amendments. When the trial court in the instant case granted defendant’s motion, plaintiff had two options: (1) seek permission to amend its complaint or (2) appeal the trial court’s decision to grant the motion. The granting of a C(8) motion is an immediately appealable decision although often an amendment of defective pleadings is granted. However, even during this interim period, the decision to grant a motion pursuant to C(8) should be characterized as with prejudice. MCR 2.116(I)(5), relating to the opportunity to amend pleadings in response to summary disposition motions, is an exception to the general rule concerning rehearings. MCR 2.119(F)(3). What plaintiff cannot do is simply allow the dismissal to go unchallenged and later refile his complaint in the same court.3
The other issue necessarily raised by defendant’s appeal is whether the trial court could properly grant both plaintiff’s motion for voluntary dismissal and the defendant’s motion for summary disposition. Obviously, it could not. The trial court’s grant of defendant’s motion for summary disposition under MCR *5652.116(C)(8) would bar plaintiff from refiling this claim. On the other hand, plaintiff was requesting voluntary dismissal for the express purpose of litigating this claim in another forum. Thus, the trial court could grant one motion or the other, but not both. While it may have been a trial court’s past practice to grant a C(8) motion without prejudice, this option is not properly available to it.
Accordingly, the trial court’s order is vacated. This matter is remanded for reconsideration of both motions in a manner consistent with this opinion.4 We do not retain jurisdiction.
Markman, J., concurred.This Court in Gardner simply stated:
Based on the facts of this case, we find the court did not abuse its discretion in dismissing this matter with prejudice. [Gardner, supra at 251.]
While Michigan courts have not specifically held that the grant of a motion for summary disposition under C(8) is a ruling on the merits, this conclusion is supported by the federal courts’ interpretation of the identical federal rule, FR Civ P 12(b)(6). MCR 2.116(C)(8) was modeled after the federal rule. Glittenberg v Doughboy Recreational Industries, Inc, 436 Mich 673, 680; 462 NW2d 348 (1990), rev’d on other grounds 441 Mich 379; 491 NW2d 208 (1992). The Sixth Circuit Court of Appeals, for example, has addressed this issue: “In the federal courts, a dismissal pursuant to Rule 12(b)(6) is considered a decision on the merits with full res judicata effect.” Dyer v Intera Corp, 870 F2d 1063 (CA 6, 1989) (citing Federated Dep’t Stores, Inc v Moitie, 452 US 394, 399, n 3; 101 S Ct 2424; 69 L Ed 2d 103 [1981]; Bartsch v Chamberlin, 266 F2d 357 [CA 6, 1959]; Cannon v Loyola Univ of Chicago, 784 F2d 777, 780 [CA 7, 1986]; Issac v Schwartz, 706 F2d 15, 17 [CA 1, 1983]; and Teltronics Services, Inc v LM Ericsson Telecommunications, Inc, 642 F2d 31, 34 [CA 2, 1981]).
As a general rule, the decision whether to dismiss with or without prejudice is wholly within the trial court’s discretion. Such a rule, however, relates to dismissals for such reasons as delay or discovery violations. While grants of summary disposition motions under MCR 2.116(C)(8) are often generically referred to as “dismissals,” they are, by their nature, distinct from dismissals under such provisions of the rules as MCR 2.504 or MCR 2.313. A dismissal under such provisions generally affords the trial court broad discretion concerning the res judicata effect of the dismissal. Cf. MCR 2.504(A)(1).
While the dissent may well be accurate in characterizing the subjective “intent” of the trial court, i.e., to allow plaintiff to have its case heard in the federal district court, the court’s actions do not compel this conclusion. Rather than attempting to derive the court’s true “intent” from an inherently contradictory set of actions, we prefer to let the court clarify for itself what resolution it would make of this case. Because we have more difficulty than the dissent in reconciling the various actions of the court, we cannot concur with its observation that defendant was “victorious” on its motion or that it is not an aggrieved party. Defendant’s motion was predicated on MCR 2.116(C)(8), which requires dismissal with prejudice; rather than being dismissed on this basis, the court granted a motion predicated apparently upon MCR 2.504, which carries altogether different consequences.