OPINION OF THE COURT
Lupiano, J.On June 24, 1969, plaintiffs assignor, Irving Trust Company, entered into a building loan agreement with Uris Capitol Corporation a subsidiary of defendant Uris Buildings Corporation, pursuant to which Irving agreed to and did lend to Uris Capitol $62,000,000 to be used for the construction of a 48-story office building, now known as 1633 Broadway. The agreement provided that the loan shall be evidenced by a note and shall be secured by a leasehold mortgage covering the borrower’s leasehold interest in the land and the improvements thereon. Simultaneously with the execution and delivery of the building loan agreement and in order to induce Irving to enter into the agreement, the defendant executed and delivered to Irving an agreement (the “Guaranty”) by which defendant guaranteed “that the Borrower, or the [defendant] for it, will fully and faithfully perform all of the obligations of said Building Loan Agreement on its part to be * * * performed with respect to the completion of the buildings.” (Emphasis supplied.) Essentially, defendant guaranteed to Irving, its successors and assigns, that the building would be completed in accordance with the plans and specifications free from any liens and that Irving would be indemnified for the damages it might suffer if this obligation was not fulfilled and that Irving would be reimbursed for expenses incurred by Irving should it choose to complete the building. Thus, Irving as lender obtained, in addition to the security of the mortgage, the security of defendant’s guarantee.
In 1974, with the building nearly completed, the borrower defaulted. Irving commenced foreclosure proceedings and did not name defendant a party to those proceedings. During the pendency of the foreclosure proceedings, the borrower Uris Capitol and Irving entered into a mortgagee-in-possession agreement pursuant to which Irving obtained immediate pos*239session of the building and obtained the right to "make all alterations and repairs that the Mortgagee may deem necessary * * * for the preservation of the property [and] * * * for the purpose of promoting the renting of said Premises * * * and if the funds on hand for such alterations and repairs are insufficient, then Mortgagee shall have the right to advance such sums as are necessary to make such alterations and repairs and any sum so advanced by it with interest from the date of payment shall be added to the principal indebtedness secured by the Mortgage and be deemed secured thereby” (emphasis supplied). Concurrently with the entry into the mortgagee-in-possession agreement, Irving and Uris Capitol entered into a new building loan agreement whereby Uris Capitol executed a new $8,500,000 note and mortgage. Defendant was not a party to the mortgagee-in-possession agreement and did not guarantee the new building loan agreement. These new financial arrangements had their inception in the fact that the Sears, Roebuck & Co. lease covering approximately 21% of the total rentable area of the building required substantial expenditures by the landlord for "tenant finish work” in the space to be occupied by Sears.
Although only the 1969 mortgage was being foreclosed, Irving elected to have the amounts advanced by it under the 1974 building loan agreement included in its judgment in that foreclosure proceeding on the basis of the mortgagee-in-possession provision quoted above. A judgment of foreclosure and sale was entered on May 7, 1974 for $68,753,928.76 of which amount $3,461,388.50 was attributable to the cost of Sears work to and including April 19, 1974, and thus not related to the 1969 building loan agreement. At the foreclosure sale on May 29, 1974, Irving bid in the property for $68,904,544.15. Following the sale, the referee in the foreclosure proceeding filed a report of sale in which he computed the total amount due to the foreclosing mortgagee at the date of sale to be $71,340,005.08. Of that amount the sum of $4,501,892.30 was attributable to Sears tenant work ($3,461,388.50 to and including April 19, 1974; $1,040,503.80 since April 20, 1974 to date of sale). Thus, although the referee reported a deficiency owed to the foreclosing mortgagee of $2,435,460.93, insofar as the indebtedness under the foreclosed mortgage and the original building loan agreement is concerned, not only was there no deficiency, but Irving bid in the property for some $2,066,000 more than the indebtedness owed it under the original build*240ing loan agreement. Against this background, the failure of the lender to apply for leave to enter a deficiency judgment pursuant to section 1371 of the Real Property Actions and Proceedings Law obtains some relevance. Thereafter, Irving conveyed the building to plaintiff (a partnership consisting of the four banks that participated in the original loan of $62,000,000) and by separate instrument assigned its rights under the guarantee to plaintiff. Note is taken of the fact that plaintiff’s certified financial statement as of the date of the foreclosure sale specifically admits that the property was acquired "for an amount equal to the then existing debt.”
Plaintiff in its complaint sets forth two causes of action: (1) that it spent $1.2 million to complete the building and (2) that it paid off some $800,000 in liens filed against the building by contractors and seeks to recover these sums from defendant under its guarantee. By way of the first affirmative defense, defendant asserts that Irving’s $62 million loan and plaintiff’s expenditures were satisfied by virtue of the foreclosure. Plaintiff moved to dismiss this defense under CPLR 3211 (subd [b]) on the ground it does not state a defense and defendant cross-moved for summary judgment pursuant to CPLR 3212 dismissing the first and second causes of action of the complaint. Special Term in effect viewed the guarantee as one of completion and acknowledged that the terms of the guarantee cover the items now claimed as damages by plaintiff. The issue is whether plaintiff has sustained damage in respect of those items insofar as defendant’s liability under the guarantee is concerned.
A reading of the key case relied on by plaintiff, Prudence Co. v Fidelity Co. (297 US 198) and the key case relied upon by defendant, Westcott v Fidelity & Deposit Co. (87 App Div 497) discloses that the rationales of those cases are compatible. In effect, both cases stand for the proposition that a lender should be made whole under the given circumstances of a particular case. In Prudence, the lender loaned $6^ million to the borrower to aid in the construction of a hotel. The lender obtained as security a mortgage and in addition a performance bond in the amount of $3 million wherein the sureties agreed to indemnify the lender against loss through the failure of the borrower to construct the building by a stated time. The bond provided that in the event of default the lender could elect to go forward and complete the work and to recover the cost against the sureties. The borrower *241defaulted under the mortgage and the lender foreclosed and bid in the property at the foreclosure sale. A deficiency judgment was entered and it was clear that the lender had not as yet been made whole by virtue of buying in the property at the foreclosure sale. The lender therefore completed construction of the building and sued the sureties under the bond. The United States Supreme Court stated (p 205): "The petitioner should be placed in the same position it would have occupied if the building had been completed on December 16, 1930.” The Supreme Court, therefore, allowed recovery under the bond in order to make the lender whole under the circumstances of that case.
Similarly, in the Westcott case, the lender, in addition to receiving the security of a mortgage, obtained from the borrower a penalty bond in the amount of $15,000. The loan was given to permit the erection of a building upon the premises. Again, there was a default and the lender bid in the property obtaining in consequence a deficiency judgment for $2,348.87. The lender opted to complete the building and then sued defendant under the penalty bond of $15,000. It was noted that the intention of the lender in exacting the bond was to obtain additional security for the payment of the mortgage. The only interest of the lender when the bond was given was that of the mortgage and, therefore, it was the only interest protected by the bond. If the mortgage were paid in full, the lender would have no further interest in the property. By purchasing the property at the sale, the lender united the two estates held by him. It was observed that the defendant, after institution of action against it on the bond, offered judgment in at least the amount of the deficiency judgment. As this would make the plaintiff whole, this court noted that the amount needed to indemnify the lender for his entire interest was the amount of the deficiency judgment and for that sum the defendant offered to permit judgment to be taken.
Interestingly, both the Prudence case and the Westcott case rely in part and cite the New York Court of Appeals decision in Kidd v McCormick (83 NY 391). In that case the New York Court of Appeals pertinently declared (p 397): "Stated in its broadest form, the plaintiff is to have that compensation, which will leave him as well off as he would have been had the contract been fully performed.” It should be noted that the principle of compensation is not that the plaintiff should be more well off than he would have been had *242the contract been fully performed, but that he simply should be made whole. This is the critical legal principle operative herein as set forth in the legal precedent. As Irving purchased the property at the foreclosure sale for some $2,066,000 more than the mortgage debt, and as the sum expended by it to complete the building and to pay off the liens is approximately $2 million, which is less than that amount, it becomes clear that the plaintiff has already been made whole. Accordingly, to permit recovery under the guarantee of completion would enable the plaintiff to be more well off than if the contract had been performed, which is at variance with the legal precedent stated above.
Patently, the original building loan agreement and the guarantee are to be read together. This conclusion is dictated by the acts of the parties, the nature of the agreements and the underlying circumstances (see Kidd v McCormick, supra, p 395). Under the guarantee defendant guaranteed certain, but not all, of Uris Capitol’s obligations, to wit, the obligation that the base building be completed in accordance with the plans and specifications annexed to the 1969 building loan agreement, free of liens and claims. As already indicated, the lender by virtue of the foreclosure sale obtained property worth at least $2,000,000 in excess of the outstanding indebtedness under the 1969 building loan agreement. This amount in legal contemplation might well otherwise constitute surplus money to which the lender was not entitled, but for the fact that the lender and the borrower Uris Capitol entered into subsequent agreements, to wit, the mortgagee-in-possession and 1974 building loan agreements. Insofar as the defendant’s liability under the guarantee is concerned, in regard to the 1969 building loan agreement, the lender was made whole and obtained the benefit of the $2,000,000 in excess of the indebtedness under that building loan agreement. As this amount is sufficient to cover the sums expended to complete the building and to pay off liens, it is clear that insofar as defendant’s liability under the guarantee is concerned, the lender and its assignee, plaintiff herein, have been made whole. In effect, plaintiff has suffered no damage for which defendant may be held accountable. The guarantee was simply intended to secure the lender, that is, to assure that it be made whole, not to assure that it be made more than whole or to enable it to experience a windfall profit.
The order, Supreme Court, New York County (Asch, J.), *243entered January 18, 1978, and judgment of said court entered thereon on February 9, 1978, which denied plaintiffs motion to dismiss the first affirmative defense and which granted defendant’s cross motion to dismiss the complaint, should be affirmed, with one bill of costs and disbursements.
Murphy, P. J., Birns, Fein and Sullivan, JJ., concur.
Order, Supreme Court, New York County, entered on January 18, 1978, and judgment entered thereon on February 9, 1978, unanimously affirmed. Respondent shall recover of appellant $75 costs and disbursements of this appeal.