Rose, J.E Appeals (1) from an order of the Supreme Court (Cahill, J.), entered July 9, 2012 in Sullivan County, which granted plaintiffs motion for summary judgment, and (2) from the judgment entered thereon.
Plaintiff commenced this action to recover on a building loan note executed by defendant Dunbar Tower LLC. The note had been secured by a first mortgage on certain real propertjr, but prior to commencing this action, plaintiff foreclosed on a second mortgage given by Dunbar Tower against the same property. Plaintiff purchased the property at the foreclosure sale for $2,105,846.09, the outstanding amount owed on the second mortgage, and then released the lien of the first mortgage before assigning its bid to a third party for $3 million. After joinder of issue in this action, Supreme Court granted plaintiffs motion for summary judgment on the building loan note and awarded it $14,354,378.42, the full amount owed on that obligation. Defendants appeal.
Defendants do not deny that they defaulted on both loans. Instead, they contend that the amount that plaintiff received for assigning its bid in the foreclosure sale and releasing the first mortgage satisfied the senior lien, and that any recovery on the senior obligation would be a double recovery that would result in plaintiffs unjust enrichment. While we are not persuaded that the senior obligation would necessarily be reduced or extinguished under these circumstances, we do agree that defendants have properly raised the issue of unjust enrichment.
Where, as here, a holder of two mortgages forecloses on the junior mortgage and purchases the property, the question of whether the senior obligation is recoverable is a matter of equity dependent upon the facts and circumstances of the case (see Restatement [Third] of Property § 8.5, Comment c [2]; see also Clift v White, 12 NY 519, 536 [1855]; Westcott v Fidelity & Deposit Co., 87 App Div 497, 500 [1903]). When the sale price and the outstanding amount owed on the senior obligation together equal the fair market value of the property, the land is considered to satisfy the debt. In that case, equity will prevent the mortgagee from suing on the senior obligation and thus receiving a windfall (see Restatement [Third] of Property § 8.5, Comment c [2]; Johnson v Zink, 51 NY 333, 336 [1873]).
*1123If, however, the fair market value of the property is less than the sum of the two obligations, “the mortgagor would be unjustly enriched if the mortgagee is prevented from recovering on the senior obligation” (Restatement [Third] of Property § 8.5, Comment c [2]). In such a situation “the mortgagee may recover on the senior obligation only the amount by which the sum of the junior and senior obligations exceed the fair market value of the land” (Restatement [Third] of Property § 8.5, Comment c [2]). Here, neither party submitted proof as to the fair market value of the property, and Supreme Court thus had no basis to determine the amount recoverable on the senior note. We remit for that purpose.
We have considered defendants’ claims that the motion was procedurally defective and that it should have been denied in order that they could conduct further discovery on how plaintiff treated the transactions initially and find them to be unavailing. Whether any further discovery on the issue of fair market value is warranted is left to Supreme Court’s discretion.
McCarthy, Spain and Egan Jr., JJ., concur. Ordered that the order and judgment are modified, on the law, without costs, by reversing so much thereof as awarded plaintiff $14,354,378.42; matter remitted to the Supreme Court for further proceedings not inconsistent with this Court’s decision; and, as so modified, affirmed.