
    David Leon STOKES, II, Petitioner-Appellant, v. Dora B. SCHRIRO, Director, Respondent-Appellee.
    No. 04-16454.
    United States Court of Appeals, Ninth Circuit.
    Argued and Submitted Oct. 18, 2005.
    Filed Oct. 6, 2006.
    
      Jon M. Sands, Federal Public Defender, and Jennifer Y. Garcia, Assistant Federal Public Defender, Tucson, Arizona, for appellant David Leon Stokes, II.
    Terry Goddard, Arizona Attorney General, Randall M. Howe, Chief Counsel, Criminal Appeals Section, and Cari McCo-neghy-Harris, Assistant Attorney General, Criminal Appeals Section, Phoenix, Arizona, for appellee Dora B. Sehriro.
    Before D.W. NELSON, RAWLINSON, and BEA, Circuit Judges.
   RAWLINSON, Circuit Judge.

A jury found David Leon Stokes, II (Stokes) guilty of attempted kidnapping and attempted robbery in Arizona state court. The jury also found the offenses to be “dangerous.” At sentencing, the trial judge opted to sentence Stokes to twenty years as a repetitive offender whose previous convictions were for non-dangerous offenses. The judge then enhanced the sentence to twenty-five years by finding aggravating circumstances. After Stokes’s habeas petition was denied in district court, we granted a certificate of ap-pealability (COA) on the issue of whether Stokes “was sentenced in violation of the Sixth Amendment pursuant to Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000), because the trial court disregarded the jury’s findings of dangerousness and sentenced appellant as a non-dangerous repetitive offender.” We conclude that the trial court’s election of one statutory sentencing option over another was not contrary to Apprendi. However, the court ran afoul of Apprendi when it relied on judicial factfinding to increase Stokes’s sentence beyond the statutory maximum. Accordingly, we affirm in part, reverse in part, and remand.

I

FACTUAL AND PROCEDURAL BACKGROUND

In May 1999, the Milners pulled then-car into a convenience store parking lot. Mr. Milner went into the store while Mrs. Milner remained in the car. Stokes entered the car, grabbed Mrs. Milner’s neck, threatened her with a “blade,” and told her he was going to steal the car. Mrs. Milner grabbed the keys from the ignition and jumped out of the car, but not before Stokes slashed her neck with the “blade.” Mrs. Milner survived, and Stokes was eventually apprehended.

An Arizona state jury subsequently found Stokes guilty of attempted kidnapping and attempted robbery, both class three felonies. The jury also found the offenses for which Stokes was convicted to be “dangerous.”

Stokes’s sentencing presented the Arizona state judge with two options. Because this was Stokes’s first conviction for a dangerous felony, the judge could sentence Stokes as a first-time dangerous offender under Arizona Revised Statute § 13-604(1), for a maximum sentence of fifteen years. In the alternative, and in view of Stokes’s prior convictions for at least two non-dangerous felonies, the judge could sentence Stokes as a repetitive offender whose previous convictions were for non-dangerous offenses. Under Arizona Revised Statute § 13-604(D), the maximum sentence under the latter option was twenty years.

The judge elected the latter option after finding that Stokes had been convicted of driving under the influence, theft, and possession of a narcotic drug. The judge then enhanced the twenty-year sentence to twenty-five years under Arizona Revised Statute § 13-702(C) and § 13-702.01(E) by finding three aggravating circumstances: (1) “physical and emotional harm to the victim,” (2) “the defendant was previously convicted of felonies within 10 years immediately preceding the date of this offense,” and (3) “defendant’s 1981 convictions for kidnapping and aggravated assault ... are strikingly similar to the instant offenses.” The judge ultimately sentenced Stokes to two “super-aggravated” terms of twenty-five years to be served concurrently.

Stokes appealed to the Arizona Court of Appeals, asserting, inter alia, that his sentence was “unlawful” because the jury found that his offenses were dangerous, yet the judge disregarded the jury’s findings and instead sentenced him as a non-dangerous repetitive offender, resulting in a longer sentence.

Relying on State v. Smith, 171 Ariz. 54, 828 P.2d 778 (1992), the Court of Appeals rejected Stokes’s argument. The Court of Appeals reasoned that Smith, which addressed an almost identical scenario, recognized the judge’s discretion to sentence under either subsection. Stokes’s appeal to the Arizona Supreme Court was denied.

Stokes requested post-conviction relief on a basis other than his unlawful sentence claim. His request and petitions for review were denied.

