We reverse the order dismissing the foreclosure complaint, entered on appel-lee’s motion to dismiss. The rationale for granting the motion was that the affirmative defense of res judicata barred the complaint. Res judicata is an affirmative defense that ordinarily must be pleaded “in an answer or similar pleading.” Palmer v. McCallion, 645 So.2d 131, 133 (Fla. 4th DCA 1994); see also Fla. R. Civ. P. 1.110(d). “If the face of the complaint contains allegations which demonstrate the existence of an affirmative defense, then such a defense may be considered on a motion to dismiss.” Papa John’s Int’l, Inc. v. Cosentino, 916 So.2d 977, 983 (Fla. 4th DCA 2005). The complaint in this case does not facially demonstrate the application of that affirmative defense, so dismissal on that basis was not proper.
GROSS, MAY and KLINGENSMITH, JJ., concur.