
449 N.W.2d 537 (1989)
234 Neb. 124
TRI-COUNTY BANK AND TRUST COMPANY, Appellant,
v.
Norma L. WATTS, Appellee.
No. 88-190.
Supreme Court of Nebraska.
December 29, 1989.
*538 Gerald P. Laughlin, Michael G. Lessmann, and Jill Robb Ackerman of Baird, Holm, McEachen, Pedersen, Hamann & Strasheim, Omaha, for appellant.
Terry M. Anderson of Hauptman, O'Brien, Wolf & Hadley, P.C., Omaha, for appellee.
HASTINGS, C.J., and BOSLAUGH, WHITE, SHANAHAN, GRANT, and FAHRNBRUCH, JJ.
*539 BOSLAUGH, Justice.
The plaintiff, Tri-County Bank and Trust Company, formerly known as Southroads Bank (Bank), brought this action in the district court to recover the principal amount of $157,117 plus interest due on a promissory note executed by the defendant, Norma L. Watts, on November 21, 1980.
In its petition filed September 20, 1985, the Bank alleged that for value received, Watts executed a note payable to the order of the Bank in the original principal sum of $160,000; that there remained outstanding on the note the principal sum of $157,117 plus accrued interest of $40,631.93; that the note was payable in monthly installments of $2,250, with all remaining principal and interest due on or before November 21, 1985; that in the event of Watts' failure to make payments when due, the entire balance of principal and interest would become due and payable immediately; that the Bank was the owner and holder of the note; and that the Bank made demand upon the defendant to pay all principal and interest due under the note, but Watts refused and neglected to make any payments. The note, a copy of which was attached to the petition, provided: "This Note is secured by a certain Mortgage...."
In her answer, Watts generally denied the Bank's allegations and raised the following affirmative defenses:
2. For her further answer, and by way of affirmative defense, Defendant states that the Note and Mortgage became merged with the Defendant [sic] at the time of its foreclosure of property located at 11th and Jackson Streets in the City of Omaha, Douglas County, Nebraska, which property served as security for the alleged note.
3. For her further answer and by way of affirmative defense, Defendant states that the real estate which functions as security for the purported note has a value more than sufficient to satisfy the alleged indebtedness represented by said note and that the Defendant [sic] is now in possession of said real estate and would be unjustly enriched by proceeding with attempted recoveries on the note.
4. For her further answer, and by way of affirmative defense, Defendant states that if the allegations contained in the Plaintiff's Petition concerning the note are approved, Defendant operates as a surety upon said obligations and becomes subrogated to the rights of the mortgagee to the underlying collateral represented by the mortgaged real estate and that such value of that interest is more than sufficient to offset any alleged indebtedness claimed by the Plaintiff.
The case was submitted to the court on a joint stipulation of facts with exhibits. Where the parties stipulate to all the facts at trial, the Supreme Court reviews the case as if trying it originally in order to determine whether the facts warranted the judgment. Dugdale of Nebraska v. First State Bank, 227 Neb. 729, 420 N.W.2d 273 (1988).
The record shows that on November 21, 1980, Watts and the Bank entered into a term loan agreement wherein the Bank agreed to lend Watts $160,000 for a period of 5 years or to the date of default. The loan was evidenced by the promissory note at issue here. To secure the indebtedness, Watts also executed a mortgage on the following-described real estate:
Lots 1 and 2 in Block 175 in the Original City of Omaha, as surveyed and lithographed, subject to an easement granted to the Union Pacific Railroad recorded on January 10, 1918, in Book 411 at Page 532 in the office of the Register of Deeds of Douglas County,
and
Lot 8 in Block 166 in Original City of Omaha, as surveyed and lithographed.
On December 29, 1981, Watts sold the "North 121 Feet of Lots 1 and 2, Block 175, City of Omaha, (also known as 1101 Jackson Street, Omaha, Nebraska)" to Jay B. Smiley for $249,312. This sale was made subject to the Bank's first mortgage on the *540 property, and Smiley agreed to pay for the property as follows:
a) Approximately $159,812 by taking title to the property subject to a first mortgage in that amount held by Southroads Bank, Bellevue, Nebraska.
b) Approximately $20,000 by taking title to such property subject to a second mortgage held by James A. Morrison.
c) The balance of $69,500 by executing and delivering to [Watts] at the closing a Promissory Note....
Smiley was a director of the Bank at the time of the sale, but this transfer was to Smiley individually. The Bank did not orally or in writing expressly authorize the sale, nor did it expressly agree to substitute Smiley for Watts as the debtor on Watts' note. Watts believed, however, that the Bank knew of and had no objection to the sale.
The Bank made Smiley a loan of $200,000 on May 20, 1982, taking a second mortgage on the real estate as security for the loan. Smiley's "Single Payment Note and Security Agreement" provided:
To secure payment of all Debtor's present and future indebtedness and liabilities of whatever nature to [Bank] and all renewals and extensions thereof, the covenants in this agreement, and such advances as shall be made by Secured Party under this agreement for the protection of the collateral, the Debtor for value received grants to the [Bank] a security interest in the following property and any and all additions, accessions, and substitutions thereto or therefore, hereinafter called the Collateral, and any proceeds of such Collateral: Second MortgageLots 1 and 2 in Block 175 In the Original City of Omaha, as surveyed and lithographed, subject to an easement granted to the Union Pacific Railraod [sic ] recorded January 10, 1918, in book 411 at Page 532 in the office of the Register of Deeds of Douglas County.

