
    GARAL CORPORATION, Appellant, v. Oscar POCEIRO and Jose Alvarez, Appellees.
    No. 3D04-1113.
    District Court of Appeal of Florida, Third District.
    Nov. 17, 2004.
    Robert H. Cooper, Aventura, for appellant.
    Haley, Sinagra, Paul & Toland and James Haley, Fort Lauderdale, and Janine N. Kucaba, Miami, and Howard Cohen, Hollywood, for appellees.
    
      Before SHEVIN, WELLS and SHEPHERD, JJ.
   SHEVIN, Judge.

Garal Corporation appeals a summary final judgment of foreclosure. We reverse.

Garal owned two condominiums, Ocean Walk and Royal Springs, encumbered by one mortgage. The Ocean Walk condominium association foreclosed its lien on that condominium when Garal failed to pay the maintenance fees. Pociero and Alvarez (collectively “Pociero”) purchased the Ocean Walk property at foreclosure sale. Subsequently, the mortgagee instituted foreclosure proceedings when Garal failed to remit the mortgage payments. Pociero paid the entire mortgage debt to protect his property interest. Pociero then sued Garal to recover the entire amount of the mortgage encumbering the condominiums pursuant to a theory of equitable subrogation. The trial court entered a final foreclosure judgment in favor of Pociero for the entire mortgage debt.

Garal’s contention that Pociero, a purchaser at foreclosure sale, is not entitled to equitable subrogation is without merit. Garal correctly asserts that a purchaser takes title subject to any liens and encumbrances. That rule, however, does not preclude application of the equitable subrogation doctrine when, as here, the failure to apply the doctrine would result in a windfall for Garal. “Equitable subro-gation affords relief in essentially every situation in which a non-volunteer pays a debt or discharges an obligation which in good conscience should have been met by another.” Price v. Scharps, 405 So.2d 1043, 1044 (Fla. 3d DCA 1981). See Royal Admin., Inc. v. Hannover Life Reassurance Co. of Am., 848 So.2d 1244, 1245 (Fla. 3d DCA 2003), review dismissed, 879 So.2d 623 (Fla.2004); DeCespedes v. Prudence Mut. Cas. Co., 193 So.2d 224, 227 (Fla. 3d DCA 1966), affirmed, 202 So.2d 561 (Fla. 1967). Here, the doctrine prevents Garal from being unjustly enriched as a result of Pociero’s payment of the mortgage encumbering Garal’s Royal Springs condominium. Therefore, the doctrine is applicable. See 12 Fla. Jur.2d Contribution, Indemnity, & Subrogation §§ 55, 56.

However, we agree with Garal that a judgment for the entire amount of the mortgage is improper. Equitable sub-rogation applies when á' legal obligation “ought to have been met, either wholly or partially, by another.” Trueman Fertilizer Co. v. Allison, 81 So.2d 734, 737 (Fla.1955)(emphasis supplied); cf. Meckler v. Weiss, 80 So.2d 608 (Fla.1955)(where former co-tenant paid more than his proportionate share of mortgage debt his equitable lien on the property limited to his contribution). Pociero is only entitled to a judgment for the portion of the mortgage that encumbered Garal’s Royal - Springs condominium. Pociero’s right of subrogation is limited to the amount necessary to prevent Garal’s unjust enrichment. Pocie-ro is not entitled to be relieved of the portion of the mortgage encumbering the Ocean Walk condominium. The trial court did not address the issue as to apportionment of the mortgage debt. Therefore, the trial court erred in entering a summary judgment because genuine issues of material fact remain unresolved,

Accordingly, we reverse the judgment and remand for further consistent proceedings.

Reversed and remanded. 
      
      . The record clearly refutes Garal's contention that equitable subrogation was not raised in the complaint. Garal addressed the claim in its pleadings.
     