Appellant entered into a plea bargain in which he waived his right to trial in exchange for a maximum sentence of 15 years. He was sentenced to a total term of 15 years. On appeal, he contended that the trial court improperly stayed the five-year enhancement on the second serious felony conviction because a stay is not authorized under section 667, subdivision (a)(1). He also argued that the upper term sentence on count one violated his Sixth Amendment rights under Blakely. The appellate court agreed with the first argument, but rejected the Blakely claim. Section 667(a)(1) mandates a five-year enhancement for a second felony conviction, and the court lacked discretion to strike or stay the sentence. Appellant did not agree to a specific sentence, but only to a maximum term. Therefore, the court’s unauthorized sentence can be reviewed on appeal. However, appellant’s second sentencing claim fails under People v. Black because the discretion to impose the upper term does not implicate a defendant’s Sixth Amendment right to a jury trial. The imposition of the upper term was justified because the factors in aggravation outweighed the single mitigating factor.