This is an appeal from a summary judgment granted to the defendant in an attorney malpractice action. We affirm.
The facts involved in this case have been before us on three separate occasions: Staab v. Skoglund, 89 S.D. 470, 234 N.W.2d 45 (1975) (Staab I); Skoglund v. Staab, 269 N.W.2d 401 (S.D.1978) (Staab II); and Skoglund v. Staab, 312 N.W.2d 29 (1981) (Staab III). Since the first of those opinions details the facts at great length, we will not duplicate them all here; we will focus only on the most important events.
Verenna Staab was the owner of a quarter section of land in Miner County, South Dakota. On October 24, 1967, she reached a verbal agreement with Alden Skoglund to sell the land; Skoglund was to make a $500 down payment immediately, with the balance due within thirty days. On November 3, 1967, Staab called attorney Milton Cameron, the defendant in this action, and asked him to represent her in the transaction. Cameron agreed and wrote a confirmation letter to that effect; Cameron also wrote to Skoglund, reminding him of the terms of the contract, including the requirement of full payment within thirty days. On November 7, 1967, Staab executed a warranty deed conveying the land to Skoglund and sent the deed to Cameron. All during this time, Staab emphasized to Cameron that she wanted to close the deal “as soon as possible.” But on November 17, 1967, without any authority from Staab, Cameron executed a sixty-day purchase option in favor of Skoglund; this was done to satisfy the requirements of the Farmers Home Administration, from whom Sko-glund had been trying to secure a loan.
Skoglund was apparently unable to raise the balance of the purchase price within thirty days, since the deadline passed without payment being made to Staab. Staab did, however, on December 13, 1967, cash Skoglund’s down payment check of November 4, 1967. In August of 1968, Skoglund obtained a loan from the Federal Land Bank to pay for the land. Cameron then informed Staab by letter that at long last the land sale had been completed; in the letter he enclosed a check for the balance of the purchase price. Staab refused to accept the check and stated, “I have no intention of selling at this price now .... ”
In Staab I, we held that Staab and Sko-glund entered into an oral contract for sale of the land on October 24, 1967. The writ*465ten ratification of the oral contract occurred when Staab sent letters to Cameron on November 3 and 8, 1967, and when she delivered the warranty deed to him. 89 S.D. at 483, 234 N.W.2d at 52. In Staab II, we held that res judicata did not bar litigation of Staab’s defenses in an action by Skoglund to compel specific performance of the contract. 269 N.W.2d at 402. Finally, in Staab III, we upheld the trial court’s findings that time was not of the essence in the contract and that Skoglund had performed the contract within a reasonable time. 312 N.W.2d at 32.
The present case involves a malpractice suit brought by Staab against Cameron in 1971. Staab alleges that Cameron’s actions as her attorney in this matter proximately caused damages to her involving loss of rents and income from the land, loss of $5,000 because of an increase in value of the land, and a judgment requiring her to specifically perform. On October 23, 1983, the trial court granted summary judgment in favor of Cameron, stating that since Staab had been a party to the three prior cases, she is collaterally estopped from disputing their findings and rulings.
The sole issue raised on appeal is whether the trial court erred in granting summary judgment. Staab contends that the trial court should not have applied the doctrine of collateral estoppel since the issue presented in the litigation between Staab and Cameron was not considered in any of the earlier proceedings between Staab and Skoglund.
This court has held that four tests must be met before the doctrine of collateral estoppel may be applied: 1) Was the issue decided in the prior adjudication identical with the one presented in the action in question? 2) Was there a final judgment on the merits? 3) Was the party against whom the plea is asserted a party or in privity with a party to the prior adjudication? 4) Did the party against whom the plea is asserted have a full and fair opportunity to litigate the issue in the prior adjudication? Cook v. Rezek, 296 N.W.2d 731 (S.D.1980). With regard to the third test, we have also stated that the doctrine may be applied in a civil action when a new defendant affirmatively raises this defense to bar a plaintiff from reasserting issues the plaintiff has actually previously litigated and lost on the merits against another defendant. Black Hills Jewelry Mfg. v. Felco Jewel Ind., 336 N.W.2d 153 (S.D. 1983). Once these tests have been met, collateral estoppel bars relitigation of an essential fact or issue involved in the earlier suit. Melbourn v. Benham, 292 N.W.2d 335 (S.D.1980).
We must agree with Staab that the first test of Cook has not been met in this case. The earlier litigation between Staab and Skoglund dealt with the issues of whether an enforceable contract existed between the parties for the sale of the land, whether Staab was entitled to litigate certain defenses, and whether the trial court erred in granting specific performance of the contract. Those cases did not deal with the identical issue raised here — whether attorney Cameron is liable for the losses suffered by Staab.
However, even though the trial court mistakenly applied the doctrine of collateral estoppel, we conclude that it ruled correctly in granting summary judgment. SDCL 15-6-56(c) states that summary judgment shall be rendered if the pleadings, depositions, answers to interrogatories, and admissions, together with any affidavits, show that there is no genuine issue as to any material fact and that the moving party is entitled to judgment as a matter of law. In making these determinations, the trial court must review the facts in a light most favorable to the nonmoving party. Bourk v. Iseman Mobile Homes, Etc., 316 N.W.2d 343 (S.D.1982); Wilson v. Great Northern Railway Company, 83 S.D. 207, 157 N.W.2d 19 (1968).
Here, there is no real dispute as to the facts; they were well settled in the prior litigation between Staab and Sko-glund. In addition, a review of the rulings in those prior cases indicates that Cameron is entitled to judgment as a matter of law.
*466First, it is clear from Staab I that a valid contract for sale of the land existed before Cameron became involved in the transaction; this contract was ratified by Staab before Cameron ever acted outside the scope of his authority. Second, Staab III indicates that time was not of the essence in the contract and that Skoglund made his payments within a reasonable time under the contract. Consequently, the delays in closing the deal, and any losses suffered therefrom, were a direct result of Staab’s own actions in entering this particular contract with Skoglund. The effect of the Staab decisions is to preclude Cameron from being the cause of the damages alleged by Staab; whatever he did or did not do had no effect on the ultimate result. This is of critical importance, since an attorney is liable in a malpractice action only for losses actually sustained as a proximate result of the conduct of the attorney. Taylor Oil Co. v. Weisensee, 334 N.W.2d 27 (S.D.1983).
In the present case, Staab is essentially attempting to recover damages for having been required to perform what this court earlier held to be a valid contract, a contract which was entered into before Cameron ever became involved. As we stated in Cook v. Rezek:
Nothing could be more conducive to the spawning of a multiplicity of suits than for a court to hold that a party to a contract that has been judicially declared to be valid and binding can later be permitted to seek recovery from a third party for what may in retrospect appear to have been a bad bargain.
296 N.W.2d at 733.
That the trial court may have entered summary judgment for the wrong reason does not bar this court from affirming the judgment. Cook v. Rezek, supra; Owens v. City of Beresford, 87 S.D. 8, 201 N.W.2d 890 (1972).
The summary judgment is affirmed. *
FOSHEIM, C.J., and WOLLMAN and MORGAN, JJ., concur. HENDERSON, J., concurs specially.Despite our ruling, we do not in any fashion approve of the acts done by Cameron which were outside the scope of his authority.