
786 S.W.2d 550 (1990)
M.D. FLEETWOOD, Appellant,
v.
MED CENTER BANK, Appellee.
No. 3-89-054-CV.
Court of Appeals of Texas, Austin.
March 28, 1990.
Rehearing Overruled April 24, 1990.
*552 John T. Anderson, Robert M. Roller, Graves, Dougherty, Hearon & Moody, Austin, for appellant.
H. Miles Cohn, Honigman, Miller, Schwartz & Cohn, Houston, for appellee.
Before SHANNON, C.J., and GAMMAGE and JONES, JJ.
JONES, Justice.
This is a subrogation case. M.D. Fleetwood, appellant, sued Med Center Bank (Med Center), appellee, seeking a judgment declaring that Fleetwood's leasehold interest in certain commercial property was superior to Med Center's interest in the same property, which it acquired at a non-judicial foreclosure sale. Med Center counterclaimed, also seeking declaratory relief. The trial court granted summary judgment for Med Center, declaring that Med Center had become subrogated to rights under a prior deed of trust (also held by Fleetwood) that was superior to Fleetwood's leasehold interest. The court also declared that the foreclosure sale at which Med Center purchased its interest had extinguished Fleetwood's rights under the lease. Fleetwood perfected this appeal, arguing primarily that subrogation of Med Center to his superior lien position is inequitable because it would prejudice him in his capacity as owner of an interest in the leasehold. We will reverse the judgment of the trial court and remand the cause.
The summary judgment record reveals the following facts. Prior to February 3, 1986, Fleetwood was a joint venturer with two other individuals, Messrs. Looney and Bradshaw, in the Center Hill Joint Venture (Center Hill). On February 3, 1986, Fleetwood sold his interest in Center Hill to the joint venture for the following consideration: (1) a promissory note in the original principal amount of $1,391,000 from Center Hill to Fleetwood (the Fleetwood Note); (2) a 55% undivided interest in a lease covering a 12.289-acre tract (the leased premises) in which Center Hill was lessor; and (3) a cash payment. The Fleetwood Note was secured by a deed of trust (the February 3 deed of trust) covering a 24.8376-acre tract owned by Center Hill, and which included the leased premises. Also executed on February 3, 1986, was a lease agreement, under which Center Hill leased the leased premises to Fleetwood, Bradshaw, and Looney, as co-tenants, for a term of ninety-nine years, with Fleetwood holding a 55% undivided interest and Bradshaw and Looney each holding a 22.5% undivided interest. The lease expressly provided that it was made "subject to" the February 3 deed of trust. The parties subsequently filed in the Travis County Real Property Records a fully executed "Memorandum of Lease Agreement," setting forth a property description of the leased premises, the names and respective ownership interests of the parties to the lease, and the beginning and ending dates of the lease term.
On May 15, 1986, Center Hill obtained a loan from Med Center and executed a promissory note in the original principal amount of $1,691,000 (the Med Center Note). The Med Center Note was secured by a deed of trust (the May 15 deed of trust) covering 16.2037 acres, including the leased premises, out of the 24.8376 acres covered in the February 3 deed of trust. The May 15 deed of trust recited that the money being advanced by Med Center was to be used to pay off the Fleetwood Note and that the lien created by the February 3 deed of trust "is hereby expressly acknowledged by Borrower [Center Hill] to be a valid and subsisting lien against the property herein described and is hereby renewed, extended and continued in full force and effect to secure the payment of said note hereby secured." The May 15 deed of trust also contained a general provision that
[a]ny of the proceeds of the Note utilized to take up outstanding liens against all or any part of the Property have been advanced by Lender at Borrower's request and upon Borrower's representation that such amounts are due and are *553 secured by valid liens against the Property. Lender shall be subrogated to any and all rights, superior titles, liens and equities owned or claimed by any owner or holder of any outstanding liens and debts, however remote, regardless of whether said liens or debts are acquired by Lender by assignment or are released by the holder thereof upon payment.
The proceeds of the Med Center Note were used to pay off the Fleetwood Note, whereupon Fleetwood signed a "Full Release of Deed of Trust," prepared by Med Center, acknowledging payment of the note and releasing to its makers the property "free from all liens retained [or] granted ... in said deed of trust to secure the payment of said note." Fleetwood was not a party to and did not sign the May 15 deed of trust.
Center Hill subsequently defaulted on the Med Center Note, and on January 5, 1988, Med Center foreclosed on 3.6476 acres of the property covered by the May 15 deed of trust, bidding $1,000,000. The property purchased by Med Center at the foreclosure sale was entirely within the 12.289-acre leased premises. Looney and Bradshaw subsequently signed documents acknowledging extinguishment of the lease.
Med Center's position on appeal is simple: by advancing funds to pay the Fleetwood Note, Med Center became, as a matter of law, entitled to the benefit of (i.e., subrogated to) all liens securing that note, including the February 3 deed of trust. Because the lease was expressly subordinated to the February 3 deed of trust, the lien created by that deed of trust was superior to the lease. Therefore, Med Center's foreclosure extinguished all rights under the lease.
Fleetwood, on the other hand, argues the existence of an exception to the Texas subrogation rule: subrogation is not allowed where it would result in prejudice to the rights of others, most often holders of "intervening equities." Fleetwood asserts that, under the circumstances of the present case, subrogation of Med Center to his prior lien rights would prejudice his rights as the owner of an interest in the lease.
The standards for granting a summary judgment are well established:
(1) The movant for summary judgment has the burden of showing that there is no genuine issue of material fact and that it is entitled to judgment as a matter of law;
(2) In deciding whether there is a disputed material fact issue precluding summary judgment, evidence favorable to the non-movant will be taken as true;
(3) Every reasonable inference must be indulged in favor of the non-movant and any doubts resolved in its favor.
Nixon v. Mr. Property Management Co., 690 S.W.2d 546, 548-49 (Tex.1985).
We note initially the rule that "a lease executed before the deed of trust lien is superior to and not extinguished by foreclosure, and the purchaser at the trustee's sale becomes the new landlord." United General Ins. Agency v. American Nat'l Ins. Co., 740 S.W.2d 885, 886 (Tex.App. 1987, no writ). Thus, if Med Center was not subrogated to the rights under the February 3 deed of trust, its foreclosure must have proceeded only under its May 15 deed of trust, which was later in time and, therefore, junior to the lease. If, however, Med Center was subrogated to the rights under the February 3 deed of trust, its lien rights were superior to the lease, and its foreclosure extinguished the lease.
Subrogation is a doctrine of equity, and is the substitution of another person in the place of a creditor, so that the person in whose favor it is applied succeeds to the rights of the creditor in relation to the debt. Platte v. Securities Inv. Co., 55 S.W.2d 551, 553 (Tex.Comm.App.1932, jdgmt adopted); Means v. United Fidelity Life Ins. Co., 550 S.W.2d 302, 308 (Tex.Civ. App.1977, writ ref'd n.r.e.). It has been called a legal fiction by which an obligation, extinguished by a payment made by a third person, is treated as still subsisting for the benefit of this third person. First Nat. Bank v. Ackerman, 70 Tex. 315, 8 S.W. 45, 47 (1888). See generally Annot. 99 Am.St.Rep. 474 (1904).
*554 There are two kinds of subrogation: "legal," which arises by operation of law, and "conventional," which arises by agreement of the parties. See Ramey v. Cage, 90 S.W.2d 626 (Civ.App.1935, no writ). Legal subrogation is always controlled by principles of equity. Galbraith-Foxworth Lumber Co. v. Long, 5 S.W.2d 162 (Tex. Civ.App.1928, writ ref'd). Circumstances involving conventional subrogation, on the other hand, are not always governed exclusively by equitable principles.[1]See Lexington Ins. Co. v. Gray, 775 S.W.2d 679, 683-84 (Tex.App.1989, writ denied).
Both parties to this appeal agree that principles of equity control here. In addition, the holder of the senior lien (Fleetwood) was not a party to the subrogation agreement. For these reasons and others we will discuss later, we conclude that principles of equity do govern the present case, notwithstanding the existence of a subrogation agreement between Med Center and Center Hill.
Subrogation has been recognized as an important doctrine and has traditionally received favorable treatment in Texas. See Diversified Mortgage Investors v. Lloyd D. Blaylock General Contractor, Inc., 576 S.W.2d 794, 807 (Tex.1978). One of the three commonly recognized situations in which subrogation arises in mortgage law is when a lender or other third party advances money to pay off a prior lien on property. See G. Nelson & D. Whitman, Real Estate Finance Law §§ 10.1, 10.5 (2d ed. 1985). Texas courts have long held that
[o]ne who advances money to pay off an incumbrance on realty at the instance of either the owner of the property or the holder of the incumbrance, either on the express understanding, or under circumstances from which an understanding will be implied, that the advance made is to be secured by a first lien on the property, is not a mere volunteer, and, in the event the new security is for any reason not a first lien on the property, the holder of such security ... will be subrogated to the rights of the prior incumbrancer under the security held by him, unless the superior or equal equities of others would be prejudiced thereby....
Sanger Bros. v. Ely & Walker Dry Goods Co., 207 S.W. 348, 349 (Tex.Civ.App.1918, writ ref'd); see also Hicks v. Morris, 57 Tex. 658 (1882); Dillon v. Kauffman & Runge, 58 Tex. 696 (1883); Kone v. Harper, 297 S.W. 294, 297 (Tex.Civ.App.1927), aff'd sub nom. Ward-Harrison Co. v. Kone, 1 S.W.2d 857 (Tex.Comm.App.1928, jdgmt adopted); Houston Inv. Bankers Corp. v. First City Bank, 640 S.W.2d 660, 663 (Tex.App.1982, no writ). Therefore, in lending Center Hill funds to pay off the Fleetwood Note, Med Center was not a mere "volunteer" ineligible for subrogation as a matter of law.
However, courts have generally recognized the importance of the limitation contained in the last clause of the above quotation: "unless the superior or equal equities of others would be prejudiced thereby." See Annot., 70 A.L.R. 1396, 1413-17 (1931). The few Texas cases that have directly addressed this limitation have acknowledged its validity. For example, in Fievel v. Zuber, 67 Tex. 275, 3 S.W. 273, 275 (1887), the court stated that, although subrogation may generally be accomplished through an agreement between the debtor and a third party, without the consent of the creditor, "it cannot be done as to a part of the debt, or in any manner to affect the rights of the creditor to his prejudice." The rule denying immediate enforcement of subrogation rights to one who only partially discharges a lien is grounded in the same equitable considerations:
[A] person who is subrogated to the rights or securities of another may not enforce the same until the claim of the latter against the debtor has been paid in full. This rule is for the protection of the prior creditor, who cannot equitably be compelled, without his consent, to *555 place another on equal footing with respect to security held for the satisfaction of the entire indebtedness.
Providence Inst. for Savings v. Sims, 441 S.W.2d 516, 519 (Tex.1969).
In Providence, the Supreme Court held that the lender, which had advanced funds to pay off a prior lien, was entitled to subrogation as a matter of law. However, the court's opinion mentions no less than four times the absence of any prejudice to the intervening lienholder or any other party. 441 S.W.2d at 519-21. The clear implication is that the existence of such prejudice might well have changed the result.[2]
In the present case, Fleetwood asserts that he would be prejudiced by a subrogation of Med Center to the rights created by the February 3 deed of trust. His argument in this regard is best summarized in the following passage from one of his briefs:
In this case, subrogation would result in prejudice to Fleetwood's property interests and would nullify valuable bargained-for contractual rights. Fleetwood carefully crafted the transaction by which the joint venture purchased his partnership interest by insisting that his valuable leasehold interest be subordinate only to the lien over which he had full control. In that way, he was assured that his leasehold interest was fully protected. If the indebtedness were paid in full, Fleetwood contracted simply to extinguish his first lien, as a result of which his leasehold interest would attain top priority. On the other hand, had the debtor defaulted, as Med Center speculates in its brief, Fleetwood nonetheless retained full control over his lien and, thus, the fate of this leasehold interest. He need not have foreclosed his lien, as Med Center insists. He could have resorted to other security for the debt (a letter of credit was posted), he could have pursued a judgment against the debtor or its partners individually, or he could have foreclosed the deed of trust lien against property not included within the lease; none of these would have altered the status of Fleetwood's first lien or his leasehold interest. Thus, simply by exercising his contractual rights, Fleetwood could have obtained satisfaction of his debt and held his leasehold interest unburdened by any superior encumbrance.
(Emphasis in original.) It is in this loss of "control" or "protection" for his leasehold interest that Fleetwood asserts prejudice to his rights.
As an owner of an interest in the leasehold, Fleetwood stood in roughly the same position as a junior lienholder, in the sense that he owned an interest in land that could be cut off by the foreclosure of a more senior lien. We agree that Fleetwood's ownership of that senior deed-of-trust lien provided some degree of protection for his leasehold interest. As long as he owned the senior lien, he had several options to exercise in the event of a default by the debtor. With the deed-of-trust lien in the hands of a third party, however, that advantage would be lost. Thus, the subrogation of Med Center to the rights created by that deed of trust would place Fleetwood in a somewhat worse position. Fleetwood cites us to three cases that, although not directly on point, support the proposition that a junior lien is more secure when its holder simultaneously owns a more senior lien. See Tillman v. Stewart, 104 Ga. 687, 30 S.E. 949 (1898); Butler County Nat. Bank v. St. Michael's Greek Catholic Church, 272 Pa. 440, 116 A. 390 (1922); Strelitz v. First Wisconsin Nat. Bank, 220 Wis. 443, 264 N.W. 649 (1936).
We conclude that a transfer of the rights under a senior lien away from one *556 who also holds a junior lien is a cognizable prejudice to the junior lienholder, to be considered by a court as part of the totality of the circumstances in deciding whether to grant subrogation to a third party who advanced money to pay off the senior lien. Likewise, the loss of protection for Fleetwood's leasehold interest is such a cognizable prejudice. Accordingly, we hold that Med Center failed to show that it was entitled to judgment as a matter of law.
In addition, we conclude that fact issues exist that preclude summary judgment in this case. Med Center argues that it intended that the lien created by the February 3 deed of trust be extended, not extinguished, when it paid off the Fleetwood Note. Fleetwood argues that he intended just the opposite. Both parties presented affidavits to the trial court in which they set forth their respective intentions. This Court agrees that, under the circumstances of the present case, the knowledge and intentions of the parties as to all aspects of this transaction are relevant considerations for the trial court in deciding whether to grant subrogation. However, such issues are rarely, if ever, appropriate for summary judgment. See Allied Chemical Corp. v. DeHaven, 752 S.W.2d 155, 158 (Tex.App.1988, writ denied); Bankers Commercial Life Ins. Co. v. Scott, 631 S.W.2d 228, 231 (Tex.App. 1982, writ ref'd n.r.e.); see also Spoljaric v. Percival Tours, Inc., 708 S.W.2d 432, 434 (Tex.1986) ("Intent is a fact question uniquely within the realm of the trier of fact because it so depends upon the credibility of the witnesses and the weight to be given to their testimony."). We do not believe that the summary judgment evidence in the record before us meets the requirements of Rule 166a of the Rules of Civil Procedure for basing summary judgment on the testimony of an interested witness, for the reasons that it was not free from contradictions and inconsistencies, and could not have been readily controverted. Tex.R.Civ.P. 166a(c).
Moreover, although summary judgment may, in an appropriate case, be granted in an equitable action, Elias v. Manis, 292 S.W.2d 836 (Tex.Civ.App.1956, writ ref'd), we think it appropriate to express a cautionary note. Summary judgment in a case governed by equitable principles presents even more potential difficulties than in the usual summary judgment case. Summary judgment may be granted only where the summary judgment evidence affirmatively shows that "there is no genuine issue as to any material fact." Tex.R. Civ.P. 166a(c). In a case governed by legal principles, the elements of the plaintiff's cause of action provide relatively well-defined guidelines for determining what is a "material fact." The court need only review the summary judgment evidence and, on the basis of established rules of relevancy, decide if that evidence establishes the factor its absenceas a matter of law.
In a case governed by equitable principles, on the other hand, there are no such clear guidelines for determining what is a material fact. The main guiding principle is the prevention of an unfair or unjust result. See Johnson v. Cherry, 726 S.W.2d 4, 8 (Tex.1987) ("The equitable power of the court exists to do fairness and is flexible and adaptable to particular exigencies, `so that relief will be granted when, in view of all the circumstances, to deny it would permit one party to suffer a gross wrong at the hands of the other.'"). Thus, the court in an equitable action must often take into consideration a myriad of circumstances and factors that would be immaterial in a legal action. This places an extraordinary burden on litigants in attempting to show and courts in purporting to concludethat there is no genuine issue as to any material fact.
Further, trial courts have a measure of discretion "in all cases governed by equitable principles." Craddock v. Sunshine Bus Lines, Inc., 134 Tex. 388, 133 S.W.2d 124, 126 (1939); see also Mathews v. First Citizens Bank, 374 S.W.2d 794, 797 (Tex. Civ.App.1963, writ ref'd n.r.e.) ("The granting or denial of equitable relief lies within the sound discretion of the trial court...."). "Discretion" has been said to arise when an act "may be performed in one [of] two or more ways, either of which *557 would be lawful, and where it is left to the will or judgment of the performer to determine in which way it shall be performed." Texas Indemnity Ins. Co. v. Arant, 171 S.W.2d 915, 919 n. 1 (Tex.Civ.App.1943, writ ref'd w.o.m.); see also Missouri-Kansas-Texas R.R. v. Bush, 310 S.W.2d 404, 408-09 (Tex.Civ.App., writ ref'd n.r.e.), cert. denied, 358 U.S. 827, 79 S.Ct. 45, 3 L.Ed.2d 67 (1958).
This notion of discretion is not altogether consistent with the concept of summary judgment, the purpose of which is to eliminate patently unmeritorious claims and untenable defenses. Gulbenkian v. Penn, 151 Tex. 412, 252 S.W.2d 929, 931 (Tex. 1952); Starnes v. Holloway, 779 S.W.2d 86, 89 (Tex.App.1989, writ denied). As one noted Texas jurist stated,
If there is a range of equitable discretion within the authority of the trial judge apart from his authority to find facts, reviewable only for abuse of discretion, the matters which may be so determined are more nearly analogous to fact inferences to be drawn from the entire record than to conclusions of law resulting from application of established rules to undisputed facts. Consequently, such discretion should not be exercised without development of the evidence at a full trial. It cannot properly be exercised on affidavits and other summary-judgment evidence designed to show that the moving party is entitled to judgment as a matter of law. Summary judgment is proper only when the summary-judgment proof shows that no question of equitable discretion exists.
Reynolds-Penland Co. v. Hexter & Lobello, 567 S.W.2d 237, 245 (Tex.Civ.App.1978, writ dism'd by agr.) (Guittard, C.J., dissenting). To the extent that Judge Guittard may have been asserting that summary judgment is never proper in equity cases, we are constrained by Elias, 292 S.W.2d 836, to disagree. His logic applies strongly, however, in cases such as the present one, where the summary judgment record does not fully develop the facts on which the trial court's equitable discretion must be exercised, and where the facts that are developed, though uncontroverted, can give rise to more than one reasonable inference. Cf. Le Master v. Fort Worth Transit Co., 138 Tex. 512, 160 S.W.2d 224, 226 (1942) ("[I]f the evidence is not conflicting, but reasonable minds might differ as to its effect, still a fact issue is presented."). Trial courts should, therefore, be even more cautious than usual before granting summary judgments in equitable actions.
For all of the foregoing reasons, we conclude that the present record does not show that there is no genuine issue as to any material fact, nor does it show that Med Center is entitled to judgment as a matter of law. Except as expressly stated herein, this conclusion should not be construed as indicating our opinion as to the merits of any factual issue or discretionary matter in this case.
The judgment of the trial court is reversed and the cause is remanded for further proceedings.
GAMMAGE, J., not participating.
NOTES
[1]  It might be more accurate to say that, in some circumstances, the existence of an express subrogation agreement between the parties presents an "overriding equity." See Rock River Lumber Corp. v. Universal Mortgage Corp., 82 Wis.2d 235, 262 N.W.2d 114, 117 (1978); Martin v. Hickenlooper, 90 Utah 150, 59 P.2d 1139, 1151-52 (1936).
[2]  We do not read Providence as requiring, as a matter of law, a denial of subrogation in every instance in which some prejudice exists. Rather, we conclude that, when prejudice exists, the trial court should, in exercising its equitable discretion, consider the totality of the circumstances, of which the existence of prejudice to one or more parties is a part. Many factors may affect the weight to be given the prejudice, including the true extent of prejudice, the foreseeability of potential prejudice, and whether the party claiming prejudice could have avoided all or part of the prejudicial effect.
