
782 So.2d 203 (2000)
ALABAMA INSURANCE GUARANTY ASSOCIATION
v.
SOUTHERN ALLOY CORPORATION.
1981942.
Supreme Court of Alabama.
August 11, 2000.
Rehearing Denied October 27, 2000.
Bennett L. Pugh, Joseph H. Driver, and W. Bradford Kittrell of Carr, Allison, Pugh, Howard, Oliver & Sisson, Birmingham, for appellant.
Barry D. Vaughn and J. Bradley Proctor of Proctor & Vaughn, Sylacauga, for appellee.
BROWN, Justice.
On February 3, 1992, Charles R. Moats suffered an on-the-job injury to his back while employed by Southern Alloy Corporation ("Southern Alloy"). For the rest of 1992, Southern Alloy paid Moats's monthly salary of $4,010, and beginning in 1993 it paid Moats $4,130 per month. Southern Alloy continued to pay Moats's salary until November 1994, when the company terminated his employment on the ground that he had missed six consecutive months of work.
At the time of Moats's injury, Southern Alloy was insured for workers' compensation claims by Employers Casualty *204 Company ("ECC").[1] ECC later became insolvent, and, pursuant to the Alabama Insurance Guaranty Association Act, §§ 27-42-1 to 20, Ala.Code 1975, the Alabama Insurance Guaranty Association ("AIGA") was required to pay certain unpaid claims on behalf of ECC.
In December 1994, AIGA filed a declaratory-judgment action against Southern Alloy and Moats in the Jefferson Circuit Court, seeking a judgment declaring that AIGA was not responsible for workers' compensation payments to Moats. Specifically, AIGA argued that the statutory limitations period applicable to Moats's workers' compensation claim had run; thus, it argued, the claim was not "covered" under the Alabama Insurance Guaranty Association Act. The trial court found that Southern Alloy had paid Moats in recognition of a workers' compensation obligation, and it entered a judgment holding that "Mr. Moats'[s] claim [was] a covered claim and Alabama Insurance Guaranty Association [was] obligated to provide coverage for such claim."
AIGA appealed that judgment to the Court of Civil Appeals. That court affirmed, without opinion, on March 7, 1997. Alabama Ins. Guaranty Ass'n v. Moats (No. 2951344), 705 So.2d 889 (Ala.Civ.App.1997)(table). On July 25, 1997, this Court denied AIGA's petition for certiorari review. Ex parte Alabama Ins. Guaranty Ass'n (No. 1961216), 712 So.2d 1126 (Ala.1997)(table). In August 1997, Southern Alloy filed a motion asking the trial court to order AIGA to pay it the workers' compensation benefits it had paid to Moats. The trial court denied the motion, concluding that it did not have jurisdiction to decide the matter.
In May 1998, Southern Alloy filed a declaratory-judgment action against AIGA in the Talladega Circuit Court, seeking a judgment declaring that AIGA must reimburse Southern Alloy for "moneys paid, together with interest thereon, and all future moneys paid to Charles Moats as a result of his total and permanent disability." Moats intervened as a plaintiff. In March 1999, Moats and AIGA settled and agreed that AIGA would pay Moats a lump sum of $6,217.75, attorney fees of $30,172.25, and compensation at the rate of $327.25 per week. The parties also agreed to the following release:
"This settlement agreement shall in no way operate to prejudice Southern Alloy Corporation's position that it is entitled to reimbursement from AIGA for payments it made to Charles Moats under the Alabama Workers' Compensation Act. Moreover, this settlement agreement shall in no way operate to prejudice the AIGA's position that Southern Alloy Corporation is not entitled to reimbursement for any payments previously made to Charles Moats."
(C. 211.) AIGA and Southern Alloy filed motions for summary judgment. In July 1999, the trial court found:
"9. That there is no evidence or law which prevents the AIGA from being liable to the employer for reimbursement to the employer for all previous workers' compensation indemnity payments.
"10. That AIGA's contention that this cause of action by the employer is barred by [Ala.R.Civ.P.] 13(a) is without merit due to the factual and evidentiary differences in the two claims. Furthermore, the doctrine of res judicata would not bar this cause of action.

