CCM Pathfinder Palm Harbor Management, LLC (Pathfinder), seeks review of the order dismissing with prejudice its complaint as to six of the many defendants *6in this foreclosure case, , We agree with Pathfinder that dismissal of its complaint based on the statute of limitations defense was improper because the facts supporting such a defense were outside the four corners of Pathfinder’s amended complaint. We also agree that, on the facts presented here, the applicable statute of repose did not bar Pathfinder’s action. Accordingly, we reverse the dismissal and remand for further proceedings.
Pathfinder is the servicing agent for a consortium of lenders that financed a $29 million condominium conversion loan in 2005. The loan was originally made to Palm Harbor One, LLC, as the developer of the condominium" conversion. As the developer, Palm Harbor One signed a promissory note which was secured by a mortgage. The promissory note had a stated' maturity date of November 30, 2006, and this maturity date was set forth in the mortgage, which was subsequently recorded. The note itself was not recorded.
As part of the same transaction, Palm Harbor One signed a separate loan agreement which contained additional terms and conditions relating to the loan and satisfaction of the note and mortgage. Rather than having a specified date for its maturity, the loan agreement stated that its maturity date was “twelve (12) months after the Mortgage is recorded.” The loan agreement and its terms were incorporated into the mortgage by specific reference; however, unlike with the maturity date of the note, the mortgage did not identify the maturity date for the loan agreement in any manner. Ultimately, the mortgage was recorded on December 16, 2005, making the maturity date of the loan agreement December 16, 2006.1 Like the note, however, the loan agreement itself was never recorded.
One of the terms of the loan agreement required Palm Harbor One to pay Pathfinder a “release fee” when each condominium unit was sold. In exchange for payment of: the release fee on each individual unit, Pathfinder agreed to release its mortgage as to that unit and to provide Palm Harbor One and the purchaser with a partial release of its mortgage. For a period o’f time after the loan transaction, Palm Harbor One sold units and paid the corresponding release fees for those units to Pathfinder. Pathfinder in turn provided releases of its mortgage as to those units to their purchasers. However, as to forty-' five of the units sold by Palm Harbor One, Pathfinder did not receive the release fee from either Palm Harbor One or the purchasers. At some point after these forty-five units were sold, Palm Harbor One went into bankruptcy.
After extended proceedings in the bankruptcy court, Pathfinder filed its foreclosure complaint in March 2013 against the owners of the forty-five units.for which Pathfinder had never received the release fee. In response, six of those unit owners filed motions to dismiss, asserting that Pathfinder’s foreclosure action was barred by the five-year statute of limitations set forth in section 95.11(2)(c), Florida Statutes (2013), and by the five-year statute of *7repose set forth in section 95.281(1). The trial court held a hearing on these motions and dismissed the foreclosure complaint as to those unit owners under both statutes. Pathfinder now appeals this ruling.
We dispose first of the statute of limitations issue. Section 95.11(2)(c) provides that an action to foreclose a mortgage must be commenced within five years from when the right to foreclose accrues. See Travis Co. v. Mayes, 160 Fla. 375, 36 So.2d 264, 265 (1948); City of Riviera Beach v. Reed, 987 So.2d 168, 170 (Fla. 4th DCA 2008). In the case of an installment note, the right to foreclose accrues as to each installment on the date the installment becomes due. See, e.g., Monte v. Tipton, 612 So.2d 714, 716 (Fla. 2d DCA 1993). Obviously then, if the default is based on the failure to make the final payment, the limitations period runs from the maturity date of the note.
Here, the maturity date of the note was November 30, 2006. Hence, the limitations period expired no later than November 30, 2011. Further, to the extent that the loan agreement required that certain payments be made, its maturity date was December 16, 2006, and the limitations period expired as to those obligations no later than December 16, 2011. However, Pathfinder’s foreclosure complaint was not filed until March 15, 2013 — a date clearly after the expiration of the statute of limitations regardless of which date is used. Hence, it initially appears that Pathfinder’s action is barred by the statute of limitations,
However, the recorded mortgage, which was attached to and incorporated into the amended ■ complaint, contains an explicit provision waiving the statute of limitations as a defense to a foreclosure action. While the current unit owners are not parties to that mortgage, the law is clear that if a recorded mortgage is valid on its face, a subsequent purchaser “is assumed to, have recognized it as a valid lien- against the property which he is buying.” Spinney v. Winter Park Bldg. & Loan Ass’n, 120 Fla. 453, 162 So. 899, 904 (1935). Thus, a purchaser who takes title to property subject to a' prior recorded mortgage is “estopped from contesting the validity of the mortgage.” Eurovest, Ltd. v. Segall, 528 So.2d 482, 483 (Fla. 3d DCA 1988); see also Irwin v. Grogan-Cole, 590 So.2d 1102, 1104 (Fla. 5th DCA 1991) (holding that a party purchasing property subject to a preexisting recorded mortgage could not'assert the invalidity of the mortgage). Here, the complaint alleges that the unit owners took title to their units subject to the prior recorded mortgage, and the recorded mortgage waives the statute of limitations as a defense. Therefore, it appears from the four corners of the amended' complaint and its attachments that the unit owners are precluded from raising the statute of limitation's as a valid defense. To the extent that it held otherwise, the trial court erred.
We recognize, as the unit owners argued at the hearing below, that there may be facts that can be developed by each unit owner to show that he or she should not be subject to the waiver provision of the mortgage. But the existence or nonexistence of any such facts could not be properly resolved at the motion, to dismiss stage because those facts are necessarily outside the four corners of the complaint. See, e.g., Brooke v. Shumaker, Loop & Kendrick, LLP, 828 So.2d 1078, 1080 (Fla. 2d DCA 2002) (reversing dismissal of plaintiffs complaint based on the expiration of the statute of limitations because the facts necessary to determine the statute of limitations defense were not apparent on the face of the complaint and its attachments). Therefore, we hold only that dismissal of the complaint based on *8the statute of limitations was erroneous. On remand, the unit owners may pursue this as an affirmative defense if they so choose.
The second basis articulated by the trial court for dismissing Pathfinder’s complaint was the statute of repose found in section 95.281(1). We explained the difference between a statute of repose and a statute of limitations in Houck Corp. v. New River, Ltd., Pasco, 900 So.2d 601, 603 (Fla. 2d DCA 2005):
A “statute of limitations” is a procedural statute that prevents the enforcement of a cause of action that has accrued. See WRH Mortgage, Inc. v. Butler, 684 So.2d 325, 327 (Fla. 5th DCA 1996). It does not determine the underlying merits of the claim but merely cuts off the right to file suit on that claim. Allie v. Ionata, 503 So.2d 1237, 1240-41 (Fla.1987). A “statute of repose,” in contrast, “is a substantive statute which not only bars enforcement of an accrued cause of action but may also prevent the accrual of a cause of action where the final element necessary for its creation occurs beyond the time period established by the statute.” WRH Mortgage, 684 So.2d at 327. It provides a substantive right to be free from liability after the established time period. Parham v. Balls, 704 So.2d 623, 626 (Fla. 2d DCA 1997), approved, Musculoskeletal Inst., Chartered v. Parham, 745 So.2d 946 (Fla.1999). Thus, the statute of repose does not work to provide a time limitation for filing a suit after the accrual of the cause of action, but prevents the cause of action from arising after its time limitation. Nehme v. Smithkline Beecham Clinical Labs., Inc., 863 So.2d 201, 208 (Fla.2003). The purpose of a statute of repose is to set a definitive time limitation on a valid cause of action even if there are circumstances that would make it difficult to discover. Id.
Thus, while both a statute of repose and a statute of limitations may bar a party from proceeding with an action, they do so for two different reasons and based on two different legal theories.
As a statute of repose, section 95.281(1) operates to terminate a mortgage lien and render it completely unenforceable if the statutory conditions are satisfied. That section provides in pertinent part:
(1) The lien of a mortgage or other instrument encumbering real property, herein called mortgage, except those specified in subsection (5), shall terminate after the expiration of the following periods of time:
(a) If the final maturity of an obligation secured by a mortgage is ascertainable from the record of it, 5 years after the date of maturity.
(b) If the final maturity of an obligation secured by a mortgage is not ascertainable from the record of it, 20 years after the date of the mortgage, unless prior to such time the holder of the mortgage:
1. Rerecords the mortgage and includes a copy of the obligation secured by the mortgage so that the final maturity is ascertainable; or
2. Records a copy of the obligation secured by the mortgage from which copy the final maturity is ascertainable and by affidavit identifies the mortgage by its official recording data and certifies that the obligation is the obligation described in the mortgage;
in which case the lien shall terminate 5 years after the date of maturity.
(Emphasis added.) In determining whether the five-year or the twenty-year statute of repose applies, the dispositive question is whether the final maturity date of the *9obligation or obligations secured by the recorded mortgage is ascertainable from the face of the recorded mortgage itself. A maturity date is “ascertainable from the record of it” if the maturity date can be determined by reading the public records. See, e.g., Layton v. Bay Lake Ltd. P’ship, 818 So.2d 552, 553 (Fla. 2d DCA 2002). If so, the statute of repose is five years from the date of maturity. If not, the statute of repose is twenty years.
Here, there were two obligations secured by the mortgage — the note and the loan agreement. While the recorded mortgage identified the maturity date of the note, it did not identify the maturity date of the loan agreement. Hence, because the maturity date of all of the obligations secured by the recorded mortgage was not ascertainable from face of the record of the recorded mortgage, the twenty-year statute of repose of section 95.281(l)(b) applies. Since Pathfinder’s foreclosure complaint was filed before the expiration of that twenty-year period, its action is not barred by the statute of repose, and the trial court erred by dismissing the complaint on this basis.
We recognize that this application of section 95.281(1) appears to conflict with the purpose of recording documents in the public records. Documents such as mortgages are recorded in the public records to provide a measure of certainty about the ownership of real property and the encumbrances on that property and to protect subsequent purchasers from claims arising from unrecorded instruments. See, e.g., Mayfield v. First City Bank of Fla., 95 So.3d 398, 401 (Fla. 1st DCA 2012). Re-cordation is also the source of imputing constructive knowledge of claims to subsequent purchasers. Id. With those purposes in mind, it seems counterintuitive— and counterproductive — to provide a longer statute of repose when the recorded documents provide less '-certain information. The law should encourage specificity in recorded documents — not ambiguity. Nevertheless, it is this court’s role to apply the law as written rather than to question the wisdom of the legislature in enacting those laws. Therefore, we are constrained by the language of section 95.281(1) to conclude that the statute of repose does not bar Pathfinder’s foreclosure action.
For both of these reasons, we reverse the dismissal of Pathfinder’s foreclosure complaint and remand for further proceedings.
Reversed and remanded.
PLEUS, ROBERT J., JR,, Associate Senior Judge, Concurs. KELLY, J., Concurs in result only.. On November 15, 2006, Pathfinder’s predecessor executed a Fifth Amendment to the Mortgage, which purported, among other • things, to extend the maturity date of the note from November 30, 2006, until December 16, 2006, so that the maturity dates of the note and loan agreement would coincide. The Fifth Amendment specifically contemplated ■ that an amended mortgage would be recorded reflecting the changes made by the amendment. However, there is no indication in the record that Palm Harbor One evér executed the Fifth Amendment, and no amended mortgage was ever recorded. Hence, the potential legal effect of this document cannot be properly addressed at the motion to dismiss stage.