
443 N.W.2d 707 (1989)
Henry Franklin DAVIS, Appellant,
v.
STATE of Iowa, Appellee.
No. 88-1118.
Supreme Court of Iowa.
July 19, 1989.
*708 William L. Wegman, State Public Defender and Shari Barron, Asst. State Public Defender, for appellant.
Thomas J. Miller, Atty. Gen., Bruce Kempkes, Asst. Atty. Gen., William E. Davis, County Atty., and Realff H. Ottesen, Asst. County Atty., for appellee.
Considered by McGIVERIN, C.J., and HARRIS, SCHULTZ, LAVORATO, and SNELL, JJ.
SCHULTZ, Justice.
In this appeal, appellant Henry Franklin Davis, a prison inmate, challenges the constitutionality of the three-year statute of limitations for postconviction relief. See Iowa Code § 663A.3 (1987). He contends this section violates the Iowa Constitution's prohibition against the suspension of the writ of habeas corpus found in Article I, section 13. He also urges that in the postconviction relief context, due process requires an applicant be given an opportunity to explain the reason for a delayed application.
On March 5, 1982, Davis pled guilty to the charge of second-degree burglary. He received a suspended sentence and was placed on probation for five years. When his probation was revoked on August 12, 1982, he was imprisoned.
On April 18, 1988, Davis applied for postconviction relief, challenging the constitutionality of his 1982 guilty plea. He claims his conviction was flawed by denial of his rights to equal protection, due process and effective assistance of counsel. Without reaching the merits of the application, the district court sustained the State's motion to dismiss, grounded on section 663A.3's time limitations. This section provides, "[a]n application must be filed within three years from the date the conviction or decision is final or, in the event of an appeal, from the date the writ of procedendo is issued."
Before addressing the merits of appellant's issues, we briefly examine the propriety of raising the statute of limitations by a motion to dismiss. Generally, this defense must be affirmatively asserted by a responsive pleading. Pride v. Peterson, 173 N.W.2d 549, 554 (Iowa 1970). However, when it is obvious from the uncontroverted facts shown on the face of the challenged petition that the claim for relief was barred when the action was commenced, the defense may properly be raised by a motion to dismiss. Id.
Here, the uncontroverted facts in appellant's application show that the limitation period had passed. The 1988 pleadings attacked a 1982 conviction. No appeal was taken. The suspension of defendant's sentence was revoked during the same year it was given. Thus, this postconviction proceeding was filed nearly three years beyond section 663A.3's limitation period.
Section 663A.3 does furnish an escape clause from this limitation, though, by providing that "this limitation does not apply to a ground of fact or law that could not have been raised within the applicable time period." This does not aid the appellant, however. Neither his pleading, nor his resistance to the motion to dismiss, claims any ground that could fall within this exception. Thus, the dismissal was appropriate unless appellant's constitutional claims, asserted in his resistance and now on appeal, have merit.
I. Habeas Corpus. Appellant asserts that section 663A.3's three-year statute of limitations violates the prohibition against suspension of the writ of habeas corpus *709 found in Article I, section 13, of the Iowa Constitution. Section 13, included as a part of our "Bill of Rights," states:
The writ of habeas corpus shall not be suspended, or refused when application is made as required by law, unless in case of rebellion, or invasion the public safety may require it.
There is a nexus between the code and constitutional provisions. Section 663A.3's time limitation for postconviction relief indirectly restricts the remedy of habeas corpus which was formerly available to prisoners challenging their convictions. Prior to the enactment of chapter 663A, 1970 Iowa Acts ch. 1276, §§ 1-11, we held that ineffective assistance of counsel in a criminal action may properly be raised in a habeas corpus proceeding. Brewer v. Bennett, 161 N.W.2d 749, 751 (Iowa 1968); Birk v. Bennett, 258 Iowa 1016, 1019, 141 N.W.2d 576, 578 (1966). Now, the postconviction remedy supplants and replaces the remedy of habeas corpus formerly available for challenging the validity of a conviction or sentence. Iowa Code § 663A.2; McElhaney v. Auger, 238 N.W.2d 797, 799 (Iowa 1976); Allen v. State, 217 N.W.2d 528, 531 (Iowa 1974). With this substitution of remedies, the three-year limitation in section 663A.3 may also apply to habeas corpus.
The thrust of appellant's argument is that postconviction relief, when utilized as a substitute remedy for habeas corpus, may not be limited by a statute of limitations without violating the prohibition against suspending the writ. We do not agree.
The constitutional provision for habeas corpus neither speaks to, nor prohibits, the legislative enactment of a reasonable time restriction. Article I, section 13, allows a refusal of the writ, however, "when the application is made as required by law." The term "required by law" ordinarily means required by statutory law. In re Sorensen's Estate, 195 Misc. 742, 745, 91 N.Y.S.2d 220, 224 (Sup.Ct.1949); City of Mountlake Terrace v. Stone, 6 Wash.App. 161, 166, 492 P.2d 226, 230 (1971). Thus, the framers of the constitution expressly provided general authority for legislative restriction on the exercise of the right of habeas corpus.
Even without the express authority found in section 13, the legislature may impose reasonable restrictions upon the exercise of a constitutional right. Emberton v. County of San Diego, 186 Cal.App.3d 268, 271, 230 Cal.Rptr. 572, 574 (1986), cert. denied, 481 U.S. 1038, 107 S.Ct. 1975, 95 L.Ed.2d 815 (1987); People v. Germany, 674 P.2d 345, 350 (Colo.1983). In State v. Berg, 237 Iowa 356, 21 N.W.2d 777 (1946), we stated:
Legislatures may pass laws regulating, within reasonable limits, the mode in which rights secured to the subject by bills of right and constitutions shall be enjoyed, and if the subject neglects to comply with these regulations he thereby waives his constitutional privileges.
Id. at 361, 21 N.W.2d at 780. Such reasonable regulations are proper so long as no constitutional right is materially impaired. Schloemer v. Uhlenhopp, 237 Iowa 279, 282, 21 N.W.2d 457, 458 (1946).
This restriction involves the time period to commence the action. It is a well-settled principle that a state may attach reasonable time limitations to the assertion of federal constitutional rights. United States v. Randolph, 262 F.2d 10, 12 (7th Cir.1958), cert. denied, 359 U.S. 1004, 79 S.Ct. 1143, 3 L.Ed.2d 1032 (1959) (citing Brown v. Allen, 344 U.S. 443, 486, 73 S.Ct. 397, 422, 97 L.Ed. 469, 504 (1953)). We conclude that a time limitation also may be placed on the exercise of a state constitutional right.
Furthermore, statutes of limitations speak to matters of remedy and procedure, rather than the destruction of fundamental rights. State ex rel. Krupke v. Witkowski, 256 N.W.2d 216, 224 (Iowa 1977); Presbytery of Southeast Iowa v. Harris, 226 N.W.2d 232, 242 (Iowa), cert. denied, 423 U.S. 830, 96 S.Ct. 50, 46 L.Ed.2d 48 (1975). Here, appellant had a remedy; he had a three-year opportunity to challenge his criminal conviction. By failing to exercise that remedy, he effectively waived his right to challenge his conviction. See Randolph, 262 F.2d at 12.
*710 For the reasons stated, we hold that the three-year limitation contained in section 663A.3 does not violate the constitutional prohibition against the suspension of the writ of habeas corpus.
II. Federal and State Due Process. Appellant also urges that the district court's dismissal of his postconviction claim precluded him from showing his delay was due to justifiable excuse and from presenting the merits of his case. We find no merit in either contention.
Regarding the justifiable excuse claim, one jurisdiction has held that a similar statute, providing for a three-year limitation for collateral attack on a criminal conviction, violated due process. Germany, 674 P.2d at 354. The court reasoned that the statute impermissibly precluded challenges to the prior convictions solely on the basis of a time bar, without providing the defendant an opportunity to show justifiable excuse. Id. We need not determine the persuasiveness of the Germany rule, however. Section 663A.3 does not preclude postconviction relief solely on the basis of a time bar. Rather, its "limitation does not apply to a ground of fact or law that could not have been raised within the applicable time period." § 663A.3. Consequently, appellant had the right to raise the issue of justifiable excuse for the delay.
Appellant offered no such excuse to the district court in either his pleadings or his resistance to the motion to dismiss. Matters not raised before the trial court cannot be raised for the first time on appeal, including constitutional issues. State v. Hamilton, 309 N.W.2d 471, 476 (Iowa 1981).
Appellant also claims violation of his federal and state due process rights because he was denied an opportunity to present the merits of his case. He maintains that a fundamental prerequisite to due process is the opportunity to be heard at a meaningful time and in a meaningful manner. The issue is whether appellant was denied a reasonable opportunity to assert his postconviction claims.
We believe the state has a legitimate interest in preventing the litigation of stale claims. The United States Supreme Court aptly stated:
Statutes of limitation find their justification in necessity and convenience rather than in logic. They represent expedients, rather than principles. They are practical and pragmatic devices to spare the courts from litigation of stale claims, and the citizen from being put to his defense after memories have faded, witnesses have died or disappeared, and evidence has been lost. Order of R. Telegraphers v. Railway Exp. Agency, 321 U.S. 342, 349, 64 S.Ct. 582, 586, 88 L.Ed. 788, 792. They are by definition arbitrary, and their operation does not discriminate between the just and the unjust claim, or the avoidable and unavoidable delay. They have come into the law not through the judicial process but through legislation. They represent a public policy about the privilege to litigate. Their shelter has never been regarded as what now is called a "fundamental" right or what used to be called a "natural" right of the individual. He may, of course, have the protection of the policy while it exists, but the history of pleas of limitation shows them to be good only by legislative grace and to be subject to a relatively large degree of legislative control.
Chase Securities Corp. v. Donaldson, 325 U.S. 304, 314, 65 S.Ct. 1137, 1142, 89 L.Ed. 1628, 1635 (1945).
One of the goals of our criminal justice system is to afford both the accused and the state fair and prompt trials, appeals and further proceedings to correct error. A legitimate concern is that the process also end within reasonable time limits. We believe that due process requires that the interest of the state and the defendant be balanced in determining the reasonableness of a period of limitations.
We conclude that the three-year limitation provides a valid opportunity for persons to challenge their convictions. The test is whether this time period provided the applicant a reasonable opportunity to have the claimed issue heard and determined. Michel v. Louisiana, 350 U.S. 91, 93, 76 S.Ct. 158, 160, 100 L.Ed. 83, 89 *711 (1955). The federal court in Randolph approved Illinois' five-year statute of limitations for postconviction relief, holding that the inmate's failure to use that remedy, in absence of interference or incapacity, bars a federal habeas corpus claim. Id. (citing Brown v. Allen, 344 U.S. 443, 487, 73 S.Ct. 397, 436, 97 L.Ed. 469, 542 (1953)). We believe that a three-year period after the conviction or appeal is final is not unreasonable.
We also believe the legislature, within its sound discretion, may determine the proper limitation period. The legislature is the primary judge as to whether the time allowed is reasonable. Oberst v. Mays, 148 Colo. 285, 292, 365 P.2d 902, 905 (1961); see Department of Social Services v. Thomas J.S., 100 A.D.2d 119, 130, 474 N.Y.S.2d 322, 330 (1984); Zion Nursing Home, Inc. v. Creasy, 6 Ohio St.3d 221, 452 N.E.2d 1272, 1276 (1983). We will only interfere when the time set is so short as to prevent a reasonable opportunity to have the issue heard. We conclude that the legislature, in providing the time limit in section 663A.3, afforded defendant a reasonable opportunity to be heard, thus ensuring his federal and state due process rights.
AFFIRMED.
