
870 So.2d 52 (2003)
James E. JONES, Appellant,
v.
FLORIDA ex rel. CITY OF WINTER HAVEN, a Florida municipal corporation, Appellee.
No. 2D02-3711.
District Court of Appeal of Florida, Second District.
October 24, 2003.
Christopher Desrochers, Winter Haven, for Appellant.
Frederick J. Murphy, Jr., of Boswell & Dunlap LLP, Bartow, for Appellee.
VILLANTI, Judge.
James E. Jones challenges the final summary judgment entered in favor of the City of Winter Haven in this foreclosure action based on a code enforcement lien. Because we find that genuine issues of material fact preclude entry of final summary *53 judgment, we reverse and remand for further proceedings.
In June 2000, the City of Winter Haven Code Enforcement Board ("the Board") held a hearing to determine whether property owned by Banker's Trust Company of California, N.A. ("Banker's Trust"), was in violation of various sections of the Winter Haven Code of Ordinances. By order dated June 28, 2000, the Board found the property in violation and gave Banker's Trust until July 28, 2000, to bring the property into compliance with the code. The order finding violation provided that if the property was not brought into compliance by July 28, 2000, Banker's Trust would be liable for a fine of $200 per day "for each day the violation continues to exist."
On September 19, 2000, Jones purchased the property from Banker's Trust. It appears that as part of the purchase agreement, Jones was obligated to indemnify Banker's Trust for any fines imposed against the property as a consequence of the June 28, 2000, Order Finding Violation.
Shortly thereafter, Jones contacted the City to discuss his intentions concerning the property. According to Jones, as a result of these discussions, the City agreed that it would issue the necessary permits if Jones hired a licensed contractor to make the needed repairs. In addition, the City agreed that once the permits were issued, the code violation fines would stop accruing and the City would seek a lien for only the amount due as of the date the permits were issued.
At approximately that same time, Jones's agent, Gordon Miller, approached the Board on behalf of Jones to request mitigation of the fines accruing on the property. According to an affidavit signed by Miller, he was assured by the Board that when the property was brought into compliance, Jones could petition for a reduction of the fines. Miller's affidavit states that "[t]he clear implication was made that, if the building was brought into compliance, the fines would be reduced to costs and the lien discharged upon payment of the costs." In reliance on the representations by the City and the Board, Jones obtained at least some of the necessary permits and spent over $40,000 improving the property.
Subsequently, on January 23, 2001, the Board entered an Order Imposing Fine in the amount of $25,800, which represented 129 days of continued violation. This Order was entered after a code enforcement officer notified the Board that the property continued in violation. However, no hearing was held on the issue of whether the violations, in fact, continued, and the Board provided no notice of its intent to enter the Order Imposing Fine to either Banker's Trust or Jones. Once the City recorded a certified copy of the Order Imposing Fine, it became a lien against the property by operation of law. See § 162.09(3), Fla. Stat. (2000). Despite the City's and the Board's knowledge of Jones's ownership of the property, there is no indication that a copy of the Order Imposing Fine was provided to him prior to its being recorded.
On May 3, 2001, the Board entered a Supplemental Order Imposing Fine against Jones's property. The Supplemental Order made a factual finding that the code violations had continued and that an additional fine of $22,400 was due for 112 additional days of violation. As with the Order Imposing Fine, the Supplemental Order was entered based solely on the affidavit of a code enforcement officer. There is no indication that any hearing was held, that the City or the Board provided any notice to either Banker's Trust or Jones before entering the Supplemental Order, or that the Supplemental Order *54 was provided to Jones. Also as with the Order Imposing Fine, the Supplemental Order became a lien against the property once it was recorded in the public records.
As best we can tell from the limited record before us, at some point after the Order Imposing Fine was recorded, the City brought an action against Banker's Trust seeking to enforce that Order. Banker's Trust brought Jones into the action as a third-party defendant based on the indemnity agreement arising out of Jones's purchase of the property. Despite knowing that Jones was the current record owner of the property, the City took no steps to make Jones a codefendant in the action. On July 17, 2001, the trial court granted final summary judgment in favor of the City in the action against Banker's Trust, specifically finding that the Order Imposing Fine was enforceable against Banker's Trust and finding that the total fine as of May 2, 2001, was $55,600.[1]
On August 30, 2001, the City filed this current action against Jones to foreclose on the code enforcement liens. In his answer to the foreclosure complaint, Jones raised two affirmative defenses. First, Jones alleged that the City had repealed some of the code provisions that were allegedly violated and that therefore he could not have had a "continuing violation" after the date of repeal. Second, Jones alleged, inter alia, that the City had agreed to stop imposing the fine when the permits were issued, that the City was estopped from collecting any fines after that date, and "that the City would not foreclose upon the liens at issue if he brought the property into compliance." In addition to the affirmative defenses, Jones filed a "counterpetition" asserting essentially the same facts and seeking to quiet title to the property in light of the recorded liens. In response, the City filed a motion to dismiss Jones's counterpetition. The City neither replied to Jones's affirmative defenses nor moved to strike them.
In May 2002, the City filed a motion for final summary judgment in the foreclosure action. Attached to the motion was a summary of the "facts admitted in defendant's answer" and an affidavit from Tanya Willis, one of the City's Code Enforcement Officers, dated May 6, 2002. According to Willis's affidavit, the City had incurred $576 in costs in pursuing the foreclosure. Her affidavit also asserted that the total fine due was $86,200, representing the fines imposed by the Order Imposing Fine and the Supplemental Order, as well as fines for an additional 190 days from March 27, 2001, until October 2, 2001. No documents were attached to the affidavit.
Jones filed a response to the motion for summary judgment, arguing that the City had not refuted the facts alleged in his affirmative defenses and therefore was not entitled to summary judgment as a matter of law. He attached the affidavit of Gordon Miller, as well as a copy of the Code Enforcement Department's "Inspection Log," which provides some factual support for Miller's affidavit concerning the City's agreement to stop the fines.
At the hearing on the City's motion, the City asserted that Jones could not challenge the liens because he did not appeal from either the Order Imposing Fine or the Supplemental Order. Jones asserted that the two orders were entered in violation of his due process rights and that he should not be prevented from challenging the propriety of the fines in the foreclosure *55 action. He also argued that fact questions concerning his affirmative defenses precluded entry of summary judgment. The trial court subsequently entered final summary judgment of foreclosure in favor of the City, finding the total lien amount due and owing to be $86,776, entering judgment against Jones for that amount, and setting a foreclosure sale date. The foreclosure sale was stayed pending this appeal.
In this appeal, Jones contends that entry of the final summary judgment was improper because genuine issues of material fact exist concerning the issues alleged in his affirmative defenses. We agree. In order to be entitled to summary judgment as a matter of law, the party seeking summary judgment must not only establish that no genuine issues of material fact exist as to the party's claims but must also either factually refute the affirmative defenses or establish that they are legally insufficient. Manassas Invs., Inc. v. O'Hanrahan, 817 So.2d 1080, 1080 (Fla. 2d DCA 2002); Knight Energy Servs., Inc. v. Amoco Oil Co., 660 So.2d 786 (Fla. 4th DCA 1995). Moreover, in the context of a foreclosure action, summary judgment is generally inappropriate if the defendant raises the issue of estoppel and factual disputes exist concerning the sufficiency of the defense. Parker v. Dinsmore Co., 443 So.2d 356 (Fla. 1st DCA 1983). "Summary judgment is particularly unsuitable in those cases where `the facts and circumstances indicate a possibility of an estoppel or a waiver.'" Id. at 358 (quoting 22 Fla. Jur.2d Estoppel and Waiver § 9 (1980)).
In this case, Jones raised as an affirmative defense the issue of whether the City was estopped from bringing the foreclosure action. However, the City took absolutely no steps to address the factual assertions made by Jones and Miller or to establish that the estoppel defense was legally insufficient. Because the City did not conclusively refute Jones's estoppel defense, final summary judgment in favor of the City was improper.
The City argues that Jones's defenses were barred as a matter of law by the doctrine of res judicata. The City contends that Jones had the opportunity to raise these defenses in the City's separate action against Banker's Trust and that his failure to do so waives those defenses. We disagree. In order for res judicata to apply, four conditions must exist: (1) identity of the thing sued for, (2) identity of the cause of action, (3) identity of the parties to the action, and (4) identity of the quality or capacity of the persons for or against whom the claim is made. Donahue v. Davis, 68 So.2d 163, 169 (Fla.1953); Holt v. Brown's Repair Serv., Inc., 780 So.2d 180, 181-82 (Fla. 2d DCA 2001); Essenson v. Polo Club Assocs., 688 So.2d 981, 983 (Fla. 2d DCA 1997); Gold v. Bankier, 840 So.2d 395, 397 (Fla. 4th DCA 2003).
Here, neither the thing sued for nor the cause of action was the same in the City's case against Banker's Trust as in this case against Jones. The City's case against Banker's Trust sought the legal remedy of money damages for alleged code violations. The City's case against Jones seeks the equitable remedy of foreclosure based on liens against Jones's property. Jones's equitable defenses to a foreclosure action are not relevant in an action seeking solely a money judgment for damages. Because foreclosure of the lien was not at issue in the City's action against Banker's Trust, Jones did not waive his equitable defenses to this foreclosure action by failing to participate in the action for money damages.
Here, Jones has raised an affirmative defense that, if proven at trial, would defeat the City's foreclosure action. Because *56 genuine issues of material fact exist concerning this defense, final summary judgment was improper. Accordingly, we reverse the final summary judgment and remand for further proceedings.
Reversed and remanded.
FULMER and DAVIS, JJ., Concur.
NOTES
[1]  We note that the total fine imposed by the January 23, 2001, Order Imposing Fine and the May 2, 2001, Supplemental Order is only $48,200. No explanation is provided for this $7400 difference even though both the orders and the final summary judgment purportedly account for the accrued fines as of May 2, 2001.
