*292¶1 This case is about whether a defendant can relinquish the rights conferred by the statute of limitations in a pretrial agreement. We hold that a defendant may expressly waive the criminal statute of limitations in a pretrial agreement when the statute of limitations on the underlying charge has not yet run at the time the defendant enters the agreement. We reverse.
Fairhurst, J.I. FACTUAL BACKGROUND AND PROCEDURAL HISTORY
f 2 The State charged Joseph A. Peltier on September 6, 2002 with two counts of second degree rape (as to B.M. and S.B.), one count of second degree child molestation (as to S.G.), and one count of second degree rape of a child (as to S.G.). The crimes occurred between 1993 and 2001. On July 14, 2003, to accommodate a negotiated settlement of his case, Peltier agreed to a stipulated trial on an amended information charging him with third degree rape (as to B.M. and J.D., a victim not referenced in the original information) and indecent liberties (as to S.B.). The charges as to S.G. were dismissed. On January 28, 2004, the trial judge found Peltier guilty and sentenced him. The statute of limitations on the four original charges had not yet run, but the statute of limitations for the charges he was convicted of had expired by January 1998, well before he was charged with and sentenced for them.
¶3 The agreement upon stipulation that was part of the stipulated trial agreement did not specifically mention the statute of limitations with regard to the charged crimes, but it did contain the following provisions:
6. AGREEMENT NOT TO CHALLENGE CONVICTION: The defendant agrees not to challenge the conviction for this crime, whether by moving to withdraw the stipulation, appealing the conviction, filing a personal restraint petition, or in any other way. . . .
7. NON-COMPLIANCE WITH AGREEMENT: If the defendant fails to appear for sentencing, or if prior to sentencing the *293defendant commits any new offense or violates any condition of release, the State may recommend a more severe sentence.
If the defendant violates any other provision of this agreement, the State may either recommend a more severe sentence, file additional or greater charges, or re-file charges that were dismissed. The defendant waives any objection to the filing of additional or greater charges based on pre-charging or pre-trial delay, statutes of limitations, mandatory joinder requirements, or double jeopardy.
Clerk’s Papers at 117 (emphasis added).
¶4 By August 30,2008, the statute of limitations for all of the charges in the original information had expired. In 2011, toward the end of Peltier’s sentence, the State filed a sexually violent predator (SVP) petition pursuant to chapter 71.09 RCW. After a trial, the SVP petition was granted. Peltier then filed a personal restraint petition (PRP) challenging the constitutionality of his original conviction. The State did not dispute this PRP, and the Court of Appeals, Division One, ruled that the original judgment and sentence for third degree rape and indecent liberties was invalid on its face since both charges in the amended information were filed beyond the statute of limitations. This PRP was granted, and the Court of Appeals ordered the charges to be vacated and dismissed.
¶5 On the same day these charges were dismissed, the State filed the second amended information charging Peltier with some of the more serious charges from the original information. The second amended information charges were rape in the second degree (as to S.B.), rape of a child in the second degree (as to S.G.), child molestation in the second degree (as to S.G.), and rape in the second degree (as to J.D.).1
¶6 Peltier moved to dismiss this second amended information since the statute of limitations had now run. The *294State argued that Peltier waived his right to object to the statute of limitations in the agreement upon stipulation, so the State had the right to refile the charges. The trial court, relying on case law describing the statute of limitations as jurisdictional, granted the motion to dismiss. The State appealed.
¶7 The Court of Appeals, Division One, held that a criminal statute of limitations is not jurisdictional, but rather determines the court’s statutory authority to hear a case. State v. Peltier, 176 Wn. App. 732, 737, 309 P.3d 506 (2013). The Court of Appeals held that since the statute of limitations had run, the trial court no longer had the authority to sentence the defendant and so it affirmed the trial court on these different grounds. Id. The State sought review, which we granted. State v. Peltier, 179 Wn.2d 1014, 318 P.3d 279 (2014).
II. ISSUE PRESENTED
¶8 How do we characterize a criminal statute of limitations, and can a criminal defendant waive the statute of limitations?
III. ANALYSIS
|9 We review de novo a trial court’s decision on a question of the court’s subject matter jurisdiction and on questions of law. Dougherty v. Dep’t of Labor & Indus., 150 Wn.2d 310, 314, 76 P.3d 1183 (2003); Robb v. City of Seattle, 176 Wn.2d 427, 433, 295 P.3d 212 (2013).
¶10 The question of whether a defendant can waive a criminal statute of limitations is a question of first impression for this court. Traditionally, whether a criminal statute of limitations can be waived depends on the characterization of these statutes. A guilty plea waives all defenses other than the failure of the information to charge an offense. In re Habeas Corpus of Garrison, 75 Wn.2d 98, 101, 449 P.2d 92 (1968). But, a guilty plea “ ‘does not *295preclude an appeal where collateral questions, such as the validity of the statute, the sufficiency of the information, the jurisdiction of the court, or the circumstances under which the plea was made, are raised.’ ” State v. Phelps, 113 Wn. App. 347, 352, 57 P.3d 624 (2002) (quoting State ex rel. Fisher v. Bowman, 57 Wn.2d 535, 536, 358 P.2d 316 (1961)). If a statute of limitations is jurisdictional, it is not subject to waiver. One cannot consent to a court having or not having subject matter jurisdiction.
¶11 Washington case law from the Court of Appeals specifically says that a criminal statute of limitations is jurisdictional. This holding first appears in State v. Glover, 25 Wn. App. 58, 61, 604 P.2d 1015 (1979). Relying on only out of state authority, the Glover court said, “Unlike the situation in civil cases, a criminal statute of limitation is not merely a limitation upon the remedy, but is a ‘limitation upon the power of the sovereign to act against the accused.’ It is jurisdictional.” Id. (citation omitted) (quoting State v. Fogel, 16 Ariz. App. 246, 248, 492 P.2d 742 (1972)). Two years later in State v. Eppens, Division Two reaffirmed Glover, saying, “We note first that a statute of limitations is viewed differently in the criminal than in the civil context. In the civil law, such a statute provides repose and a limitation on remedies; in the criminal law, such statutes create an absolute bar to prosecution.” 30 Wn. App. 119, 124, 633 P.2d 92 (1981) (citing Glover, 25 Wn. App. at 61).
¶12 These phrases from Glover and Eppens have been repeated throughout subsequent cases. State v. Ansell, 36 Wn. App. 492, 496, 675 P.2d 614 (1984) (“The statute of limitation is jurisdictional.”); State v. Fischer, 40 Wn. App. 506, 510, 699 P.2d 249 (1985) (“[A] criminal statute of limitation is jurisdictional.”); State v. Bryce, 41 Wn. App. 802, 807, 707 P.2d 694 (1985) (“We reasoned that because a criminal statute of limitation is jurisdictional, an information which charges a crime beyond the statute of limitations is void on its face, and therefore, there is nothing to which an amendment can relate back.”); State v. Novotny, 76 Wn. *296App. 343, 345 n.1, 884 P.2d 1336 (1994) (“Because the criminal statute of limitations is jurisdictional and creates an absolute bar to prosecution, Novotny correctly argues that he may raise the challenge for the first time on appeal.” (citation omitted)); State v. N.S., 98 Wn. App. 910, 914-15, 991 P.2d 133 (2000) (“A criminal statute of limitations presents a jurisdictional bar to prosecution. It is not merely a limitation upon the remedy, but a limitation upon the power of the sovereign to act against the accused.’ ” (footnote omitted) (quoting Glover, 25 Wn. App. at 61)); Phelps, 113 Wn. App. at 357; State v. Walker, 153 Wn. App. 701, 705, 224 P.3d 814 (2009) (“The statute of limitations in a criminal case is jurisdictional.”).
¶13 But despite the use of the term, a criminal statute of limitations does not affect a court’s subject matter jurisdiction. In In re Personal Restraint of Stoudmire, 141 Wn.2d 342, 353, 5 P.3d 1240 (2000), we emphasized the difference between a tribunal’s lack of subject matter jurisdiction and its lack of authority. There, a defendant pleaded guilty to two charges of indecent liberties and was sentenced. Id. at 347. He then challenged his convictions in a PRP, taking issue with the fact that the statute of limitations had run on the offenses with which he was charged. In discussing whether the defendant was entitled to relief from his convictions, the court said:
A court does not lack subject matter jurisdiction solely because it may lack authority to enter a given order. Marley v. [Dep’t] of Labor & Indus., 125 Wn.2d 533, 539, 886 P.2d 189 (1994). A court has subject matter jurisdiction where the court has the authority to adjudicate the type of controversy in the action, and it does not lose subject matter jurisdiction merely by interpreting the law erroneously. State v. Moen, 129 Wn.2d 535, 545, 919 P.2d 69 (1996).
Id. at 353. Our constitution gives original jurisdiction to the superior court in all criminal cases amounting to a felony. Wash. Const, art. IV, § 6. A statute of limitations does not take away that fundamental right of the superior courts to *297hear that type of controversy; it limits only the time in which the court can exercise that authority. Peltier, 176 Wn. App. at 744-45.
¶14 In Stoudmire, the statute of limitations had run on the underlying charges by the time Jerrod Stoudmire was sentenced. Because of this, the court held that the charges were beyond the statutory authority of the court. Stoudmire, 141 Wn.2d at 355. The court said, “ ‘[A] plea bargaining agreement cannot exceed the statutory authority given to the courts.’ ” Id. (alteration in original) (internal quotation marks omitted) (quoting In re Pers. Restraint of Moore, 116 Wn.2d 30, 38, 803 P.2d 300 (1991)). “Because the statute of limitations bars prosecution of charges commenced after the period prescribed in the statute, the sentencing court exceeded its authority.” Id. The expiration of a criminal statute of limitations does not deprive a court of subject matter jurisdiction; its expiration deprives a court of authority to enter judgment. Since the court had no authority to sentence, Stoudmire could not consent to be charged or waive any objection to the untimely charging. Id. But this case is distinguishable from Stoudmire. Here, the statute of limitations had not run on the underlying charges at the time Peltier entered the stipulated agreement, meaning the court still had the authority to sentence him.
¶15 When a statute of limitations has not run and the court still has authority to sentence on charges if convicted, a defendant may waive the statute of limitations if he or she so chooses. This waiver must be express. Generally, criminal defendants can waive rights that exist for their own benefit, and this is no different. Cowan v. Superior Court, 14 Cal. 4th 367, 926 P.2d 438, 439, 58 Cal. Rptr. 2d 458 (1996). If it proves more advantageous for a defendant to waive a statute of limitations that has not expired, he or she should be able to do so. Peltier, 176 Wn. App. at 738; N.S., 98 Wn. App. at 912-13. This will allow a defendant to plead guilty to lesser charges instead of standing trial on greater ones and facing a lengthy prison *298sentence. Accordingly, a defendant may expressly waive any objections to timeliness when the statute of limitations has not yet run on the underlying charges, and the court thus still has authority to sentence on the charges if convicted.
¶16 Here, the statute of limitations on the four greater charges were all still valid at the time Peltier entered the stipulated agreement in exchange for being charged with the two lesser crimes. In the agreement upon stipulation, he expressly waived his right to object to the expiration of the statute of limitations if his subsequent challenge of the agreement led to the refiling of the original charges. Peltier challenged the agreement, and the State refiled the original charges. Even though the statute of limitations has run on the refiled charges, the stipulation upon agreement was executed when the court still had the authority to sentence and so the waiver therein is valid. Peltier is precluded from objecting to the refiling of the original charges based on untimeliness.
IV. CONCLUSION
¶17 A statute of limitations does not affect a court’s subject matter jurisdiction; it affects the authority of a court to sentence a defendant for a crime. A defendant may expressly waive a criminal statute of limitations when he or she agrees to do so when the statute of limitations has not yet run on the underlying charges. At that time, the court has authority over the charges, so an express waiver is effective and will be upheld. Peltier waived the statute of limitations when the charges were still valid. We reverse the Court of Appeals and the trial court and hold that the State may refile the original charges.
Madsen, C.J.; C. Johnson, Owens, Stephens, Wiggins, González, and Gordon McCloud, JJ.; and Kulik, J. Pro Tem., concur.
Since the acts against J.D. were not charged in the original information, the State recognizes this charge is improper and does not pursue its validity on appeal.