¶ 1.
The issue on appeal is whether the circuit court correctly concluded that Associated Electric & Gas Insurance Services Limited (AEGIS) was barred on the ground of claim preclusion from bringing this action against Arby Construction, Inc. AEGIS claims in this action that it is entitled to indemnification under an indemnification contract between Arby and AEGIS's insured, Wisconsin Public Service Corporation (WPS). The circuit court agreed with Arby that claim preclusion barred AEGIS's claim against Arby because of the stipulated judgment in a prior case in which AEGIS, Arby, and WPS were defendants.
¶ 2. We conclude that AEGIS's affirmative defense in the prior action asserting Arby's contractual obligation to indemnify AEGIS as WPS's insurer was the functional equivalent of a cross-claim for purposes *188of claim preclusion. For that reason and others that we explain below, we conclude that all elements for claim preclusion are met and that it is properly applied in this case. Accordingly, we affirm.
BACKGROUND
¶ 3. The prior action relevant to this appeal was a personal injury action arising out of explosions that occurred while Arby was providing excavation and boring services under a contract with WPS. Under the terms of that contract, Arby was required to defend and indemnify WPS and its insurers for certain losses. While performing services under the contract with WPS, Arby struck and damaged a portion of an underground propane gas line, causing explosions that resulted in the deaths of two people and injury to several others.
¶ 4. In the prior action, the injured persons and the estates of the deceased (collectively, Brooks) named WPS, Arby, AEGIS, and a number of other entities as defendants.1 Brooks' amended complaint alleged, and AEGIS admitted, that it had issued an excess indemnity policy that provided coverage to WPS for the alleged negligence of WPS.
¶ 5. Three pleadings in the Brooks action raised the subject of the indemnification contract between WPS and Arby. First, before AEGIS made an appearance in the Brooks action, WPS filed a cross-claim against Arby under the indemnification contract. This cross-claim alleged that Arby and its insurers were obligated to defend and indemnify WPS and its insurers *189for any expenses in the action or any verdict against WPS and its insurers. Arby answered the cross-claim, denying liability.
¶ 6. Second, WPS and AEGIS filed a joint answer in response to the amended complaint in which they raised the indemnification contract as an affirmative defense. They alleged that, based upon the contract between WPS and Arby, Arby and its insurers were required to fully defend and indemnify WPS and its insurers with respect to any negligence alleged against WPS and any damages asserted against WPS or its insurers.
¶ 7. Third, AEGIS filed its own answer to the amended complaint in which it incorporated any affirmative defense raised by its insureds. Specifically, AEGIS alleged that it was liable only if one or more of its insureds were liable, that "any affirmative defense available to its insureds [was] available to it," and that it was therefore "incorporat[ing] by reference any affirmative defense raised by any of its insureds." WPS was identified as one of its insureds.
¶ 8. The parties eventually settled the prior Brooks action in a confidential agreement pursuant to which various defendants, including Arby, WPS, and AEGIS paid certain sums. The order for dismissal entered pursuant to the settlement agreement provides in full:
WHEREAS, upon representation of counsel, all issues in this case are resolved and all claims are settled with the exception of certain contribution and indemnification claims which will be addressed outside the confines of this lawsuit;
NOW THEREFORE, IT IS HEREBY ORDERED:
1. The cross-claims for contribution asserted by *190Arby Construction and Ferrellgas against each other, and the contractual indemnification claim asserted by Wisconsin Public Service Corporation against Arby Construction and its insurers, are dismissed without prejudice and without costs.
2. This lawsuit, together with any and all claims set forth in the pleadings other than those referenced in paragraph one, above, is dismissed on the merits, with prejudice, but without costs. [Emphasis added.]
¶ 9. After the Brooks action settled, WPS and AEGIS filed this action seeking indemnification from Arby under the indemnification agreement for the amounts each had paid in settlement in the Brooks action and for WPS's legal fees and expenses in defending that action. Arby moved to dismiss AEGIS's claim on the ground that the order of dismissal in the Brooks action bars AEGIS under the doctrine of claim preclusion from pursuing the contractual indemnification claim against Arby. Specifically, Arby argued that the dismissal was "with prejudice" except as to the specifically identified cross-claims, and, since these identified cross-claims did not include AEGIS's claim against Arby, that claim was dismissed with prejudice. Both parties submitted documents from the Brooks action and the court considered them in its decision.
¶ 10. The circuit court agreed with Arby and granted its motion to dismiss AEGIS's claim on the ground of claim preclusion.
DISCUSSION
¶ 11. AEGIS contends on appeal that the dismissal of its current claim against Arby was error because AEGIS did not in the prior Brooks action file a cross-claim against Arby for indemnification under the *191contract between WPS and Arby. According to AEGIS, without this cross-claim — which, AEGIS points out, it was not compelled to file — the requirements for claim preclusion are not met.
¶ 12. Arby responds that the affirmative defense AEGIS asserted in its joint answer with WPS and incorporated by reference in its own answer in the Brooks action was the functional equivalent of a cross-claim for contract indemnification against Arby in that action. This is so, asserts Arby, because in that affirmative defense AEGIS plainly sought recovery from Arby under the contract if AEGIS had any liability because of WPS. According to Arby, the requirements for claim preclusion are met and the dismissal with prejudice in the stipulated order in the Brooks action included AEGIS's claim for contractual indemnification from Arby.2
*192I. Standard of Review and Background Law
¶ 13. We review the circuit court's order of dismissal as we would a decision granting a motion for summary judgment. Summary judgment procedure applies when a circuit court considers matters outside the pleadings on a motion to dismiss based on claim preclusion. Wis. Stat. § 802.06(2)(a)8. & (2)(b) (2009-2010).3 A party is entitled to summary judgment if there are no genuine issues of material fact and that party is entitled to summary judgment as a matter of law. § 802.08(2). In reviewing the grant or denial of a summary judgment, we apply the same methodology as the circuit court, and our review is de novo. Green Spring Farms v. Kersten, 136 Wis. 2d 304, 314-16, 401 N.W.2d 816 (1987). In this case neither party suggests there are factual disputes. Thus, the question whether claim preclusion applies given the undisputed facts presents a question of law, which we review de novo. Wickenhauser v. Lehtinen, 2007 WI 82, ¶ 15, 302 Wis. 2d 41, 734 N.W.2d 855.
¶ 14. Generally, under the doctrine of claim preclusion, previously called res judicata, "a final judgment is conclusive in all subsequent actions between the same parties [or their privies] as to all matters which were litigated or which might have been litigated in the former proceedings." Id., ¶ 22 (citations omitted). The purpose of the doctrine is to prevent repetitive litigation. DePratt v. West Bend Mut. Ins. Co., 113 Wis. 2d 306, 311, 334 N.W.2d 883 (1983). To this end, the doctrine of claim preclusion seeks "to promote judicial economy and to 'conserve the resources the parties *193would expend in repeated and needless litigation of issues that were, or that might have been resolved in a single prior action.'" Mrozek v. Intra Fin. Corp., 2005 WI 73, ¶ 28, 281 Wis. 2d 448, 699 N.W.2d 54 (quoting Hanlon v. Town of Milton, 2000 WI 61, ¶ 20, 235 Wis. 2d 597, 612 N.W.2d 44).
¶ 15. The elements of claim preclusion are: "(1) an identity between the parties or their privies in the prior and present suits; (2) an identity between the causes of action in the two suits; and (3) a final judgment on the merits in a court of competent jurisdiction." Wickenhauser, 302 Wis. 2d 41, ¶ 22. The final judgment on the merits need not be the result of actual litigation. Great Lakes Trucking Co. v. Black, 165 Wis. 2d 162, 168-69, 477 N.W.2d 65 (Ct. App. 1991).4 Rather, a final judgment may have preclusive effect even if it is a stipulated judgment, as long as it is a judgment on the merits. Id.
II. Cross-Claims and Claim Preclusion
¶ 16. As a threshold matter we address AEGIS's contention that a cross-claim is permissive and therefore it was not required to file a cross-claim against Arby in the prior Brooks action. Arby does not appear to dispute this proposition and we agree it is correct. We explain why we agree in order to provide a more complete picture of the doctrine of claim preclusion as relevant to this appeal.
*194¶ 17. Although the general formulation of the doctrine of claim preclusion states that the final judgment is conclusive between the same parties or their privies on "all matters which .. . might have been litigated," it is settled law that we employ a different analysis when the matter that might have been litigated is a counterclaim. Wickenhauser, 302 Wis. 2d 41, ¶ 22. As the court explained in Wickenhauser, counterclaims are generally permissive in Wisconsin and if we were to apply claim preclusion whenever a defendant in a prior action chose not to counterclaim, we would be improperly creating a compulsory counterclaim rule. Id., ¶¶ 23-24.5
¶ 18. We conclude that, similar to counterclaims, cross-claims are generally permissive in Wisconsin. Wisconsin Stat. § 802.07(3) provides:
A pleading may state as a cross claim any claim by one party against a coparty if the cross claim is based on the same transaction, occurrence, or series of transactions or occurrences as is the claim in the original action or as is a counterclaim therein, or if the cross claim relates to any property that is involved in the original action. Except as prohibited by s. 802.02(lm), the cross claim *195may include a claim that the party against whom it is asserted is or may be liable to the cross claimant for all or part of a claim asserted in the action against the cross claimant. [Emphasis added.]
Use of the word "may" indicates that pleading a cross-claim is not mandatory. Although AEGIS has not provided and we have not located a Wisconsin case holding that this statute makes cross-claims permissive, the similarly worded federal rule, Fed. R. Civ. E 13(g), is interpreted in this way. See Heinz Plastic Mold Co. v. Continental Tool Corp., 114 Wis. 2d 54, 60, 337 N.W.2d 189 (Ct. App. 1983) (cross-claims against a co-party under Fed. R. Civ. E 13(g) are permissive).6 The federal courts' interpretation of the similarly worded federal rule — which also uses the word "may" — reinforces our view that cross-claims are permissive under the Wisconsin rule. See Mared Indus., Inc. v. Mansfield, 2005 *196WI 5, ¶ 29, 277 Wis. 2d 350, 690 N.W.2d 835 (citations omitted) (we may look to a federal court's interpretation of a similarly worded federal rule for guidance in interpreting a Wisconsin rule).
¶ 19. Because a cross-claim is permissive, it would be an improper application of claim preclusion to bar a party from bringing a claim in a subsequent action solely because the party could have, but did not, file the claim as a cross-claim in a prior action. See Wickenhauser, 302 Wis. 2d 41, ¶ 23; see also Heinz Plastic Mold Co., 114 Wis. 2d at 60 (concluding that under federal law, claim preclusion does not bar a party from bringing a separate action in federal court on a claim that could have been a cross-claim in a previous action because cross-claims against co-parties are permissive under the federal rule).
¶ 20. However, in this case Arby does not contend that AEGIS is barred from asserting the contract indemnification claim because it did not assert a cross-claim on this ground in the prior Brooks action. The dispute in this case is whether the affirmative defense in the prior action, asserting Arby's obligation under the contract to indemnify AEGIS as WPS's insurer, had the same effect as a cross-claim for purposes of applying the doctrine of claim preclusion in the current action.
III. Application of Claim Preclusion Elements
¶ 21. AEGIS's argument that none of the three elements of claim preclusion are met is based on the form of the pleading as an affirmative defense against Brooks in the prior action. According to AEGIS, there is no identity of parties because the affirmative defense was pled against Brooks, not Arby; the cause of action is *197not identical because an affirmative defense is not a cause of action; and the order for dismissal in the Brooks action was not a final judgment on the merits of AEGIS's claim for contract indemnification from Arby because AEGIS never asserted that as a cross-claim against Arby.
¶ 22. However, if we look at the substance of AEGIS's affirmative defense in the prior action, it is not an affirmative defense against Brooks. Although AEGIS does not expressly concede this, it does not present any argument to the contrary. An affirmative defense is " 'a defendant's assertion raising new facts and arguments that, if true, will defeat the plaintiffs or prosecution's claim even if all allegations in the complaint are true.'" State v. Watkins, 2002 WI 101, ¶ 39, 255 Wis. 2d 265, 647 N.W.2d 244 (emphasis omitted) (quoting Black's Law Dictionary 430 (7th ed. 1999)). Assuming it is true that Arby is obligated to indemnify WPS and its insurers under the terms of the agreement, that obligation does not defeat Brooks' negligence claims against WPS and AEGIS as WPS's insurer. Indeed, Arby's obligation to indemnify does not affect at all the liability of WPS and AEGIS to Brooks. Rather, if we look at the substance of AEGIS's affirmative defense, it is a claim against Arby and its insurers for indemnification for any damages for which WPS and its insurers are liable to Brooks. Thus, the substance of AEGIS's affirmative defense in the prior action asserts the same claim against Arby that AEGIS now asserts in this action.
¶ 23. AEGIS relies on U.S. Fidelity & Guaranty Co. v. Goldblatt Bros., 142 Wis. 2d 187, 191, 417 N.W.2d 417 (Ct. App. 1987), in support of its position that claim preclusion cannot apply because it did not file a pleading in the prior Brooks action labeled as a cross-claim against Arby. In U.S. Fidelity we held that, in order for *198parties in a prior action to be identical to those in a subsequent action, they must have been adverse in the prior action. Id. We concluded that parties who were co-plaintiffs in a prior action where no cross-claim had been filed were not adverse parties in that action. Id. at 192.
¶ 24. We do not agree with AEGIS that U.S. Fidelity resolves the issue before us. The specific argument we rejected in U.S. Fidelity was that "the parties need not be literal adversaries, nor even functional adversaries" in the prior action. Id. at 191 (emphasis added). The rejection of this argument does not imply that "functional adversaries" are not adverse. Because in U.S. Fidelity there was no pleading that substantively raised an issue on which the parties were adverse in the prior action, we did not have occasion to address whether a cross-claim was the only way in which co-parties could be adverse. See id.
¶ 25. The purpose of the "adverse-in-prior-action" requirement can be discerned from Bakula v. Schwab, 167 Wis. 546, 555-56, 168 N.W. 378 (1918), which established this requirement and on which we relied in U.S. Fidelity.7 The fact situation in Bakula was that the circuit court directed a verdict in favor of one *199defendant tortfeasor and the jury found against a second defendant tortfeasor. Bakula, 167 Wis. at 548. The tortfeasor found negligent (Schwab) asked on appeal for a new trial on the ground that the claim against the other tortfeasor (Wilkinson) should also have gone to the jury. Id. at 552. Schwab's concern was that the judgment in favor of Wilkinson would bar any claim for contribution he might bring in the future against Wilkinson. Id. The supreme court held that the judgment would not have preclusive effect in the future because Wilkinson and Schwab were not adverse parties in the present action. Id. at 555-56. The court reasoned that, in the present action, Schwab and Wilkinson were both primarily endeavoring to escape liability to the plaintiff and "Schwab did not have control of the proceedings to enable him to exhaust the question of Wilkinson's liability." Id. at 556. In other words, at the time of the trial, Schwab would have had no knowledge that he should try to pin all liability on Wilkinson and would not have had a full opportunity to do so.
¶ 26. In this case there is no issue concerning AEGIS's knowledge that it should attempt to hold Arby liable: AEGIS itself asserted Arby's liability under the indemnification agreement, albeit in the form of an affirmative defense. There is no unfairness to AEGIS in considering the substance of its own pleading. The reasoning in Bakula does not support a conclusion that the parties here were not adverse in the prior Brooks action simply because AEGIS asserted the substance of its claim against Arby in the form of an affirmative defense.
¶ 27. AEGIS also contends that we cannot treat its affirmative defense in the prior action as a cross-claim because, even if the designation as affirmative defense is mistaken, a court must redesignate it and the Brooks *200court did not do so. AEGIS relies on the federal rule and the Wisconsin equivalent that address the situation in which "a party mistakenly designates a defense as a counterclaim, or a counterclaim as a defense." Fed. R. Civ. R 8(c)(2); see also Wis. Stat. § 802.02(3). Under the federal rule, "if justice requires," the court "must... treat the pleading as though it were correctly designated ...." Fed. R. Civ. E 8(c)(2). Under the Wisconsin rule, "the court, if justice so requires, shall permit amendment of the pleading to conform to a proper designation." § 802.02(3). Putting aside the fact that we are concerned in this case with a cross-claim, not a counterclaim — a difference that AEGIS does not address —AEGIS does not explain why these rules prevent us from looking at the substance of the erroneously labeled pleading in the context of a claim preclusion analysis. Neither rule requires that the mislabeling governs for all purposes unless the court takes the specified action. Indeed, contrary to AEGIS's position, both rules suggest that the substance of the matter pleaded is important despite the mislabeling.
¶ 28. We conclude that AEGIS's affirmative defense in the prior action was the functional equivalent of a cross-claim against Arby for purposes of claim preclusion. The affirmative defense plainly stated that, based upon the contract between WPS and Arby, Arby was obligated to fully defend and indemnify WPS and its insurers with respect to any negligence by WPS and any damages against WPS and its insurers. There is no doubt, based on the affirmative defense, that AEGIS was seeking indemnification from Arby under the contract if AEGIS or WPS was found liable to Brooks. Plainly, AEGIS and Arby were adverse parties with respect to the issue of Arby's obligation under the contract. AEGIS's *201claim in this action is against Arby for indemnification under the same contract for amounts that AEGIS paid to Brooks as WPS's insurer in settlement of Brooks' negligence claim against WPS. Accordingly, the elements of identity of parties and cause of action are met.
¶ 29. The third element of claim preclusion requires that the final stipulated judgment in the Brooks action be a dismissal on the merits of AEGIS's contract indemnification claim against Arby. See Great Lakes Trucking, 165 Wis. 2d at 168-69. AEGIS argues that this requirement is not met because there was no such claim — meaning no properly designated cross-claim. However, for the reasons we have already discussed, we conclude the only reasonable inference from the record is that all parties to the Brooks action understood that AEGIS was seeking from Arby, under the contract with WPS, indemnification for any liability AEGIS had as WPS's insurer. The order of dismissal states that "all issues in this case are resolved and all claims are settled" and "any and all claims set forth in the pleadings . . . [are] dismissed on the merits, with prejudice," except the claims specifically identified. The only reasonable inference is that AEGIS's claim for contract indemnification against Arby was dismissed with prejudice unless it was specifically excepted from dismissal with prejudice.
¶ 30. AEGIS does not contend that its indemnification claim was specifically excepted. In particular, AEGIS does not contend that its claim was included in the exception for "the contractual indemnification claim asserted by Wisconsin Public Service Corporation against Arby Construction and its insurers." Such an argument would not be successful because the addition of the phrase "and its insurers" to Arby but not to WPS plainly shows an intent not to include WPS's insurers in *202the exception. It is undisputed that AEGIS made a payment as WPS's insurer to Brooks to settle the case. The only reasonable inference is that, had the parties intended that AEGIS be able to assert in a separate action a claim for indemnification from Arby for that payment, they would have included AEGIS in this exception.
¶ 31. We conclude, based on the undisputed facts, that the three elements for claim preclusion are met and that the doctrine is properly applied in this case to bar AEGIS's claim against Arby in this action.
CONCLUSION
¶ 32. We affirm the circuit court's order dismissing AEGIS's claim against Arby on the ground of claim preclusion.
By the Court. — Order affirmed.
Brooks v. Old Republic Ins. Co., Case No. 06-C-996 (E.D. Wis.).
We address only the arguments made by the parties, although the facts in this case suggest other lines of inquiry that might lead to resolution of the claim preclusion issue. Specifically, according to the pleadings in the Brooks action, it is undisputed that AEGIS was an excess insurer not only for WPS but also for Arby. However, AEGIS does not argue that for this reason claim preclusion does not apply. Therefore, we ignore the insurer/insured relationship between AEGIS and Arby in our analysis. In addition, because AEGIS is WPS's insurer and WPS filed a cross-claim for contract indemnification for itself and its insurers against Arby, arguably AEGIS and WPS were in privity with respect to WPS's cross-claim and it is unnecessary to discuss AEGIS's affirmative defense based on the indemnification contract. See Parsons v. American Family Ins. Co., 2007 WI App 211, ¶¶ 11-12, 305 Wis. 2d 630, 740 N.W.2d 399 (insurer's interests are aligned with insured where liability of insurer is predicated on liability of insured and they thus stand in privity). However, Arby does not take this approach and we therefore do not discuss it further.
All references to the Wisconsin Statutes are to the 2009-10 version unless otherwise noted.
In contrast, an element of the doctrine of issue preclusion is that the issue was actually litigated in a prior action. Kruckenberg v. Harvey, 2005 WI 43, ¶ 19 n.13, 279 Wis. 2d 520, 694 N.W.2d 879 (citations omitted).
This does not mean that a defendant in a prior action always has the right in a subsequent action to bring a claim that could have been asserted as a counterclaim against the plaintiff in a prior action. Wickenhauser v. Lehtinen, 2007 WI 82, ¶ 25, 302 Wis. 2d 41, 734 N.W.2d 855. While this is the general rule, there is a narrow exception called the common law compulsory counterclaim rule. Id., ¶¶ 25-26. Under this exception, a party is barred from bringing in a subsequent action a claim that could have been asserted as a counterclaim in a prior action when a favorable judgment in the subsequent action would "nullify the first judgment or impair rights established in the first action." Id.
On this point and the point we discuss in paragraph 27, AEGIS relies on both a federal rule and a Wisconsin rule that are essentially the same. Because these federal and Wisconsin rules are essentially the same, here and in paragraph 27 we discuss the rules of both forums without deciding whether, in a claim preclusion context where the prior action is in another forum, we should follow that forum's rules or Wisconsin rules in deciding what claims were or should have been pleaded in the prior action. However, we note that in Heinz Plastic Mold Co. v. Continental Tool Corp. 114 Wis. 2d 54, 337 N.W.2d 189 (Ct. App. 1983), without specifically discussing this issue, we applied the federal rules in deciding whether the plaintiffs were obligated to raise certain claims in the prior federal action. In contrast, in Marten Transport, Ltd. v. Rural Mutual Insurance Co., 198 Wis. 2d 738, 744-46, 543 N.W.2d 541 (Ct. App. 1995), we expressly rejected the argument that the law of the forum state for- the prior action should apply in deciding whether a contribution claim should have been pled in that action. We concluded that, because the issue was one of procedure, Wisconsin law applied. Id.
In discussing the meaning of "adverse" parties, Bakula v. Schwab, 167 Wis. 546, 555-56, 168 N.W 378 (1918), held: "What is meant by adverse parties scarcely needs definition. Its significance is apparent from the expression itself. They must be opposite parties to an issue between them. The issue must be proffered by one and controverted by the other. They must be arrayed on opposite sides of the issue." As with U.S. Fidelity, because there was no pleading of any type raising an issue or claim between the co-parties, the Bakula court did not have occasion to decide whether anything other than a cross-claim would suffice.