(Emphasis supplied.) Smiley executed the mortgage on June 4, 1982.
Smiley subsequently defaulted on his note. The Bank brought a foreclosure action against him in the district court for Douglas County on January 21, 1983, and received a judgment on November 26, 1984, in the amount of $283,096.31 plus interest. The decree provided that the mortgage held by the Bank, as recorded, constituted a lien on the following real estate:

The North 121 feet of Lots 1 and 2 in Block 175 in the original City of Omaha, as surveyed and lithographed, in Douglas County, Nebraska, subject to an easement granted to the Union Pacific Railroad recorded on January 10, 1918, in Book 411 at Page 532 in the office of the Register of Deeds of Douglas County, Nebraska, and subject to any prior, valid mortgages or encumbrances of record.

(Emphasis supplied.)
The property was sold to the Bank at a public sheriff's sale on June 25, 1985, for $189,000. The sale was confirmed by the district court on July 31, 1985. Watts was not a party to the foreclosure action and had no knowledge of the action, no notice of the sheriff's sale, and no notice of any hearing to confirm the sale. The Bank's records did not reflect that Watts was given written notice of the foreclosure action or the sheriff's sale.
Appraisals attached as exhibits to the joint stipulation estimate the market value of the property foreclosed to have been $200,000 as of November 15, 1980; $490,000 as of June 1, 1982; $375,800 as of June 6, 1984; $370,000 as of December 10, 1985; and $370,000 as of February 2, 1987.
The district court entered judgment for Watts, denying the Bank recovery on Watts' note, finding:
The Defendant cannot be held liable for the full balance of the note plus interest. Plaintiff must bear responsibility for taking as security from Jay Smiley property which was already fully encumbered by a prior mortgage to the Plaintiff.
By foreclosing on the property, the Plaintiff in effect sold Defendant's collateral for the note in question without notice to the Defendant.

