ACTION
Roger and Nance Allan (Allans) appeal the trial court’s dismissal of their complaint against Carl and Gregory Sheesley (Shees-leys).1 We affirm.
PACTS
This matter arises out of the sale of a motel in Spearfish, South Dakota. Allans bought the motel from Sheesleys and Hans Pfeiffer (Pfeiffer) in September 1984 by assuming their obligations under a contract for deed for purchase of the motel from S.W. Croes (Croes). In 1985, Allans lost the motel’s Best Western franchise because it failed to meet Best Western standards. Allans continued operating the motel but defaulted on the contract for deed by failing to make the required payments in November and December 1986. In 1987, Al-lans made payments for January, February and March but nothing was paid thereafter.
In April 1987, Croes instituted an action against Sheesleys, Pfeiffer,2 Allans, the Small Business Administration (SBA) and Norwest Bank3 for specific performance of the contract for deed or, in the alternative, for foreclosure of the contract. During the course of the Croes’ action, Allans filed a “counterclaim” (in reality, a cross-claim) for fraud against Sheesleys and Pfeiffer alleging that they had had knowledge of the precarious status of the motel’s Best Western franchise at the time they sold it. The cross-claim was ultimately dismissed because it failed to state a claim on which relief could be granted (SDCL 15-6-12(b)(5)). The dismissal of the cross-claim was appealed to this court and affirmed in S.W. Croes Family Trust, supra at n. 1.
In April 1988, Allans commenced the present action against Sheesleys raising the same claim of fraud as was raised in their cross-claim in the Croes action. On September 19, 1988, the trial court entered its order dismissing Allans’ complaint finding it barred by the doctrines of res judica-ta and collateral estoppel. This appeal followed.
ISSUE
Whether the trial court abused its discretion in dismissing Allans’ complaint?
DECISION
Res judicata bars attempts to reliti-gate a prior determined cause of action between parties who were also parties to the earlier suit. Black Hills Jewelry Mfg. v. Felco Jewel Ind., 336 N.W.2d 153 (S.D.1983). Allans contend that the dismissal of their cross-claim in the Croes action could carry no res judicata effect barring the present action because the dismissal was *363not a final judgment on the merits of the claim. We disagree.
Allans are correct to the extent that a determination of a prior action is accorded res judicata effect only if a judgment on the merits was rendered. Keith v. Willers Truck Service, 64 S.D. 274, 266 N.W. 256 (1936). Thus, the real issue in this case is whether the dismissal of Allans’ cross-claim for failure to state a claim upon which relief could be granted was a final judgment on the merits.
SDCL 15-6-41(b) defines when a dismissal of a claim is to be accorded the status of a judgment on the merits.4 The statute provides in pertinent part, “[ujnless the court in its order for dismissal otherwise specifies, a dismissal under this section and any dismissal not provided for in § 15-6-41, other than a dismissal for lack of jurisdiction, or for failure to join a party under § 15-6-19, operates as an adjudication upon the merits.” SDCL 15-6-41(b) (emphasis added).
In this instance, the trial court never specified that its dismissal of Allans’ original cross-claim was not an adjudication upon the merits. Moreover, Allans concede that the cross-claim was dismissed pursuant to SDCL 15 — 6—12(b)(5) for failure to state a claim upon which relief could be granted. Since the dismissal was pursuant to SDCL 15-6-12(b)(5), it was a dismissal not provided for in SDCL 15-6-41. Therefore, we hold that the dismissal of the cross-claim was an adjudication upon the merits which should be accorded res judica-ta effect. See U.S. v. Maull, 855 F.2d 514 (8th Cir.1988); Glick v. Ballentine Produce, Inc., 397 F.2d 590 (8th Cir.1968) (dismissal of an action for failure to state a claim on which relief can be granted is a final judgment on the merits sufficient to raise the defense of res judicata in a subsequent action between the same parties). Accord, Hall v. Tower Land and Investment Company, 512 F.2d 481 (5th Cir. 1975); Bartsch v. Charriberlin Company of America, 266 F.2d 357 (6th Cir.1959); Cannon v. Loyola University of Chicago, 784 F.2d 777 (7th Cir.1986).
Allans contend that the dismissal of the cross-claim was, in reality, a dismissal for lack of jurisdiction and, under SDCL 15-6-41(b), it should not be given the status of an adjudication upon the merits. In support of their contention, Allans rely on the United States Supreme Court’s decision in Costello v. United States, 365 U.S. 265, 81 S.Ct. 534, 5 L.Ed.2d 551 (1961). In Costello the Supreme Court reviewed the provision of Federal Rule of Civil Procedure 41(b) (nearly identical to SDCL 15-6-41(b)) excepting dismissals for lack of jurisdiction from the general rule that dismissals constitute a judgment on the merits. The Supreme Court rendered a broad interpretation to the term “jurisdiction” in Rule 41(b) extending the term to cover any dismissal, “based on a plaintiff’s failure to comply with a precondition requisite to the Court’s going forward to determine the merits of his substantive claim.” Costello, 365 U.S. at 285, 81 S.Ct. at 545, 5 L.Ed.2d at 564. Allans argue that the failure of their cross-claim to state a claim upon which relief could be granted was a failure to comply with a precondition requisite to the Court’s going forward to determine the merits of their substantive claim. Accordingly, they assert that the dismissal of the cross-claim was a dismissal for lack of jurisdiction under Rule 41(b) (SDCL 15-6-41(b)) and, therefore, it was not a final judgment on the merits.
We observe, however, that Costello does not address the question of whether dismissal of a cause for failure to state a claim upon which relief can be granted is a dismissal for lack of jurisdiction. Moreover, in Federated Department Stores, Inc. v. Moitie, 452 U.S. 394, 399 n. 3, 101 S.Ct. 2424, 2428 n. 3, 69 L.Ed.2d 103, 109 n. 3 (1981), the United States Supreme Court specifically noted that, “[t]he dismissal for failure to state a claim under Federal Rule of Civil Procedure 12(b)(6) [SDCL 15-6-12(b)(5) ] is a ‘judgment on the merits.’ ”
*364Based upon the foregoing, we find no abuse of discretion by the trial court in dismissing Allans’ complaint. Under SDCL 15 — 6—41(b), the dismissal of their cross-claim in the Croes action for failure to state a claim upon which relief could be granted was a judgment on the merits accorded res judicata effect. Since Allans’ present action merely involves relitigation of the same claim, it is barred by the doctrine of res judicata. Black Hills Jewelry Mfg., supra.
Affirmed.
MORGAN, J., concurs. HENDERSON, J., concurs specially. WUEST, C.J., and SABERS, J., disqualified.. This is a companion appeal to S.W. Croes Family Trust v. Small Business Administration, 446 N.W.2d 55 (S.D.1989).
. Sheesleys and Pfeiffer were not released from their obligations under the contract for deed despite its assignment to Allans.
.SBA and Norwest Bank were made parties to the original action primarily for the purpose of determining the priority of their respective security interests.
. The fact that the dismissal of Allans’ claim against Sheesleys in the Croes action was a dismissal of a "cross-claim" is of no consequence as the dismissal of a cross-claim carries the same effect under SDCL 15-6-41(b) as the dismissal of any other claim. SDCL 15-6-41(c).