*205 "11. That this Court has determined that Moats was permanently and totally disabled as a result of his on-the-job injury in February of 1992 and heretofore ordered the AIGA to make weekly indemnity payments of $327.25 beginning October 1998, for the rest of Moats's life or for the term of his total disability."
The trial court granted Southern Alloy's motion for summary judgment, denied AIGA's motion, and rendered a judgment in favor of Southern Alloy in the amount of $110,800 as reimbursement. AIGA appealed.
The issues raised on appeal are: 1) whether the contract between ECC and Southern Alloy permitted reimbursement for payments Southern Alloy made to Moats; 2) whether Southern Alloy's claim for reimbursement from AIGA for the payments Southern Alloy made to Moats is barred on the basis that it should have been brought as a counterclaim in the initial declaratory-judgment action; and 3) whether the second declaratory-judgment action for reimbursement is barred by the doctrine of res judicata. Because we reverse and remand on the compulsory-counterclaim issue, we pretermit discussion of the remaining issues.
Our review of a summary judgment is de novo. Hobson v. American Cast Iron Pipe Co., 690 So.2d 341, 344 (Ala. 1997).
Southern Alloy's claim for reimbursement from AIGA for payments it made to Moats should have been asserted as a counterclaim in the initial declaratory-judgment action. Rule 13(a), Ala.R.Civ.P., states:
"A pleading shall state as a counterclaim any claim which at the time of serving the pleading the pleader has against any opposing party, if it arises out of the transaction or occurrence that is the subject matter of the opposing party's claim and does not require for its adjudication the presence of third parties of whom the court cannot acquire jurisdiction."
This Court has said:
"The counterclaim rule is based on the equitable principle of collateral estoppel. [Rule 13, Ala.R.Civ.P.], Committee Comments. The principle bars parties in a subsequent proceeding from asserting any matter which might or ought to have been litigated in a prior proceeding. Id. (citing A.B.C. Truck Lines, Inc. v. Kenemer, 247 Ala. 543, 25 So.2d 511 (1946))."
Brooks v. Peoples Nat'l Bank of Huntsville, 414 So.2d 917, 920 (Ala.1982). In Brooks, we stated the test for compulsory counterclaims:
"A counterclaim is compulsory if it `arises out of the transaction or occurrence that is the subject matter of the opposing party's claim.' [Ala.R.Civ.P.] 13(a). Several tests are used by the courts to determine whether the claim arose from the same transaction or occurrence.
"(1) The issues of fact and law raised by the claim and the counterclaim are the same.
"(2) Res judicatawould a subsequent suit on the claim be barred absent the compulsory counterclaim rule?
"(3) Substantially the same evidence will support or refute the claim and the counterclaim.
"(4) There is a logical relationship between the claim and the counterclaim.
"See Lyons, Alabama Practice, § 13.6 (1973), 6 Charles Alan Wright, Arthur *206 R. Miller & Mary Kay Kane, Federal Practice & Procedure, § 1410 (1971).
"While this Court has never specifically adopted a test for determining whether a counterclaim is compulsory, the Committee Comments indicate that it was the intent of the drafters of the rules to adopt the `logical relationship' test. The Committee Comments to Rule 13 state that `[a] counterclaim is compulsory if there is any logical relation of any sort between the original claim and the counterclaim.'
"The Court of Civil Appeals adopted the logical relationship test in O'Donohue v. Citizens Bank, 350 So.2d 1049 (Ala.Civ.App.1977). The logical relationship test denominates a counterclaim as compulsory if (1) its trial in the original action would avoid a substantial duplication of effort or (2) the original claim and the counterclaim arose out of the same aggregate core of operative facts. The claims arise from the same core of operative facts if (1) the facts taken as a whole serve as the basis for both claims or (2) the sum total of facts upon which the original claim rests creates legal rights in a party which would otherwise remain dormant. Id., Revere Copper & Brass, Inc. v. Aetna Casualty and Surety Co., 426 F.2d 709 (5th Cir.1970)."
Brooks, 414 So.2d at 919.
In the instant case, the first and second declaratory-judgment actions arose out of the same aggregate core of operative facts. The amount Southern Alloy paid Moats, the reason for the payments, the insurance policy with ECC, the Alabama Insurance Guaranty Association Act, and the Workers' Compensation Act served as a basis for both claims. Thus, the logical-relationship test was met, and Southern Alloy's claim for reimbursement was a compulsory counterclaim.
"[F]ailure to assert a compulsory counterclaim bars the assertion of that claim in another action." Brooks, 414 So.2d at 920; Ala.R.Civ.P. 13, Committee Comments. Therefore, the trial court improperly entered the summary judgment in favor of Southern Alloy. Accordingly, that judgment is reversed, and the case is remanded for an order or proceedings in the circuit court consistent with this opinion.
REVERSED AND REMANDED.
MADDOX, HOUSTON, SEE, LYONS, JOHNSTONE, and ENGLAND, JJ., concur.
HOOPER, C.J., and COOK, J., dissent.
NOTES
[1]  In the record, this company is also sometimes referred to as Employers Insurance Company of Alabama.