*541 Although, the Plaintiff argues mightily that Defendant does not have a surety's interest in the foreclosed property, the Court can see it no other way.
The Plaintiff [sic] is discharged of her debt ... to the extent of the land's value at the time of the foreclosure sale, June 25, 1985.
The Bank has appealed, contending the district court erred (1) in determining that the mortgage securing Watts' note merged with the fee title to the real estate obtained by the Bank in connection with the foreclosure of Smiley's second mortgage on the property; (2) in finding that Watts had a surety's interest in the real estate foreclosed by the Bank; (3) in determining that Watts was discharged from her debt because the appraised value of the real estate at the time of the foreclosure sale exceeded the total amount of the Bank's successful foreclosure bid and the debt evidenced by Watts' note; (4) in finding that the Bank could not recover on Watts' note because it foreclosed on Smiley's second mortgage on the real estate at a time when the property was fully encumbered by Watts' first mortgage; and (5) in finding that the Bank could not separately foreclose the second mortgage and purchase the real estate at a sheriff's sale, subject to Watts' first mortgage, without having given notice to Watts.
The question presented in this appeal may be stated as follows: Where a mortgagee holds both first and second mortgages, what is the effect of the mortgagee's purchase of the property at the foreclosure sale of the junior mortgage on its rights as to the debt secured by the senior mortgage?
The general rule is that if the holder of both a junior and senior mortgage forecloses the junior and buys at the foreclosure sale, in the absence of an agreement to the contrary, the mortgagor's personal liability for the debt secured by the first mortgage is extinguished. The reason given is that upon a foreclosure sale under a junior mortgage the purchase is subject to the payment of the prior lien with the result that the mortgagor has an equitable right to have the land pay the mortgage before his personal liability is called upon, and the purchaser, if he owns or acquires the mortgage, will not be permitted to enforce it against the mortgagor personally. The second mortgagee purchaser is presumed to have made allowance for the prior lien in making his bid. The following cases illustrate the application of the rule.
In Wright v. Anderson, 62 S.D. 444, 253 N.W. 484 (1934), the defendant Anderson borrowed $17,000 from Mitchell Trust Company and with his wife executed seventeen $1,000 promissory notes secured by a first mortgage on several parcels of real estate. J.H. Wright subsequently loaned Anderson $23,000 and received a promissory note secured by a second mortgage on the land previously mortgaged and 640 acres of other real estate. The second mortgage provided that it was subject to the $17,000 mortgage given to Mitchell Trust Company. Mitchell Trust Company then sold and assigned to J.H. Wright the seventeen $1,000 notes and the mortgage securing the notes.
At the time of his death, J.H. Wright was the owner of the seventeen $1,000 notes, the $23,000 note, and the two mortgages securing the notes. His executrix, Rosa Wright, brought an action to foreclose the $23,000 second mortgage, secured a judgment, and purchased the property at a sheriff's sale for $36,190 (the amount then due on the $23,000 mortgage).
Rosa Wright then sought a personal judgment on the seventeen $1,000 notes. The defendants claimed, and the trial court found, that Rosa Wright's acquisition of the property upon foreclosure of the second mortgage satisfied the indebtedness secured by the first mortgage and that the defendants were no longer liable thereon.
On appeal, the Supreme Court of South Dakota determined that the defendants' personal liability on the notes had been extinguished as a result of the foreclosure of the second mortgage.
When a purchaser buys land subject to a mortgage (without assuming it), he does not become personally liable thereon, but *542 nevertheless an equitable relation arises between himself and the original mortgagor. By virtue of having purchased subject to the [first] mortgage, the land becomes the primary fund for the payment of the mortgage debt.... In theory, as between the purchaser and the original mortgagor, the mortgagor has already advanced to the purchaser the amount of the mortgage debt by receiving that much less than the market value of his land at the time of the sale. In other words, it is presumed that the purchaser of land subject to a mortgage deducted the amount of the incumbrance from the market value of the land when he bought. The mortgagor therefore has an equitable right to have the land pay the mortgage before his personal liability is called upon and the purchaser will not be permitted to retain the land, go out and acquire the mortgage, and enforce the same against the mortgagor personally. The doctrine has application whenever land is purchased subject to a mortgage, whether the purchase be by private treaty or at foreclosure or execution sale. In any such case the only thing that can be sold, and the thing that is sold and purchased, is an equity of redemption; and a purchaser who was willing to pay money for the equity of redemption will not be heard to say, as against the persons liable on the prior incumbrance, that the land (the primary fund for the discharge of the prior incumbrance) is not worth the amount thereof. It follows therefore that when the purchaser, retaining the land, acquires the prior debt, although he is not personally liable thereon, he is the owner of the res which ought to discharge the debt as between himself and the mortgagor and he will not be permitted to retain the res and at the same time to say it is insufficient to satisfy the debt. Consequently there is, in essence, a coincidence of the capacities of debtor and creditor and, as between the purchaser and the original mortgagor, the debt is extinguished, notwithstanding the fact that there may be no merger and notwithstanding the fact that the purchaser may maintain the validity of the lien upon the land as between himself and an intervening subsequent incumbrancer who was a stranger to his purchase.
(Emphasis supplied.) Wright v. Anderson, supra, 62 S.D. at 449-50, 253 N.W. at 487.
Although Wright argued that in making her bid she did not, in fact, take into consideration or allow for the amount of the first mortgage, the court stated:
To that we believe the answer must be that she should have done so and unless she can make a showing of fraud, excusable mistake, or something of that sort, sufficient to justify vacating the sale, she must be deemed to have done so. She knew of the existence of the first mortgage for she owned it herself. She must be charged with knowing, as a matter of law, that the only thing that could be offered for sale in foreclosure of the second mortgage was the equity of redemption from the first mortgage.
Id. at 452, 253 N.W. at 488.
In Retirement Bd v. Ren-Cen Club, 145 Mich.App. 318, 377 N.W.2d 432 (1985), leave to appeal denied 425 Mich. 875, 388 N.W.2d 680 (1986), the plaintiff, board of trustees of the general retirement system of the city of Detroit, loaned the defendant $1.1 million in June 1978 and received a promissory note for that amount secured by a first mortgage on real estate located in Detroit. In August 1980, the plaintiff loaned the defendant $500,000, receiving a promissory note for that amount secured by a second mortgage on the same property. The defendant defaulted on both loans. The plaintiff foreclosed its second mortgage, purchased the property at the foreclosure sale for the amount owed on the second note, took possession of the property, and commenced an action to recover the amount owed on the first note. The fair market value of the property was more than $3 million on the date of the foreclosure sale.
The trial court granted the plaintiff's motion for summary judgment, and the defendant appealed. In reversing the judgment of the trial court, the Michigan Court of Appeals held that the debt secured by the first mortgage was discharged when the plaintiff acquired the mortgaged property *543 at the foreclosure sale on the second mortgage:
Michigan follows the general rule about mergers mentioned in Belleville Savings Bank v Reis [136 Ill. 242, 26 N.E. 646 (1891)]. At law, whenever a greater and lesser estate or a legal and equitable estate coincide in the same person, the lesser or equitable estate is destroyed by merger. Equity, however, will generally prevent a merger if the parties did not intend a merger, and an intent to avoid a merger will ordinarily be inferred where it is in the interest of the person holding the various estates to keep them separate. [Citation omitted.] Plaintiff must look to equity here to prevent the merger which would be automatic at law. As Belleville Savings Bank v Reis, Wright v Anderson, and similar cases show, equity is of no assistance to plaintiff under the circumstances presented here, because plaintiff seeks to avoid a merger to enable it to obtain, in effect, a double recovery.
The price at a foreclosure sale on a second mortgage is depressed to reflect the outstanding first mortgage. A third party who purchases the property at the foreclosure sale on the second mortgage would have to satisfy the debt secured by the first mortgage in order to prevent the mortgagee of the first mortgage from asserting a superior claim to the property. Because plaintiff itself is the mortgagee of the first mortgage, plaintiff need not concern itself with the possibility that the mortgagee of the first mortgage would assert a superior claim. Plaintiff wants to obtain the price advantage of purchasing at a second mortgage sale without the disadvantage of having to satisfy the debt secured by the first mortgage in order to obtain uninterrupted enjoyment of the property. Equity will not assist plaintiff to achieve such a result.
Retirement Bd v. Ren-Cen Club, supra, 145 Mich.App. at 325-26, 377 N.W.2d at 436. See, also, Zastrow v. Knight, 56 S.D. 554, 229 N.W. 925 (1930); Weir & Russell Lbr. Co. v. Kempf, 234 Iowa 450, 12 N.W.2d 857 (1944); McDonald v. Magirl, 97 Iowa 677, 66 N.W. 904 (1896); Belleville Savings Bank v. Reis et al., 136 Ill. 242, 26 N.E. 646 (1891); Maulding v. Sims, 213 Ill.App. 473 (1919); Ruther v. Thomas, 43 Colo.App. 435, 604 P.2d 703 (1979); Baxter v. Redevco, Inc., 279 Or. 117, 566 P.2d 501 (1977).
In the present case, Smiley purchased from Watts a portion of the mortgaged property, subject to the Bank's first mortgage, and did not assume responsibility for the payment of Watts' debt. The terms of the sale to Smiley reflected the outstanding first mortgage on the property.
The Bank subsequently purchased the property at a foreclosure sale on June 25, 1985, for $189,000. The Bank itself was the holder of the first mortgage and, under Wright v. Anderson, 62 S.D. 444, 253 N.W. 484 (1934), is presumed to have bid the value of the property less the amount of the prior encumbrance. Furthermore, as the trial court noted, "The appraisal of June 7 [sic], 1984 ... valued the land at $375,000. The appraisal of December 10, 1985 ... placed the value of the land at $370,000. The Plaintiff's reduced payment for the land obviously reflects the Defendant's interest of at least $157,117.00." The foreclosure decree itself specifically stated that the second mortgage held by the Bank constituted a lien on the real estate subject to any prior, valid mortgages or encumbrances of record.
The land, therefore, was the primary fund for the payment of Watts' mortgage debt, and Watts had the right to require that the land be exhausted in the payment of her debt. The trial court found that the value of the land at the time of the foreclosure sale was in excess of Watts' debt to the bank, and Watts' personal liability on her note has been extinguished.
The judgment of the district court is affirmed.
AFFIRMED.
CAPORALE, J., not participating.
