
613 So.2d 373 (1993)
James A. PALMER and Lois Palmer
v.
RESOLUTION TRUST CORPORATION, as receiver and conservator for Altus Bank, a Federal Savings Bank.
1911410.
Supreme Court of Alabama.
February 5, 1993.
Marvin L. Stewart, Jr. of Najjar, Denaburg, P.C., Birmingham, for appellants.
Richard H. Walton of Haskell Slaughter Young & Johnston, Birmingham, for appellee.
INGRAM, Justice.
James A. Palmer and his wife Lois Palmer appeal from a summary judgment entered in favor of the Resolution Trust Corporation ("RTC") on its ejectment claim.
The Palmers borrowed $29,000 from First Capital Mortgage Corporation; the loan was evidenced by a note, which was secured by a mortgage on the Palmers' house. First Capital assigned the note and the mortgage to Altus Bank. The Palmers defaulted on the note, and Altus Bank foreclosed on the property according to the terms of the mortgage agreement.
Altus Bank made the highest bid for the property at the foreclosure sale and received *374 a foreclosure deed for the Palmers' house. Altus Bank made a demand for possession of the house on April 24, 1991. The Palmers refused to relinquish possession, and Altus Bank filed this ejectment action.
The Palmers, acting pro se, filed an answer stating that they had filed a bankruptcy petition under Chapter 11 and that they were trying to raise the money to pay the Altus Bank note. The Palmers also stated that they believed they had been "grossly, unfairly treated." Altus Bank moved for a summary judgment on its ejectment claim. The court took the motion under advisement on October 4, 1991, and on October 10, 1991, the Palmers, who had retained counsel in the interim, filed an amended answer and a counterclaim. The amended answer raised these affirmative defenses: (1) a lack of service of process on James Palmer; (2) that Altus Bank had failed to file an affidavit setting forth that there had been no violations of the Mini Code; (3) that the provisions of the note regarding payment of attorney fees violated the Mini Code; (4) that the note was void and unenforceable under the Mini Code because it did not contain a cautionary statement, see § 5-19-6, Ala.Code 1975, and the terms of the note allowed Altus Bank to collect more than the Mini Code allows; and (5) that Altus Bank breached its fiduciary duty by failing to pay the amount bid at the foreclosure sale in excess of the amount owed to Altus Bank. The counterclaim alleged a violation of the Truth-in-Lending Act; wrongful foreclosure; and breach of fiduciary duty. The counterclaim in large part restated the affirmative defenses raised in the Palmers' amended answer.
The trial court denied Altus Bank's motion for summary judgment on October 18, 1991. On November 15, 1991, Altus Bank moved for a reconsideration of the denial of its motion for summary judgment. While this motion was pending, the RTC, in its capacity as receiver and conservator of Altus Bank, was substituted for Altus Bank. After hearing oral argument, the trial court granted the motion for summary judgment on the ejectment claim and entered an order purporting to make the resulting judgment final pursuant to Rule 54(b), Ala.R.Civ.P.
The single issue raised on appeal by the Palmers is whether the facts alleged to support their designated "affirmative defenses" to the RTC's ejectment claim were sufficient to defeat the RTC's motion for summary judgment.
A summary judgment is appropriate upon a showing that no genuine issue of material fact exists and that the moving party is entitled to a judgment as a matter of law. Rule 56, A.R.Civ.P. In reviewing a summary judgment, this Court will view the evidence in a light most favorable to the nonmovant and will resolve all reasonable doubts against the movant. Fincher v. Robinson Bros. Lincoln-Mercury, Inc., 583 So.2d 256 (Ala.1991). The present action was filed in June 1991; therefore, the applicable standard of review is the "substantial evidence rule." See § 12-21-12, Ala.Code 1975. "[S]ubstantial evidence is evidence of such weight and quality that fair-minded persons in the exercise of impartial judgment can reasonably infer the existence of the fact sought to be proved." West v. Founders Life Assurance Co. of Florida, 547 So.2d 870, 871 (Ala.1989). "In determining whether there is substantial evidence to defeat a summary judgment motion, this Court reviews the record in the light most favorable to the non-movant and resolves all reasonable doubts against the movant." Specialty Container Mfg., Inc. v. Rusken Packaging, Inc., 572 So.2d 403, 404 (Ala.1990).
"Actions of ejectment, or those in the nature thereof, are determinable upon the legal, and not the equitable, title." Lyons v. Taylor, 231 Ala. 600, 602, 166 So. 15, 17 (1936). In cases such as this one, where the mortgagee forecloses on the property under a power of sale in the mortgage, "the foreclosure deed executed by the mortgagee or his transferee, or the owner of the debt secured thereby, or his agent or attorney or personal representative, shall operate to convey the legal title to the lands sold to the purchaser at [the foreclosure *375 sale]." § 35-10-5, Ala.Code 1975. The RTC contends that, as receiver for the purchaser at the foreclosure sale and as the holder of the foreclosure deed, it has a right to possession of the property. It further contends that defenses such as those raised by the Palmers in their amended answer, which challenge the underlying debt, cannot be raised against the holder of a foreclosure deed. We agree.
The defenses raised by the Palmers concern the RTC's right to foreclose on its mortgage and are based on alleged irregularities in the underlying note that the Palmers argue made the note void and unenforceable. However, the RTC, as holder of the foreclosure deed, has full legal title, subject only to the right of redemption, see Wragg v. Federal Land Bank, 317 U.S. 325, 328, 63 S.Ct. 273, 275, 87 L.Ed. 300, 303 (1943), and has a right to immediate possession of the property, see Jones v. Butler, 286 Ala. 69, 71, 237 So.2d 460, 463 (1970). The Palmers' "affirmative defenses," which challenge the underlying note, do not defeat the legal title created by the foreclosure deed and the right of the holder of the foreclosure deed to possession of the property at this time. Therefore, the summary judgment in favor of the RTC on its ejectment claim was proper because the Palmers failed to show substantial evidence of a genuine issue of material fact.[1]
However, the Palmers' counterclaims are based on contentions similar to those underlying the affirmative defenses; those contentions challenge the validity of the underlying loan transaction and foreclosure. We make no judgment as to the merits of these contentions; nevertheless, we note that if the Palmers are successful on their counterclaims, they would be entitled to relief from the RTC. Such relief, if merited, would affect the Palmers' right to redeem the property, and might support a claim for damages for wrongful foreclosure.
In addition to seeking compensatory and punitive damages, the Palmers seek to retain their property, based upon their affirmative defenses, which are actually counterclaims seeking to set aside the foreclosure; the RTC is also seeking possession of the property, based upon the interest it acquired at the foreclosure sale. Both parties seek possession of the property, one alleging a right to possession via the foreclosure sale; and the other seeking to retain possession by setting aside the foreclosure sale. We note that the foreclosure sale was conducted under the provisions of the mortgage agreement and that this is the first judicial proceeding to challenge the validity of that sale.
Any action to make the summary judgment on the ejectment claim final by Rule 54(b) certification at this time is premature, because the relief sought by the Palmers is so closely intertwined with the relief sought by the RTC that separate adjudications would pose an unreasonable risk of inconsistent results. This Court in Branch v. SouthTrust Bank of Dothan, N.A., 514 So.2d 1373 (Ala.1987), stated:
"Rule 54(b) is properly applied in a situation where the claim and the counterclaim present more than one claim for relief, either of which could have been separately enforced. Cates v. Bush, 293 Ala. 535, 307 So.2d 6 (1975). Under `appropriate facts,' a partial summary judgment on an original claim may be finally adjudicated pursuant to Rule 54(b), leaving a counterclaim undecided so that the parties can further litigate the issues presented by the counterclaim. Pate v. Merchants National Bank of Mobile, 409 So.2d 797, 798 (Ala.1982). In Pate, a bank filed suit against a promisor and individual guarantors following default on a promissory note. After the bank *376 filed a motion for summary judgment, the defendants filed an amended answer to the bank's complaint, including a counterclaim by one of the defendants. The counterclaim alleged that the bank had wrongfully converted funds deposited in that defendant's checking account. The Pate Court affirmed the trial court's entry of final judgment pursuant to Rule 54(b) in favor of the bank on its motion for summary judgment, leaving the counterclaim undecided and subject to further litigation. Finding that the bank's claim on the note established one claim and that the defendant's counterclaim for conversion of checking account funds formed a separate claim, the Pate Court held that the case `presented the very facts that Rule 54(b) was intended to cover, and the trial judge certainly did not abuse his discretion by applying the rule to it.' Pate, supra, at 800.
"The facts of this case, however, do not present the type of situation that Rule 54(b) was intended to cover. The counterclaim asserted by Branch is based upon an alleged fraudulent representation by an agent of SouthTrust upon which Branch claims he relied in executing the promissory note [that SouthTrust is suing on]. It therefore appears that the issues in the two claims in this case are so closely intertwined that separate adjudication would pose an unreasonable risk of inconsistent results. We must conclude, therefore, that in the interest of justice, the claims should not be adjudicated separately."
514 So.2d at 1374.
The Palmers contend that the loan transaction underlying the foreclosure was void and/or that the foreclosure was illegal. The RTC, which brought this ejectment action as the holder of the foreclosure deed and the party entitled by law to possession of the property, is the receiver and conservator of Altus Bank, which is the assignee of the lender, First Capital Mortgage. Therefore, the RTC is the proper party against which the Palmers may challenge the validity of the underlying loan transaction and the subsequent foreclosure sale.
The RTC's ejectment action and the Palmers' counterclaims are sufficiently intertwined to present the risk of an inconsistent resultsuch as a ruling that the RTC is entitled to possession, as against the Palmers, by virtue of its foreclosure deed, and a later ruling that the foreclosure sale, for which the RTC is responsible, was invalidand also to unreasonably hamper the rights of the Palmers to possession of the house if the underlying note is determined to be void and the subsequent foreclosure is found to be invalid. If the Palmers are not successful on their counterclaims, the RTC will be entitled to damages for the time that the property was wrongfully possessed by the Palmers.
Although the summary judgment in favor of the RTC on its claim for ejectment does not appear to be erroneous, given the record as it existed at the time of the ruling, the certification of that summary judgment as final was premature, given the nature of the Palmers' outstanding counterclaims. Therefore, the certification is set aside and the case is remanded to the trial court.
RULE 54(b), ALA.R.CIV.P., CERTIFICATION SET ASIDE; REMANDED.
MADDOX, ALMON, ADAMS and STEAGALL, JJ., concur.
NOTES
[1]  From our review of the record, we note that the trial court did not consider the merits of the affirmative defenses raised by the Palmers in their amended answer, but entered the summary judgment because the affirmative defenses, which claimed that the underlying note was void and that the foreclosure was improper, did not establish the Palmers' right to possession of the property against the holder of the foreclosure deed, the RTC. Therefore, we do not wish to be understood as making any judgment as to the merits of the contentions raised by the Palmers as the basis of their affirmative defenses and counterclaims.