Stokes then petitioned for a writ of ha-beas corpus under 28 U.S.C. § 2254 in federal district court. Citing Apprendi, he again argued that his sentence was unlawful because the judge disregarded the jury’s findings of dangerousness and opted to sentence him as a non-dangerous repetitive offender.

The magistrate judge recommended that the district court deny Stokes’s petition. The district court accepted the magistrate judge’s recommendation and concluded that Stokes was not sentenced in violation of Apprendi under the sentencing statutes as construed by the Arizona state courts.

The district court denied Stokes’s request for a COA. However, we granted a COA on the issue of “whether appellant was sentenced in violation of the Sixth Amendment pursuant to Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000), because the trial court disregarded the jury’s findings of dangerousness and sentenced appellant as a non-dangerous repetitive offender.”

II

DISCUSSION

We review a district court’s decision to deny a habeas petition de novo and its findings of fact for clear error. Fowler v. Sacramento County Sheriffs Dep’t, 421 F.3d 1027, 1034 (9th Cir.2005). Because Stokes filed his petition after April 24, 1996, it is governed by the Antiterrorism and Effective Death Penalty Act of 1996 (AEDPA). Id.

To obtain habeas relief under AEDPA, Stokes must show that the relevant state court decision “was contrary to, or involved an unreasonable application of, clearly established Federal law, as determined by the Supreme Court of the United States.” 28 U.S.C. § 2254(d)(1).

“[A] decision is contrary to clearly established federal law ... if the state court applies a rule that contradicts the governing law set forth in the Supreme Court’s cases or if the state court confronts a set of facts that are materially indistinguishable from a decision of the Supreme Court and nevertheless arrives at a result different from that precedent.” Fowler, 421 F.3d at 1034-35 (citation, alterations, and internal quotation marks omitted).

