Opinion by Judge GRABER; Dissent by Judge THOMAS
GRABER, Circuit Judge:In this case of first impression for the Ninth Circuit, we. reject several constitutional challenges to the federal “three-strikes law,” 18 U.S.C. § 3559(c). We therefore affirm the sentence of life imprisonment that the district court imposed.
FACTUAL AND PROCEDURAL BACKGROUND
For present purposes, the relevant facts are not disputed. The government indicted defendant Bryan K. Kaluna for the crimes of bank robbery and conspiracy to commit bank robbery, in violation of 18 U.S.C. § 2113(a) and 18 U.S.C. § 371.
In an Amended Information and Notice, the government stated its intention to seek an enhanced penalty under the three-strikes law,1 should Defendant be convicted. The Amended Information and Notice listed Defendant’s prior felony convictions on which the government intended to rely. All involved robberies:
No. 78-01291-01 (United States) (International Savings and Loan);
No. 52405 (State of Hawaii) (Pioneer Bank);
No. 50282 (State of Hawaii) (Pex of Hawaii);
No. 50148 (State of Hawaii) (E.G.Marshal’s);
No. 47685 (State of Hawaii) (Bill’s Bakery); and
No. 85-1266 (State of Hawaii) (Pioneer Bank/Honolulu Federal/Hawaii Thrift).
The parties stipulated that Defendant had been convicted of the crimes listed in the Amended Information and Notice.
A jury found Defendant guilty, as charged, of bank robbery and conspiracy to commit bank robbery. Defendant’s co-conspirator used a gun in the robbery and, the district court found, Defendant knew that he would. Defendant concedes that the present crimes of conviction are “serious violent felonies” within the meaning of the three-strikes law.
In the E.G. Marshal’s case, Defendant had been convicted of robbery in the first degree. He concedes that this conviction counts as a “serious violent felony” under 18 U.S.C. § 3559(c)(2)(F)®. See Haw. Rev.Stat. § 708-840(1) (providing that *1192first-degree robbery involves the use or threatened use of force, while armed with a dangerous instrument, in the course of committing theft).
Defendant’s other prior convictions were for robbery in the second degree. Under Hawaii law, a person commits robbery in the second degree if, in the course of committing a theft, the person (a) “uses force against the person of anyone present” with the intent of overcoming resistance, or (b) “threatens the imminent use of force against the person of anyone who is present with intent to compel acquiescence to the taking of ... property,” or (c) “recklessly inflicts serious bodily injury upon another.” Haw.Rev.Stat. § 708-841(1). That offense is punishable by a maximum term of imprisonment of 10 years. See Haw.Rev.Stat. § 706-660. Defendant thus concedes that second-degree robbery in Hawaii is a “serious violent felony” as defined in 18 U.S.C. § 3659(c)(2)(F)(ii).
Defendant testified during the trial on the present charges. He testified that he had threatened tellers with the use of a gun during each of the three prior bank robberies encompassed in No. 85-1266 (Pioneer Bank/Honolulu Federal/Hawaii Thrift). For example, regarding the Hawaii Thrift robbery, Defendant testified:
Q. Isn’t it true that you were wearing a nylon stocking mask at that robbery?
A. Yes.
Q. And you put your hand inside of a brown paper bag?
A. Yes.
Q. What was the significance of putting your hand inside the brown paper bag?
A. To indicate that I had a gun.
Defendant testified similarly with respect to the Honolulu Federal and Pioneer Bank robberies. In each of the three instances, Defendant stated, he wore a stocking mask over his head and had his hand in an opaque bag “to act like I had a gun” so as to obtain property from the teller, although he denied actually having carried a gun during any of those three bank robberies.
With respect to the robbery of Bill’s Bakery, the indictment charged Defendant with robbery in the first degree. However, Defendant pleaded guilty to the reduced charge of robbery in the second degree.
In the present case, the district court sentenced Defendant to the enhanced penalty of mandatory life imprisonment under the three-strikes law. In so doing, the court counted the present convictions as the third strike, the E.G. Marshal’s first-degree robbery conviction as the second strike, and the Bill’s Bakery second-degree robbery conviction as the first strike. The court held that all three strikes qualified under 18 U.S.C. § 3669(c)(2)(F)(i). The court also held that Defendant had not demonstrated that the first strike was non-qualifying under 18 U.S.C. § 3559(c)(8). Additionally, the court expressly concluded that all the other prior second-degree robbery convictions qualified as strikes under 18 U.S.C. § 3669(c)(2)(F)(ii). Finally, the court took notice of Defendant’s trial testimony regarding the Pioneer Bank, Honolulu Federal, and Hawaii Thrift robberies encompassed by conviction No. 85-1266.
Defendant appealed. He first challenged his convictions in the present case. A panel of this court affirmed his convictions in an unpublished memorandum disposition. Defendant has not sought rehearing with respect to the affirmance of his convictions.
Defendant also challenged his sentence, arguing that the three-strikes law is unconstitutional in several respects that require the court to disregard the first of the purported strikes. A panel of this court, in a later-withdrawn opinion, concluded unanimously that the three-strikes law does not violate separation-of-powers principles, the Double Jeopardy Clause, the Ex Post Facto Clause, the Eighth Amendment, or the right to receive effective assistance of counsel. See United States v. Kaluna, 161 F.3d 1225 (9th Cir.1998) *1193(opinion withdrawn) (We incorporate the relevant portions of the withdrawn opinion and attach it as an Appendix to this opinion.). By a two-to-one majority, however, the panel held that the three-strikes law violated Defendant’s due process rights. See id. at 1073-84 (Reinhardt, J., holding that the use of a firearm during a prior robbery constitutes an element, so that allocation of the burden of proof to a defendant violates the defendant’s due process rights); id. at 1084-87 (Thomas, J., concurring on the ground that the “clear and convincing” level of proof that the statute allocates to a defendant violates due process); id. at 1087-88 (Leavy, J., dissenting from the holding that the statute violates due process).
The government petitioned for rehearing en banc, a request with which Defendant agreed. The court granted the petition for rehearing en banc and ordered that the panel’s opinion be withdrawn. See United States v. Kaluna, 161 F.3d 1225 (9th Cir.1998).
STANDARD OF REVIEW
We review de novo a district court’s interpretation of a statute. See United States v. Hunter, 101 F.3d 82, 84 (9th Cir.1996). We also review de novo a district court’s determination that a statute is constitutional. See United States v. Kim, 94 F.3d 1247, 1249 (9th Cir.1996).
THE THREE-STRIKES LAW
Some of Defendant’s arguments require us to construe the three-strikes law. Title 18 U.S.C. § 3559(c)(1) provides:
Notwithstanding any other provision of law, a person who is convicted in a court of the United States of a serious violent felony shall be sentenced to life imprisonment if-
(A) the person has been convicted (and those convictions have become final) on separate prior occasions in a court of the United States or of a State of-
(i) 2 or more serious violent felonies; or
(ii) one or more serious violent felonies and one or more serious drug offenses; and
(B) each serious violent felony or serious drug offense used as a basis for sentencing under this subsection, other than the first, was committed after the defendant’s conviction of the preceding serious violent felony or serious drug offense.
In 18 U.S.C. § 3559(c)(2)(F), Congress defines the term “serious violent felony” for the purpose of § 3559(c)(1) to mean
(i) a Federal or State offense, by whatever designation and wherever committed, consisting of ... robbery (as described in section 2111, 2113, or 2118); ... or attempt, conspiracy, or solicitation to commit any of the above offenses; and
(ii) any other offense punishable by a maximum term of imprisonment of 10 years or more that has as an element the use, attempted use, or threatened use of physical force against the person of another or that, by its nature, involves a substantial risk that physical force against the person of another may be used in the course of committing the offense[.]
Title 18 U.S.C. § 3559(c)(3)(A) provides in pertinent part:
Robbery ... shall not serve as a basis for sentencing under this subsection [3559(c) ] if the defendant establishes by clear and convincing evidence that—
(i) no firearm or other dangerous weapon was used in the offense and no threat of use of a firearm or other dangerous weapon was involved in the offense; and
(ii) the offense did not result in death or serious bodily injury ... to any person.
Section 3559(c)(1) places the burden on the government to demonstrate *1194that a defendant was convicted of at least two prior offenses that qualify as “serious violent felonies” under § 3559(c)(2)(F). Defendant asserts that the statute fails to tell us who must prove the existence of the prior strikes. We disagree. The structure of the statute shows that this is the government’s burden because, in the absence of proof of qualifying prior convictions, a defendant receives the standard, lesser sentence and thus benefits from the absence of proof. Additionally, the purpose of the statute is consonant with requiring the government to prove the qualifying prior convictions, because they serve to enhance the sentence. See United States v. Young, 33 F.3d 31, 32 (9th Cir.1994) (“The Government bears the burden of proving factors enhancing a sentence by a preponderance of the evidence.”); United States v. Oberle, 136 F.3d 1414, 1423-24 (10th Cir.) (holding that the government bears the burden of proving the prior strikes under the three-strikes law), cert. denied, — U.S. —, 119 S.Ct. 197, 142 L.Ed.2d 161 (1998).
The government carried its burden here. As noted, the parties stipulated that Defendant had been convicted earlier of several robberies that fit the definition of “serious violent felonies” under the statute. See United States v. West, 826 F.2d 909, 912 (9th Cir.1987) (holding that the government established the defendant’s prior convictions by detailing them in a presentence report that the defendant did not challenge); Oberle, 136 F.3d at 1423-24 (holding that the government carried its burden of proving prior strikes under the three-strikes law by introducing certified copies of four previous convictions).
Defendant argues nonetheless that, with respect to a robbery that falls under the definition in § 3559(c)(2)(F)(ii), the government must prove more before the prior conviction may be counted as a strike, viz., that the exception in § 3559(c)(3)(A) does not apply. The answer turns on whether the exception to the definition of a strike, § 3559(c)(3)(A), is an element of the offense or is part of a sentencing factor. See Almendarez-Torres v. United States, 523 U.S. 224, 118 S.Ct. 1219, 1228-29, 140 L.Ed.2d 350 (1998) (stating that question). If § 3559(c)(3)(A) is an element of the offense, the government must prove that a defendant committed the prior offenses by using, or threatening to use, a dangerous weapon, or that the prior offenses involved death or serious bodily injury. See id. at 1229 (stating that the government must prove every element of the offense beyond a reasonable doubt); see also Young, 33 F.3d at 32 (stating that the government must prove a factor that enhances a sentence by a preponderance of the evidence). If, however, § 3559(c)(3)(A) is an affirmative defense that is part of a sentencing factor, then Congress may require a defendant to prove that no weapon was used, or was threatened to be used, and that no serious bodily injury or death resulted. See Almendarez-Torres, 118 S.Ct. at 1229-30, which cites and relies on Patterson v. New York, 432 U.S. 197, 205-07, 97 S.Ct. 2319, 53 L.Ed.2d 281 (1977) (upholding a New York statute that required the defendant, at the guilt stage, to prove by a preponderance of the evidence the affirmative defense of extreme emotional disturbance).
In arguing whether the statute makes injury, death, or the use or threatened use of a weapon an “element” or an “affirmative defense,” both parties refer by analogy to cases that construe statutes about guilt of an underlying crime, rather than about sentencing. We believe, however, that the Supreme Court’s recent decision in Almendarez-Torres should guide our interpretive task.
In Almendarez-Torres, the Supreme Court considered whether 8 U.S.C. § 1326(b)(2), which provides for enhanced prison sentences for aliens who return to the United States after having been deported for committing an aggravated felony, defines a separate crime or is a sentencing factor. The Court concluded that *1195§ 1326(b)(2) does not create a separate crime that must be charged in an indictment, but instead is a sentencing provision that “simply authorizes a court to increase the sentence for a recidivist.” Almendarez-Torres, 118 S.Ct. at 1222. In determining whether Congress intended the factor described by § 1326(b)(2) to be an element of a separate crime or a sentencing factor, the Court “look[ed] to the statute’s language, structure, subject matter, context, and history.” Id. at 1223. The Supreme Court recently made clear that Almendarez-Torres remains good law. See Jones v. United States, 526 U.S. 227, 119 S.Ct. 1215, 1226-27, 143 L.Ed.2d 311 (1999) (citing Almendarez-Torres with approval and stating that “recidivism increasing the maximum penalty need not be so charged”).
As instructed by the Supreme Court, we examine the wording, structure, subject matter, context, and history of the three-strikes law. When we do, we conclude that § 3559(c) serves only to enhance a defendant’s sentence on account of prior violent felonies, not to create an element of the present offense. We also conclude that § 3559(c)(3)(A) is a kind of affirmative defense to the use of certain prior violent felonies as a sentencing factor.
We focus first and foremost, as did the Court in Almendarez-Torres, on the subject matter of the statute: “At the outset, we note that the relevant statutory subject matter is recidivism. That subject matter — prior commission of a serious crime— is as typical a sentencing factor as one might imagine.” Almendarez-Torres, 118 S.Ct. at 1224; see also id. (“[T]he lower courts have almost uniformly interpreted statutes (that authorize higher sentences for recidivists) as setting forth sentencing factors, not as creating new crimes.... And we have found no statute that clearly makes recidivism an offense element in such circumstances.”) (citations omitted). Like the statute at issue in Almendarez-Torres, § 3559(c) is a recidivist statute. It enhances the sentence of a defendant who is convicted of a serious violent felony when the defendant previously was convicted of at least two other serious violent felonies.
We next consider the wording, context, and structure of § 3559(c). Section 3559 bears the title, “Sentencing classification of offenses,” and everything in § 3559 pertains to the imposition of sentence after conviction. See Almendarez-Torres, 118 S.Ct. at 1226 (holding that a statute’s title is a tool for interpreting the statute and that a title containing the word “penalties” usually signals a sentencing provision rather than an element). Additionally, § 3559(c) is worded to pertain only to the imposition of a sentence, not to the offense itself.
Turning now to the exception, we see first that it pertains to sentencing only. Section 3559(c)(3)(A) explains the narrow-circumstances in which “[rjobbery ... shall not serve as a basis for sentencing ” under § 3559(c). (Emphasis added.) Second, we see that Congress has worded § 3559(c)(3)(A) plainly to shift to a defendant the burden of establishing the exception: “Robbery ... shall not serve as a basis for sentencing under this subsection if the defendant establishes ” certain facts. (Emphasis added.)
Contextually, it is significant that the exception is quite narrow. Under § 3559(c)(3)(A), only offenses that did not in fact involve injury, death, or the use or threatened use of a dangerous weapon escape being counted as strikes. All the many other offenses that qualify as “serious violent felonies” under § 3559(c)(2)(F) are strikes. The statutory reach is broad, encompassing a large number of crimes, while the exception for certain limited-violence offenses is narrow. In that circumstance, it is probable that Congress intended § 3559(c)(3)(A) to be an affirmative defense to a sentencing enhancement, rather than an element. See United States v. Freter, 31 F.3d 783, 788 (9th Cir.1994) (“[Wjhere, as here, a statutory prohibition is broad and an exception is *1196narrow, it is more probable that the exception is an affirmative defense.”).
Finally, we find nothing in the history of the three-strikes law that detracts from our view of the subject matter, wording, context, and structure of the statute.
After considering all the applicable factors, we join the Seventh Circuit in concluding that the exception found in § 3559(c)(3)(A) is an affirmative defense to a sentencing enhancement. See United States v. Wicks, 132 F.3d 383, 388-89 (7th Cir.1997), cert. denied, — U.S. —, 118 S.Ct. 1546, 140 L.Ed.2d 694 (1998). Therefore, the government did not need to prove that Defendant had committed a prior robbery with the use or threatened use of a dangerous weapon, or that serious bodily injury or death occurred, for that prior conviction to be considered a “serious violent felony” under § 3559(c)(2)(F). Rather, Defendant had the burden of proving that he had not used, or threatened to use, a firearm when committing his prior robberies, and that no serious bodily injury or death resulted.
DUE PROCESS ANALYSIS
Because Defendant’s present convictions qualify as a strike, to establish that Defendant was eligible to be sentenced under § 3559(c)(1) the government had only to prove that he had been convicted of two prior “serious violent felonies” under § 3559(c)(2)(F). As noted, the parties do not dispute that the E.G. Marshal’s robbery conviction qualifies as a “serious violent felony” under § 3559(c)(2)(F)® and as a strike under § 3559(c)(1). Moreover, the parties stipulated that Defendant’s remaining robbery convictions qualified as “serious violent felonies” under § 3559(c)(2)(F)(ii). Thus, the government met its initial burden.
The burden then shifted to Defendant to prove that none of those remaining robbery convictions qualified as a strike. Defendant first contends that this burden shifting per se violates due process, because the exception is an “element.” We have held, however, that § 3559(c)(3)(A) contains an affirmative defense to a sentencing enhancement, which Congress may require a defendant to establish. See Almendarez-Torres, 118 S.Ct. at 1229-30; Patterson, 432 U.S. at 206, 97 S.Ct. 2319; Wicks, 132 F.3d at 389 (“As long as the prosecution has proved all elements of the crime beyond a reasonable doubt, Patterson held, the state is free to allocate the burden of proving an affirmative defense to the defendant. If Patterson allows such a result even at the stage of the trial where guilt or innocence is decided, it follows that due process does not prohibit the kind of affirmative defense at the sentencing stage found in § 3559(c)(3)(A).”).
In the alternative, Defendant argues that the burden of proof demanded by § 3559(c)(3)(A) — clear and convincing— is too high. We need not and do not reach that issue, because Defendant cannot establish the affirmative defense under any standard of proof. See Washington v. Johnson, 90 F.3d 945, 950-51 n. 3 (5th Cir.1996) (in considering a due process challenge to the allocation of the burden of proof regarding mental competency, the court declined to consider the issue, noting that “the district court’s unhesitating conclusion that Petitioner was competent in fact to stand trial in 1987 demonstrates that a contrary allocation of burden of proof would not have been outcome-determinative”). Indeed, Defendant would lose as a matter of law even if the government bore the burden of proof.
Defendant did not and could not establish the absence of a qualifying “first strike” robbery. He offered limited documentary evidence during the sentencing phase of the case. He testified at trial, however, that he had threatened to use a gun in his prior robberies of Pioneer Bank, Honolulu Federal, and Thrift Savings.2 *1197Defendant asserts only that the district court could not consider his.trial testimony to determine whether those prior robberies involved the use, or threatened use, of a dangerous weapon. We find no support for that contention.
The plain wording of § 3559(c)(3)(A) cannot reasonably be interpreted to preclude a district court from considering a defendant’s testimony before it, under oath, regarding the defendant’s commission of prior offenses. We are aware of no court that has held or suggested that the statute contains such a limitation.
Nor does the Constitution bar a court from considering a defendant’s trial testimony about prior offenses when imposing sentence for the present offense. Defendant had the right to remain silent but instead chose to testify, and he did not object to the questions quoted at the beginning of this opinion. A district court constitutionally can rely on a defendant’s volunteered trial testimony during the sentencing phase of a trial. Therefore, the district court did not err as Defendant claims.
The dissent faults us for not reaching the constitutional issue of whether the “clear and convincing” burden established by § 3559(c)(3) infringes on Defendant’s due process rights. The dissent’s argument contravenes two well-established jurisprudential doctrines. First, to decide the constitutional question here would violate the maxim that courts are not “to decide questions of a constitutional nature unless absolutely necessary to a decision of the case.” Burton v. United States, 196 U.S. 283, 295, 25 S.Ct. 243, 49 L.Ed. 482 (1905). “Prior to reaching any constitutional questions, federal courts must consider nonconstitutional grounds for decision. This is a fundamental rule of judicial restraint.” Jean v. Nelson, 472 U.S. 846, 854, 105 S.Ct. 2992, 86 L.Ed.2d 664 (1985) (citation and internal quotation marks omitted); see also Spector Motor Serv., Inc. v. McLaughlin, 323 U.S. 101, 105, 65 S.Ct. 152, 89 L.Ed. 101 (1944) (“If there is one doctrine more deeply rooted than any other in the process of constitutional adjudication, it is that we ought not to pass on questions of constitutionality ... unless such adjudication is unavoidable.”); Meinhold v. United States Dep’t of Defense, 34 F.3d 1469, 1474 (9th Cir.1994) (stating those principles and holding that it is error to pass over a noncon-stitutional claim).
A corollary also is well established: that harmless-error analysis applies to nonstructural errors even when the claimed errors are constitutional. See Neder v. United States, — U.S. —, 119 S.Ct. 1827, 1833, 144 L.Ed.2d 35 (1999) (“For all [nonstructural] constitutional errors, reviewing courts must apply Rule 52(a)’s harmless-error analysis and must ‘disregard’ errors that are harmless ‘beyond a reasonable doubt.’ ”) (quoting Chapman v. California, 386 U.S. 18, 23, 87 S.Ct. 824, 17 L.Ed.2d 705 (1967) (alteration omitted) ). A district court’s use of an incorrect burden of proof at sentencing is a nonstructural error to which harmless-error analysis applies. Even in the context of capital sentencing proceedings, the Supreme Court has applied a harmless error analysis. See, e.g., Hitchcock v. Dugger, 481 U.S. 393, 399, 107 S.Ct. 1821, 95 L.Ed.2d 347 (1987) (reversing a death sentence because there was a constitutional error but the state did not show that the error was harmless); Skipper v. South *1198Carolina, 476 U.S. 1, 7-9, 106 S.Ct. 1669, 90 L.Ed.2d 1 (1986) (analyzing an error in the sentencing proceeding for harmlessness). Additionally, the Supreme Court has applied a harmless-error analysis when the burden of proof was shifted in violation of due process. See Rose v. Clark, 478 U.S. 570, 579-80, 106 S.Ct. 3101, 92 L.Ed.2d 460 (1986).
Here, because Defendant admitted at trial that he had threatened tellers with the use of a gun in the Pioneer Bank, Honolulu Federal, and Thrift Savings robberies, the district court’s use of the clear- and-convincing standard, even if unconstitutional, was harmless beyond a reasonable doubt; it could not have altered the outcome of the case. Because any error was harmless, we must decline to decide the constitutionality of the clear-and-eon-vincing standard provided in § 3559(c)(3).
In summary, the district court did not err in concluding that Defendant had committed two prior serious violent felonies within the meaning of the three-strikes law.
OTHER CONSTITUTIONAL CLAIMS
Defendant makes several additional constitutional arguments. We reject them for the reasons stated by the panel in Kaluna. See attached Appendix.
CONCLUSION
Defendant’s convictions and sentence are AFFIRMED.
APPENDIX
We first consider Kaluna’s general constitutional challenges to the “three strikes” law. The statute provides in relevant part that “[notwithstanding any other provision of law, a person who is convicted ... of a serious violent felony shall be sentenced to [mandatory] life imprisonment” if he has been convicted “on prior occasions ... of ... 2 or more serious violent felonies.” 18 U.S.C. § 3559(c)(1).
Kaluna argues that the three-strikes statute violates five constitutional principles: (1) double jeopardy; (2) the separation of powers; (3) the Ex Post Facto Clause; (4) the prohibition against cruel and unusual punishment; and (5) the right to effective assistance of counsel. We have not had occasion to address these arguments with regard to the federal three-strikes statute, but three other circuits have rejected various challenges to the statute’s general constitutionality. See United States v. Rasco, 123 F.3d 222 (5th Cir.1997), cert. denied, — U.S. —, 118 S.Ct. 868, 139 L.Ed.2d 765 (1998); United States v. Washington, 109 F.3d 335, 337-38 (7th Cir.), cert. denied, — U.S. —, 118 S.Ct. 134, 139 L.Ed.2d 82 (1997); United States v. Farmer, 73 F.3d 836, 839-41 (8th Cir.), cert. denied, 518 U.S. 1028, 116 S.Ct. 2570, 135 L.Ed.2d 1086 (1996). We agree with these circuits, and with the district court, that the three-strikes statute’s recidivist sentencing scheme, harsh and inflexible as it may be, is facially constitutional in general.
First, Kaluna contends that the three-strikes statute violates the Double Jeopardy Clause because it imposes multiple punishment for the same offenses. Specifically, he argues that he has already served his punishment for his previous two “strikes,” and he cannot be punished again for them by counting them against him in the instant sentence. It is true that the “Double Jeopardy Clause protects against ... the actual imposition of two punishments for the' same offense.” Witte v. United States, 515 U.S. 389, 115 S.Ct. 2199, 2204, 132 L.Ed.2d 351 (1995). But although the three-strikes statute might seem to violate this principle, the Supreme Court has long since determined that recidivist statutes do not violate double jeopardy because “the enhanced punishment imposed for the later offense ‘is not to be viewed as either a new jeopardy or additional penalty for the earlier crimes,’ but instead as ‘a stiffened penalty for the latest crime, which is considered to be an *1199aggravated offense because a repetitive one.’ ” Id. 115 S.Ct. at 2206 (quoting Gryger v. Burke, 334 U.S. 728, 732, 68 S.Ct. 1256, 92 L.Ed. 1683 (1948)); see also Spencer v. Texas, 385 U.S. 554, 559-60, 87 S.Ct. 648, 17 L.Ed.2d 606 (1967); Moore v. Missouri, 159 U.S. 673, 16 S.Ct. 179, 40 L.Ed. 301 (1895). Thus, Kaluna’s argument cannot prevail.
Second, Kaluna contends that the three-strikes statute violates the fundamental constitutional principle of separation of powers because it impermissibly increases the discretionary power of prosecutors while stripping the judiciary of all discretion to craft sentences. Alternately, Kaluna argues that this court should, in order to avoid constitutional difficulties, construe the statute to permit judges to apply the statute at their discretion. Again, we are compelled by precedent to reject both arguments. The Supreme Court has stated unequivocally that “Congress has the power to define criminal punishments without giving the courts any sentencing discretion.” Chapman v. United States, 500 U.S. 453, 467, 111 S.Ct. 1919, 114 L.Ed.2d 524 (1991); see also Mistretta v. United States, 488 U.S. 361, 364, 109 S.Ct. 647, 102 L.Ed.2d 714 (1989) (upholding the constitutionality of the federal sentencing guidelines in part because “the scope of judicial discretion with respect to a sentence is subject to congressional control”). Furthermore, the legislative history of the law leaves no doubt that Congress intended it to require mandatory sentences. See 103 Cong. Rec. S12,525 (daily ed. Aug. 25, 1994) (statement of Sen. Daschle) (stating that the three-strikes law “will require that Federal judges hand down mandatory life sentences”); id. at S12,12544 (statement of Sen. Lautenberg) (emphasizing that under the three-strikes law, three-time offenders are “put away for life.... And no ifs, ands or buts about it.”). The statute itself uses the words “mandatory” and “shall.” In any event, we cannot narrowly construe a law to avoid constitutional infirmity in this area because, given the principles previously announced by the Supreme Court, no constitutional question exists.
Third, Kaluna contends that the three-strikes statute violates the Ex Post Facto Clause because it changes the legal consequences of his prior bad acts. This contention also lacks merit. The Supreme Court and this court uniformly have held that recidivist statutes do not violate the Ex Post Facto Clause if they are “on the books at the time the [present] offense was committed.” United States v. Ahumada-Avalos, 875 F.2d 681, 683-84 (9th Cir.1989) (per curiam); see also Weaver v. Graham, 450 U.S. 24, 30, 101 S.Ct. 960, 67 L.Ed.2d 17 (1981). This statute was enacted in 1994 and Kaluna committed the instant offense in 1995.
Fourth, Kaluna argues that the three-strikes statute violates the proportionality guarantee of the Eighth Amendment. See U.S. Const. amend. VIII (“cruel and unusual punishments [shall not be] inflicted”). Supreme Court precedent once again forecloses his claim. In its most recent pronouncement on the subject, the Court held that “the eighth amendment ‘forbids only extreme sentences that are grossly disproportionate to the crime.’ ” United States v. Bland, 961 F.2d 123, 129 (9th Cir.1992) (quoting Harmelin v. Michigan, 501 U.S. 957, 1001, 111 S.Ct. 2680, 115 L.Ed.2d 836 (1991) (Kennedy, J., joined by O’Connor and Souter, JJ., concurring) (constituting the holding of the Court)). Moreover, while in evaluating the proportionality of a sentence, courts “must focus on the principal felony — the felony that triggers the life sentence,” Solem v. Helm, 463 U.S. 277, 290, 296 n. 21, 103 S.Ct. 3001, 77 L.Ed.2d 637 (1983), they must also recognize that legislatures may punish recidivists more severely than first-time offenders. Id. at 296, 463 U.S. 277, 103 S.Ct. 3001, 77 L.Ed.2d 637. Because the statute restricts its application to instances where both the defendants’ primary and past convictions are “serious vio*1200lent felonies,” the Court’s precedent makes it clear that Kaluna’s punishment for bank robbery is not sufficiently disproportionate to contravene the Eighth Amendment. See, e.g., Harmelin, 501 U.S. at 994-96, 111 S.Ct. 2680 (upholding life imprisonment for first offense of possessing 672 grams of cocaine); Rummel v. Estelle, 445 U.S. 263, 100 S.Ct. 1133, 63 L.Ed.2d 382 (1980) (upholding life sentence imposed after third nonviolent felony conviction).
Finally, Kaluna claims that he was deprived of the right to effective assistance of counsel because he was never advised that his guilty pleas to prior offenses could later constitute “strikes” leading to mandatory life imprisonment. Indeed, the three-strikes statute did not exist at the time of his guilty pleas to prior crimes. Following convention, however, we affirm the district court’s determination to dismiss this claim without prejudice because it is properly raised through habeas corpus proceedings, not direct review. See Custis v. United States, 511 U.S. 485, 114 S.Ct. 1732, 1739, 128 L.Ed.2d 517 (1994) (ineffective assistance claims under recidivist statutes should be brought collaterally, not in sentencing procedures).
. Relevant portions of the three-strikes law are quoted below at p. 1193.
. The dissent focuses largely on the robbery of Bill's Bakery. Thai robbery, however, has no *1197bearing on our analysis; the dissent's discussion of it, therefore, is irrelevant. We conclude that the Pioneer Bank, Honolulu Federal, and Thrift Savings robberies, not the Bill’s Bakery robbery, establish the first strike. (The second and third strikes are conceded.) Therefore, we simply are affirming Defendant’s sentence on an alternative ground that was presented to the court below. See Herring v. FDIC, 82 F.3d 282, 284 (9th Cir.1995) ("We may affirm on any basis the record supports, including one the district court did not reach.”).