“[Cjlearly established Federal law, as determined by the Supreme Court” refers to Supreme Court precedent at the time of the last-reasoned state court decision. Id. at 1034.

A. The judge did not violate Appren-di by opting to sentence Stokes as a repetitive offender whose previous convictions were for non-dangerous offenses.

According to Stokes, the Court of Appeals’s memorandum decision affirming the judge’s sentencing order is contrary to Apprendi in the following way: The jury found Stokes’s offenses to be dangerous. Under § 13-604(1) (the first-time dangerous offender statute), the judge could only impose a sentence of fifteen years. However, the judge opted to sentence Stokes as a repetitive offender whose previous convictions were for non-dangerous offenses. Under § 13-604(D) (the repetitive offender statute), the judge sentenced Stokes to twenty years (not counting the additional five-year enhancement based on aggravating circumstances).

Apprendi was violated, Stokes argues, when the judge disregarded the jury’s findings of dangerousness and exposed him to a sentence greater than that allowed by the jury’s verdicts. The jury’s verdicts were sufficient to expose Stokes to a twenty-year sentence, however. In disregarding the dangerousness finding, the judge did not negate that finding. Instead, the existence or nonexistence of the crime’s dangerousness was irrelevant to the application of § 13-604(D), which requires only that the defendant have previous non-dangerous convictions. See, e.g., State v. Sammons, 156 Ariz. 51, 749 P.2d 1372, 1376 (1988) (regarding as “mere sur-plusage” under § 13-604D a finding that the current offense was dangerous); Smith, 828 P.2d at 780 (holding that § 13-604(D) applied “[bjecause [defendant’s] prior convictions were for non-dangerous felonies”). Accordingly, under Arizona law the applicable statutory maximum was the greater of those provided by §§ 13-604(D) and 13-604(1). See Sammons, 749 P.2d at 1376 (considering the greater of the two a proper “sentencing option selected by the trial court”); Smith, 828 P.2d at 780 (same); cf. State v. Quinonez, 194 Ariz. 18, 976 P.2d 267, 270 (1999) (holding in a similar situation that “the only sentencing range that applied in this case was ... the more severe one”).

Contrary to Stoke’s arguments, the Arizona state courts’ interpretation of these provisions does not contradict any clearly established federal law. A statutory maximum need not be defined by every one of the facts found at trial, so long as the defendant is not “expose[d] ... to a greater punishment than that authorized” solely by those facts (or the fact of a prior conviction). Apprendi, 530 U.S. at 490, 494, 120 S.Ct. 2348. The application of § 13-604(D) did not depend on any fact that was not submitted to the jury, other than the facts of Stokes’s prior convictions. See id. at 490, 120 S.Ct. 2348. Because the twenty-year sentence was authorized by the jury’s findings, no Apprendi violation occurred. See United States v. Sua, 307 F.3d 1150, 1154 (9th Cir.2002). Stokes is therefore not entitled to habeas relief on this claim.

B. The judge violated Apprendi by enhancing Stokes’s sentence based on aggravating circumstances found by the judge.

The sentencing judge enhanced Stokes’s sentence by finding three aggravating circumstances: (1) “physical and emotional harm to the victim,” (2) “the defendant was previously convicted of felonies within 10 years immediately preceding the date of this offense,” and (3) “defendant’s 1981 convictions for kidnapping and aggravated assault ... are strikingly similar to the instant offenses.” These findings enhanced Stokes’s sentence to twenty-five years, beyond the prescribed statutory maximum of twenty years. Because these findings were not made by a jury, the sentence violated applicable federal law. See Apprendi, 530 U.S. at 490-92, 120 S.Ct. 2348.

The judge’s findings of aggravating circumstances are not covered by Apprendi’s prior conviction exception. Even if the prior conviction exception covers the finding that “the defendant was previously convicted of felonies within 10 years immediately preceding the date of this offense,” neither of the other two findings is covered by the exception because each was directed at Stokes’s present offenses, not the fact of his prior offenses.

The judge found that there was “physical and emotional harm to the victim.” This finding, directed at the present offenses, is not covered by the prior conviction exception. See United States v. Matthews, 312 F.3d 652, 664 (5th Cir.2002) (holding that the judge violated Apprendi when he enhanced the defendant’s sentence by finding that the defendant committed his offenses (1) while participating in a criminal street gang with knowledge of its criminal activities and (2) with intent to promote criminal activities or to maintain or increase his position in the gang because those findings were “unrelated to the fact of a prior conviction, but directly related to the emrent charged offense.”) (emphasis added).

The judge also found that Stokes’s “1981 convictions for kidnapping and aggravated assault ... are strikingly similar to the instant offenses.” This finding similarly focuses on the present offenses as a basis of comparison to past offenses and is beyond the scope of the prior conviction exception. See United States v. Kortgaard, 425 F.3d 602, 608-09 (9th Cir.2005) (holding that the sentence enhancement violated the defendant’s Sixth Amendment right to a jury trial because the findings that trigger the enhancement “do not follow necessarily from the fact of any prior conviction or sentence but instead call for the judgment of a factfinder.”).

Because the prior conviction exception does not inoculate an enhancement predicated upon judicial factfinding, Stokes’s sentence violated Apprendi. See Apprendi, 530 U.S. at 490-92, 120 S.Ct. 2348. Where a court imposes a sentence beyond the statutory maximum, the government has the burden of showing that the error was harmless beyond a reasonable doubt. See United States v. Banuelos, 322 F.3d 700, 706 and n. 4 (9th Cir.2003). As the government failed to meet its burden, Stokes is entitled to habeas relief on this claim.

Ill

CONCLUSION

The district court correctly concluded that the Arizona Court of Appeals’s decision upholding Stokes s enhanced sentence as a repetitive offender was not contrary to Apprendi However, the sentencing judge committed Apprendi error when he used judicial findings to enhance Stokes’s sentence. Because the government failed to show that the Apprendi error was harmless, Stokes is entitled to habeas relief on that claim. Accordingly, we affirm in part, reverse in part, and remand for the district court to grant the habeas petition as to the imposition of the sentence enhancement predicated upon judicial fact-finding.

AFFIRMED in part; REVERSED in part; and REMANDED. 
      
      . Subsection 13-604(1) stated:
      [U]pon a first conviction of a class 2 or 3 felony involving discharge, use or threatening exhibition of a deadly weapon or dangerous instrument or upon conviction of a class 2 or 3 felony when the intentional or knowing infliction of serious physical injury upon another has occurred, the defendant shall be sentenced to imprisonment as prescribed in this subsection ...
      Ariz.Rev.Stat. Ann. § 13-604(1) (1999).
     
      
      . Subsection 13-604(D) stated that "a person who ... stands convicted of a class 2 or 3 felony, and who has two or more historical prior felony convictions, shall be sentenced to imprisonment as prescribed in this sub-section ...” Ariz.Rev.Stat. Ann. § 13-604(D) (1999).
     
      
      . Subsection 13-702(C) listed a number of aggravating circumstances that "the court shall consider.” Ariz.Rev.Stat. Ann. § 13-702(C) (1999).
      Subsection 13-702.01(E) stated: "[I]f a person is convicted of a felony offense and has two or more historical prior felony convictions and if the court finds that at least two substantial aggravating factors listed in section 13-702, subsection C apply, the court may increase the maximum term of imprisonment ...” Ariz.Rev.Stat. Ann. § 13-702.01(E) (1993).
     
      
      . During the course of Stokes’s direct appeal, the United States Supreme Court decided Ap-prendi.
      
     
      
      . On appeal, Stokes raises two uncertified issues: (1) whether the trial court violated Apprendi by finding the fact of his prior convictions to enhance his sentence; and (2) whether the trial court violated Apprendi by enhancing his sentence based on a judicial finding of aggravating circumstances. We treat Stokes's opening brief raising these un-certified issues as a request to expand the COA. See Solis v. Garcia, 219 F.3d 922, 926 (9th Cir.2000) (per curiam).
      We deny Stokes's request to expand the COA to include the prior convictions issue because he has not made a "substantial showing of the denial of a constitutional right[.]” Id. (citation omitted). In Apprendi, the Supreme Court expressly held, "[ojther than the fact of a prior conviction, any fact that increases the penalty for a crime beyond the prescribed statutory maximum must be submitted to a jury ...” 530 U.S. at 490, 120 S.Ct. 2348 (emphasis added). That is, prior convictions are an exception to the Apprendi rule. See United States v. Weiland, 420 F.3d 1062, 1079 & n. 16 (9th Cir.2005), cert. denied, - U.S. -, 126 S.Ct. 1911, 164 L.Ed.2d 667 (2006). Accordingly, the trial court's findings of prior convictions to enhance Stokes's sentence did not contravene Apprendi.
      
      However, we grant Stokes's request to expand the COA to include the issue of whether the trial court violated Apprendi by enhancing his sentence based on a judicial finding of aggravating circumstances. On this issue, Stokes has made a "substantial showing of the denial of a constitutional right[.]” Solis, 219 F.3d at 926 (citation omitted).
     
      
      . The last-reasoned state court decision for Stokes's claim regarding the judge’s act of disregarding the jury's findings of dangerousness is the Court of Appeals’s July 20, 2000 memorandum decision. This is the last-reasoned state court decision because the state supreme court denied review on direct appeal without comment. The subsequent "minute entry" denying Stokes’s petition for post-conviction relief did not address the unlawful sentence issue, as Stokes did not raise it in his petition for post-conviction relief.
      With respect to the propriety of the judge’s findings of aggravating circumstances, however, there is no last-reasoned state court decision. Accordingly, we "perform an independent review of the record to ascertain whether the state court decision was objectively unreasonable.” Pham v. Terhune, 400 F.3d 740, 742 (9th Cir.2005) (per curiam) (citation and internal quotation marks omitted).
     
      
      . Even though Apprendi was decided after the sentencing order, Apprendi nevertheless constitutes applicable, controlling federal law for purposes of this appeal. Because "Apprendi was decided while [Stokes's] case was still on direct review[,] ... the rule announced in Apprendi can be asserted by [Stokes] in a § 2254 petition.” Schardt v. Payne, 414 F.3d 1025, 1035 n. 10 (9th Cir.2005) (citation omitted).
     
      
      . This conclusion is reinforced by the legislative activity surrounding § 13-702(C) and § 13-702.01(E), the applicable sentencing statutes, both of which were amended in 2005.
      Pre-2005, § 13-702(C) stated that "the court shall consider the following aggravating circumstances!)]" Ariz.Rev.Stat. Ann. § 13-702(C) (1999) (emphasis added). As amended, this subsection now states that "the trier of fact shall determine and the court shall consider the following aggravating circumstances!.]” Ariz.Rev.Stat. Ann. § 13-702(C) (2005) (emphasis added).
      Similarly, pre-2005, § 13-702.01(E) stated: ''[I]f a person is convicted of a felony offense and has two or more historical prior felony convictions and if the court finds that at least two substantial aggravating factors ... apply, the court may increase the maximum term of imprisonment ..." Ariz.Rev.Stat. Ann. § 13-702.01(E) (1993) (emphasis added). As amended, the subsection stated: "[I]f a person is convicted of a felony offense and has two or more historical prior felony convictions and if the trier of fact finds beyond a reasonable doubt that at least two aggravating factors ... apply, the court may increase the maximum term of imprisonment ...” Ariz. Rev.Stat. Ann. § 13-702.01(E) (2005) (emphasis added). The legislature also added subsection (J), which states that " ‘trier of fact' means a jury." Id. § 13-702.01(1). Further amendments in 2006 preserved these changes, in effect. See 2006 Ariz. Legis. Serv. Ch. 148 (West).
      Under the current statutes, aggravating factors are to be found by a jury beyond a reasonable doubt, and not by the court. This change, as well as the revision to § 13-702(C), indicates that the legislature recognized that the pre-2005 versions used by the judge in this case were problematic.
     