(No. 100956.

#### THE PEOPLE OF THE STATE OF ILLINOIS, Appellant, v. WOODROW BROWN, Appellee.

*Opinion filed April 5, 2007.*

*191Lisa Madigan, Attorney General, of Springfield, and Richard A. Devine, State’s Attorney, of Chicago (Linda D. Woloshin and Michael Glick, Assistant Attorneys General, of Chicago, and James E. Fitzgerald, Alan J. Spellberg *192and Mary L. Boland, Assistant State’s Attorneys, of counsel), for the People.

Michael J. Pelletier, Deputy Defender, and Heidi Linn Lambros, Assistant Appellate Defender, of the Office of the State Appellate Defender, of Chicago, for appellee.

JUSTICE KARMEIER

delivered the judgment of the court, with opinion.

Chief Justice Thomas and Justices Freeman, Fitzgerald, Kilbride, Carman, and Burke concurred in the judgment and opinion.

OPINION

Defendant, Woodrow Brown, is an inmate in the Department of Corrections, where he is serving a 28-year sentence for attempted murder of a police officer, a crime he committed in 1997 at the age of 16. The issue presented by this case is whether defendant should be granted postconviction relief on the grounds that the statute under which he was transferred from juvenile custody to criminal court and subsequently sentenced was declared invalid by our court in *People v. Cervantes,*189 Ill. 2d 80 (1999). The circuit court of Cook County found defendant’s claim to be frivolous and patently without merit. The appellate court reversed and remanded for a new transfer hearing in accordance with the law currently in effect. 358 Ill. App. 3d 56. The State petitioned for leave to appeal (210 Ill. 2d R. 315), which we allowed. Defendant then asked for cross-relief, claiming that the appellate court erred in determining which statute should govern his transfer hearing on remand. For the reasons that follow, the judgment of the appellate court is affirmed in part and reversed in part, and the cause is remanded to the circuit court for further proceedings, with directions.

*193The events giving rise to this case began in October of 1997, when Chicago Housing Authority Officer William Henderson was shot in the face with a .22-caliber rifle at close range, breaking his jaw. Defendant was arrested for the crime. Because he was 16 years old at the time, he was initially the subject of a petition for adjudication of wardship pursuant to the Juvenile Court Act of 1987 (705 ILCS 405/1 — 1 *et seq.*(West 1996)). The State’s petition alleged that defendant had committed the offenses of attempted murder, aggravated battery with a firearm, and aggravated discharge of a weapon.

In February of 1998, the State petitioned to have defendant tried as an adult under this state’s criminal laws. Pursuant to that petition, a transfer hearing was conducted by the circuit court in accordance with the standards set forth in section 5 — 4(3.3) of the Juvenile Court Act of 1987 (705 ILCS 405/5 — 4(3.3) (West 1996)), which had been enacted as part of Public Act 88 — 680, eff. January 1, 1995, commonly known as the Safe Neighborhoods Law. That provision stated that if a juvenile was charged with a Class X felony (other than armed violence) or various other serious offenses and the court determined that there was probable cause to believe that the allegations were true, there was a rebuttable presumption that the minor was not a fit and proper subject to be dealt with under the Juvenile Court Act of 1987 and that the cause should to be transferred to criminal court.

The circuit court allowed the petition and ordered defendant’s case to be heard under this state’s criminal laws. Defendant was subsequently indicted on two counts of attempted first degree murder, one count of aggravated battery with a firearm and four counts of aggravated battery.

The following October, defendant agreed to plead guilty to one count of attempted first degree murder of a *194peace officer, a Class X felony (720 ILCS 5/8 — 4(c)(1) (West 1996)), in exchange for dismissal of all other charges and imposition of a sentence of 28 years’ imprisonment. Defendant never moved to withdraw his plea or sentence, nor did he bring a direct appeal. In March of 1999, however, he filed a petition under the Post-Conviction Hearing Act (725 ILCS 5/122 — 1 *et seq.*(West 1998)) alleging that he had received ineffective assistance of counsel because one of the public defenders who represented him had misled him about the circumstances regarding his guilty plea and the length of the prison term he would receive.

Defendant’s petition was summarily dismissed by the trial court on the grounds that it was frivolous and patently without merit. See 725 ILCS 5/122 — 2.1(a)(2) (West 1998). Defendant failed to timely appeal from the circuit court’s judgment, and his motion for leave to file a late notice of appeal was denied.

There were no further developments in the case until June of 2003, when defendant filed a new postconviction petition. Although successive postconviction petitions are generally not permitted (see 725 ILCS 5/122 — 3 (West 1998)), defendant argued that fundamental fairness called for relaxation of that rule in this case (see *People v. Morgan,*212 Ill. 2d 148, 153 (2004)) because the Safe Neighborhoods Law, which added the rebuttable presumption provision under which he was transferred to criminal court, had since been declared unconstitutional and void *ab initio*by our court in *People v. Cervantes,*189 Ill. 2d 80 (1999), on the grounds that it violated the single-subject clause of the Illinois Constitution of 1970 (Ill. Const. 1970, art. *W,*§8(d)).

The circuit court rejected defendant’s argument. As it had with defendant’s initial postconviction petition, it dismissed his successive petition as frivolous and patently without merit. Defendant appealed. The appellate court *195unanimously reversed. In so doing, it did not rely on the fundamental fairness exception to the normal prohibition against successive postconviction petitions. Rather, based on a previous decision by the appellate court in *People v. Pena,*321 Ill. App. 3d 538 (2001), the court reasoned that because the statutory provisions under which defendant was transferred from juvenile to criminal court and then sentenced were found to be void *ab initio,*defendant’s transfer, plea and conviction were likewise void. Invoking the principles that a claim that a judgment is void is not subject to waiver and may be raised at any time, either directly or collaterally, and that courts have an independent duty to vacate void orders and may vacate a void order *sua sponte*even if it is not challenged by the parties (see *People v. Thompson,*209 Ill. 2d 19, 27 (2004)), the court concluded that it was obliged to vacate defendant’s conviction and remand for a new transfer hearing. 358 Ill. App. 3d at 60.

Having reached that conclusion, the court next considered what law should govern the new transfer hearing following remand. The reason this was problematic was that after our court invalidated the Safe Neighborhoods Law in *People v. Cervantes,*189 Ill. 2d 80, the General Assembly enacted Public Act 90 — 590, eff. January 1, 1999, commonly known as the Juvenile Justice Reform Provisions of 1998. The new law, codified at 705 ILCS 405/5 — 805(2)(a) (West 1998), contains a presumptive transfer provision virtually identical to the Safe Neighborhoods Law provision under which defendant’s original transfer was carried out. For the purposes of this appeal, the only difference is that unlike the Safe Neighborhoods Law, the Juvenile Justice Reform Provisions of 1998 have not been challenged on single-subject grounds.

While the new law was not a departure from the standards which governed defendant’s original transfer, *196it did represent a change as compared to the law in effect before the Safe Neighborhoods Law was enacted. Under the former law, there was no presumption in favor of transfer. See 705 ILCS 405/5 — 4 (West 1992). Except in certain circumstances not present in this case, the determination as to whether a juvenile should be tried under the criminal laws was a matter for the court’s sound discretion based on its assessment of various statutory factors and any other relevant matters. See *People v. Clark,*119 Ill. 2d 1, 12-14 (1987). In light of this difference, defendant argued that if he is subject to the new law on remand rather than the law as it existed before the Safe Neighborhoods Law took effect, it will be significantly easier for the State to obtain his transfer to criminal court and greatly increase the possibility that the punishment he ultimately receives will be more severe. According to defendant, such a result would contravene the intent of the legislature and violate the prohibitions against *ex post facto*laws set forth in the United States Constitution.1

The appellate court disagreed. It held that application of the presumptive-transfer provision would not violate the prohibition against *ex post facto*laws because the provision does not provide for a greater punishment. It merely affects the procedure by which punishment is determined. Similarly, the court reasoned that while the provision does contain a burden of proof standard not present in the prior law, *ex post facto*concerns are not implicated because the new burden does not affect the determination of guilt or innocence, does not make it easier for the State to obtain a conviction, and does not alter any available defenses. 358 Ill. App. 3d at 63-64. *197The court therefore held that the new presumptive-transfer provision set forth in the Juvenile Justice Reform Act may be applied to defendant’s case on remand. 358 Ill. App. 3d at 64-65.

In its appeal to our court, the State argues that the appellate court’s analysis of defendant’s claims is erroneous. As previously indicated, the appellate court’s decision was predicated on our holding in *People v. Cervantes,*189 Ill. 2d 80 (1999), that Public Act 88 — 680, the statute pursuant to which defendant was transferred to criminal court and subsequently sentenced, is void. The State does not take issue with that holding. Rather, it contends that the appellate court applied the holding incorrectly. Specifically, it argues that while the statute itself may be void, defendant’s transfer, conviction and sentence are merely voidable. As a result, defendant may not avail himself of the rule that void judgments may be attacked at any time. Instead, the challenge to his transfer, conviction and sentence must meet the normal requirements governing successive petitions for postconviction relief.

The State contends that those requirements have not been satisfied by defendant in this case. In the State’s view, the arguments upon which defendant’s postconviction petition is premised have been waived. While the waiver rule may be relaxed based on considerations of “fundamental fairness,” the State argues that under *People v. Pitsonbarger,*205 Ill. 2d 444 (2002), establishing fundamental fairness requires a showing that there was a legally cognizable cause for defendant’s failure to raise the claim in his initial postconviction proceeding and that actual prejudice would result if defendant were denied consideration of the claimed error. According to the State, defendant has failed to meet either prong of this test. It asserts that the circuit court was therefore correct in summarily denying defendant’s postconviction petition.

*198Defendant, for his part, contends that the circuit court’s judgment was properly reversed by the appellate court. In his view, the appellate court was correct in holding that the constitutional defects in the Safe Neighborhoods Law rendered his transfer, conviction and sentence void, not merely voidable, and that he was entitled to a new transfer hearing on remand. Where defendant parts company with the appellate court is with respect to the law which should govern the proceedings on remand. Defendant asserts that the appellate court erred in rejecting his *ex post facto*claims and that his case should be governed by the law as it existed prior to enactment of the Safe Neighborhoods Law and Juvenile Justice Reform Provisions of 1998.

In analyzing the parties’ respective arguments, we begin by noting that our review of this case is *de novo.*That is so because the matter comes before us on review of the summary dismissal of a postconviction petition and presents only questions of law. See *People v. Boclair,*202 Ill. 2d 89, 97 (2002); *People v. Daniels,*187 Ill. 2d 301, 307 (1999).

The first question we must address is whether the appellate court was correct in concluding that defendant’s transfer from juvenile to criminal court was void. We believe that it was. As indicated earlier in this opinion, the statutory provisions pursuant to which defendant’s transfer was carried out were enacted as part of the Safe Neighborhoods Law (Public Act 88 — 680), a statute which we found to be unconstitutional in *People v. Cervantes,*189 Ill. 2d 80 (1999). Under the established precedent of this court, a statute which violates the single-subject clause is void in its entirety. *People v. Carrera,*203 Ill. 2d 1, 16 (2002). As a result, all of the provisions of the Safe Neighborhoods Law, including the specific provisions amending the Juvenile Court Act of 1987 pursuant to which defendant was transferred to *199criminal court, are invalid. More than that, they are void *ab initio.*As such, they have no force or effect. It is as if they had never been passed. *People v. Carrera,*203 Ill. 2d at 14.

When a court exercises its authority over a minor pursuant to the Juvenile Court Act of 1987, as the court did here in entertaining the State’s transfer petition, it must proceed within the confines of that law and has no authority to act except as that law provides. See *People v. Jaime P,*223 Ill. 2d 526, 540 (2006). Because the particular statutory provisions under which defendant was transferred are void *ab initio*and have never had any valid legal force, it necessarily follows that the transfer itself can be afforded no legal recognition. The transfer is void just as the transfer statute is void. Defendant must therefore be granted a new transfer hearing.

The same conclusion was reached by the appellate court and conceded by the State under similar circumstances in *People v. Pena,*321 Ill. App. 3d 538, 540-41 (2001), a decision upon which the appellate court in this case relied. Unlike *Pena,*in which the validity of the transfer was challenged on direct review of a judgment imposed following a bench trial, the attack on the transfer here comes in the context of a successive post-conviction petition following entry of judgment based on a guilty plea. These distinctions, however, do not alter our analysis. A guilty plea does not preclude a defendant from challenging a circuit court’s judgment as void *ab initio (People v. Guevara,*216 Ill. 2d 533, 542-43 (2005)), and, as the appellate court in this case correctly pointed out, an attack on a void judgment may be raised at any time. It does not depend on the Post-Conviction Hearing Act for its viability. *People v. Thompson,*209 Ill. 2d 19, 26 (2004).

Having concluded that defendant is entitled to a new *200transfer hearing, we must next consider what statute should govern that proceeding. Because the Safe Neighborhoods Law is void *ab initio,*the version of the Juvenile Court Act in existence prior to its amendment by that legislation remained in effect. *Harshman v. DePhillips,*218 Ill. 2d 482, 489 n.1 (2006). The pre-Safe Neighborhoods Law version of the statute was therefore the controlling law in 1997, when defendant committed the offenses which gave rise to this case.

The Juvenile Justice Reform Provisions of 1998, which reinstituted the rebuttable presumption standard of the Safe Neighborhoods Law, were not enacted until the following year and did not take effect until the year after that. As we have indicated, defendant argues that to apply the Juvenile Justice Reform Provisions to his case would violate the United States Constitution’s prohibition against *ex post facto*laws. He further asserts that subjecting his case to the new statute would contravene the intent of the legislature as set forth in the statute.

Statutes are presumed constitutional, and the courts of this state have a duty to construe enactments by the General Assembly so as to uphold their validity if there is any reasonable way to do so. *People v. Jones,*223 Ill. 2d 569, 595-96 (2006). Consistent with this obligation, our court will not consider a constitutional question if the case can be decided on other grounds. If a court can resolve a case on nonconstitutional grounds, it should do so. *People v. Lee,*214 Ill. 2d 476, 482 (2005). Constitutional issues should be reached only as a last resort. *In re E.H.,*224 Ill. 2d 172, 178 (2006).

In the case before us today, the appellate court elected to resolve the parties’ disagreement regarding which version of the law should apply by focusing on defendant’s *ex post facto*challenge. Under the principles we have just reviewed, this approach was improper. Rather than ad*201dressing the *ex post facto*claims, the court should have begun its analysis with consideration of defendant’s non-constitutional contention, namely, that application of the new law to his case would be contrary to the legislature’s intent.

Where, as here, a case implicates a statute enacted after the events giving rise to the litigation, Illinois courts evaluate the temporal reach of the new law in accordance with the standards set forth by the United States Supreme Court in *Landgraf v. USI Film Products,*511 U.S. 244, 128 L. Ed. 2d 229, 114 S. Ct. 1483 (1994). *Commonwealth Edison Co. v. Will County Collector,*196 Ill. 2d 27, 39 (2001). Under the *Landgraf*standards, the threshold inquiry is whether the legislature has expressly prescribed the statute’s temporal reach. If it has, that expression of legislative intent must be given effect absent some constitutional prohibition against doing so. *Allegis Realty Investors v. Novak,*223 Ill. 2d 318, 330 (2006).

The Juvenile Justice Reform Provisions of 1998 contain such a provision. Although the law was enacted in June of 1998, section 4001 — 99 of the statute called for its delayed implementation. The provisions contained in article 1001 were not to take effect until January 1, 2000. The remaining sections of the law, including the provisions containing the rebuttable presumption on transfers, were to take effect on January 1, 1999. In light of these terms, it is clear that the law was intended to have only prospective application. The State has not directed our attention to anything in the United States or Illinois Constitution which would prohibit the law from being applied in that way. We must therefore give effect to the legislature’s intent and conclude that the rebuttable transfer provisions of the Juvenile Justice Reform Provisions of 1998 are applicable only to juvenile proceedings which commenced on or after January 1, 1999.

*202The juvenile proceedings involving the defendant in this case clearly do not fall within that category of cases. As discussed earlier in this opinion, those proceedings were initiated in late 1997, more than a year before the pertinent portions of the Juvenile Justice Reform Provisions of 1998 became operative. Giving effect to the intention of the legislature, as we must, we therefore conclude that the Juvenile Justice Reform Provisions of 1998 are inapplicable to this matter. On remand, defendant’s transfer hearing should, instead, be governed by the version of the Juvenile Justice Act of 1987 in effect prior to enactment of the Safe Neighborhoods Law. In light of this determination, there is no need to reach defendant’s claim that subjecting him to a rebuttable presumption under the Juvenile Justice Reform Provisions of 1998 would contravene the prohibition against *ex post facto*laws. See *People v. Ramsey,*192 Ill. 2d 154, 159-74 (2000) (Bilandic, J., specially concurring). To the extent that the appellate court addressed that argument and reached a contrary result regarding which law will control on remand, its judgment is reversed.

We also reverse the appellate court’s judgment to the extent that it vacated defendant’s conviction outright. Proper disposition of the conviction depends on the outcome of the new transfer hearing following remand. If, after applying the version of the Juvenile Justice Act of 1987 in effect prior to enactment of the Safe Neighborhoods Law, the circuit court determines that defendant’s case should not be transferred to criminal court, there can be no question that defendant’s original conviction cannot be allowed to stand. That is so because absent a transfer, there is no lawful basis for a conviction under this state’s criminal laws. The same is true of defendant’s sentence. Without a valid transfer and subsequent conviction under our criminal laws, the legal predicate for the sentence evaporates.

*203The situation will be different, however, should the circuit court ultimately conclude that transfer for trial under the state’s criminal laws is appropriate. Unlike the transfer provisions of the Safe Neighborhoods Law, the statutory provisions defining the criminal offenses with which defendant was charged and the attempted murder charge for which he was convicted were not affected by this court’s decision in *People v. Cervantes,*189 Ill. 2d 80. The substantive offenses remain unchanged, and their validity remains unquestioned. If the circuit court reaches the same conclusion as it did originally and rules that the case is appropriately handled under the criminal laws, defendant would therefore have no basis for assailing his conviction on the grounds that it is void.

With respect to defendant’s sentence, the issue is somewhat more complex. When defendant entered into the negotiated plea, which included a sentence of 28 years’ imprisonment, defendant and the State believed that his case was subject to a provision in the Safe Neighborhoods Law that had amended section 8 — 4 of the Criminal Code of 1961 (720 ILCS 5/8 — 4 (West 1996)) to increase the authorized sentence for defendant’s offense from the previous range of 15 to 60 years to a new range of 20 to 80 years. In light of *People v. Cervantes,*189 Ill. 2d 80, however, this assumption was incorrect. When *Cervantes*held the Safe Neighborhoods Law to be void *ab initio,*the Act’s amendment to the sentencing range was also rendered void *ab initio.*For reasons we have already explained, that meant that the old 15- to 60-year sentencing range remained in effect and was controlling at the time the plea agreement was reached.

A sentence which exceeds statutory máximums or violates the constitution is void from its inception and subject to challenge at any time, even where, as here, the sentence is imposed as part of a negotiated plea. See *People v. Guevara,*216 Ill. 2d 533, 542-43 (2005); *People*
      *204
      *v. Pullen,*192 Ill. 2d 36, 40, 43 (2000); *People v. Williams,*179 Ill. 2d 331, 333 (1997). In this case, however, defendant’s 28-year sentence was well within the old 15-to 60-year sentencing range which governed defendant’s case. Accordingly, it did not exceed the governing statutory maximum for the offense.

Where a defendant’s sentence complies with the mandatory sentencing guidelines in effect when the sentence was imposed, the defendant is not entitled to a new sentencing hearing merely because some aspect of the sentencing law was subsequently determined to be void on the grounds that it violated the single-subject clause of the Illinois Constitution of 1970. *People v. Reedy,*186 Ill. 2d 1, 16-17 (1999). Applying this principle, our appellate court has held that where, as here, a defendant’s sentence is proper under the version of section 8 — 4 of the Criminal Code of 1961 (720 ILCS 5/8 — 4 (West 1996)) in effect prior to enactment of the Safe Neighborhoods Law, the fact that the amended version of the statute was subsequently held to be void by *People v. Cervantes,*189 Ill. 2d 80 (1999), does not entitle the defendant to a new sentencing hearing. See *People v. Cundiff,*322 Ill. App. 3d 426, 438-39 (2001).

Panels of the Appellate Court, First District, reached a different conclusion in *People v. English,*334 Ill. App. 3d 156 (2002), and *People v. Ruiz,*312 Ill. App. 3d 49 (2000). They held that defendants who were sentenced to imprisonment for attempted murder of a police officer under the 20- to 80-year sentencing range established by the now-invalidated Safe Neighborhoods Law should be granted new sentencing hearings even though the sentences originally imposed were within the 15- to 60-year range imposed under the prior version of the law. At the core of these two decisions is the principle that in criminal cases, the record must establish that the sentence was based on a proper understanding of the ap*205plicable law. *People v. English,*334 Ill. App. 3d at 170; *People v. Ruiz,*312 Ill. App. 3d at 58. In each instance, it was apparent that such an understanding was lacking. Because the Safe Neighborhoods Law had not yet been invalidated when the sentences were imposed, the circuit court, through no fault of its own, did not appreciate that the law’s stiffer sentencing provisions were inapplicable.

That a trial judge must properly understand the applicable sentencing law is a principle that can scarcely be doubted. We nevertheless believe that the analysis in the *English*and *Ruiz*cases is not helpful to the resolution of this case. That is so for several reasons. First, *English*and *Ruiz*fail to take into account the well-established principle that a trial court’s failure to apply a sentencing statute correctly does not necessarily render the sentence wholly invalid as a matter of law. Where the court imposes an excessive sentence because of a mistake of law or fact, the sentence is merely voidable, and the error can be waived. See *People v. Fouts,*319 Ill. App, 3d 550, 552 (2001), citing *People v. Davis,*156 Ill. 2d 149 (1993).

Second, while a sentence, or portion thereof, not authorized by statute is void *(People v. Thompson,*209 Ill. 2d at 23), it is void only to the extent that it exceeds what the law permits. The legally authorized portion of the sentence remains valid. *In re T.E.,*85 Ill. 2d 326, 333 (1981); see *People v. Patterson,*276 Ill. App. 3d 107, 111 (1995). In this case, no aspect of defendant’s sentence exceeds the terms authorized by the law in effect prior to enactment of the Safe Neighborhoods Law. As we have already pointed out, the 28-year term imposed under his plea agreement was squarely within the old 15- to 60-year sentencing range which should have governed these proceedings.

Finally, unlike the sentences in *English*and *Ruiz,*
      *206defendant’s sentence was not imposed by the court following trial. Rather, it was the product of a fully negotiated plea agreement between the defendant and the State. There is nothing in the transcript of the hearing on the plea and sentence to suggest that there was any actual misunderstanding of the governing sentencing standards or that such misunderstanding affected the terms of the plea agreement.

Because defendant’s sentence is not void, his right to bring a postconviction challenge to that sentence must conform to the normal requirements governing postconviction proceedings. Defendant cannot meet those requirements. As noted earlier in this opinion, defendant’s challenge to his sentence is raised for the first time in this, his second, postconviction petition. Where, as here, the death penalty is not involved and the defendant makes no claim of actual innocence, Illinois law prohibits the defendant from raising an issue in a successive postconviction petition unless the defendant can establish a legally cognizable cause for his or her failure to raise that issue in an earlier proceeding and actual prejudice would result if defendant were denied consideration of the claimed error. *People v. Pitsonbarger,*205 Ill. 2d at 459-60.

Defendant’s challenge to the length of his sentence is predicated exclusively on the court’s determination that the Safe Neighborhoods Law, which raised the sentencing range, was unconstitutional and of no effect. Although this court’s decision in *People v. Cervantes,*which declared the statute invalid, was not filed until approximately six months after defendant brought his initial postconviction petition in March of 1999, *Cervantes*was not the first judicial pronouncement on the matter. In September of 1998, approximately five months before defendant’s first postconviction proceeding was initiated, the Appellate Court, Third District, also *207declared the statute invalid. See *People v. Dainty,*299 Ill. App. 3d 235 (1998). The Second District followed suit in February of 1999. See *People v. Williams,*302 Ill. App. 3d 975 (1999). Between 1998 and 1999, when *Cervantes*was issued, the validity of the Safe Neighborhoods Law was, in fact, addressed in published decisions by every appellate district except the Fifth. As we noted in *Cervantes,*the districts split on the question. *People v. Cervantes,*189 Ill. 2d at 85. While the First District, from which this case arose, took the view that the statute did not offend the single-subject rule (see *People v. Wiggins,*298 Ill. App. 3d 766 (1998)), it is clear that legal precedent supporting defendant’s single-subject challenge existed and could have been invoked by him at the time he filed his initial postconviction petition. This is therefore not a situation where the legal basis for the claim was not yet reasonably available. See *People v. Pitsonbarger,*205 Ill. 2d at 460. While it is true that our court had not yet definitively resolved the question, that was not sufficient cause under the cause-and-prejudice test to excuse defendant’s failure to challenge the validity of his sentence when he first sought postconviction relief.

As we indicated earlier in this opinion, the State contends that defendant’s claim also fails the prejudice prong of the cause-and-prejudice test. In light of our conclusion that defendant has failed to establish a legally cognizable cause for his failure to challenge his sentence in the earlier proceeding, however, it is not necessary for our court to reach that argument. Because both cause and prejudice must be shown under *Pitsonbarger (People v. Morgan,*212 Ill. 2d 148, 153 (2004)), defendant’s failure to establish cause is sufficient to preclude him from attacking his sentence through successive postconviction proceedings. The issue has been procedurally defaulted. Should the circuit court conclude, on remand, that defendant’s case was properly transferred to *208criminal court, it should therefore leave undisturbed not only his original conviction but also the 28-year term of imprisonment to which defendant agreed under his plea bargain with the State.

For the foregoing reasons, the judgment of the appellate court is affirmed in part and reversed in part, the judgment of the circuit court is affirmed in part and reversed in part, and the cause is remanded to the circuit court for further proceedings in accordance with the directions set forth in this opinion.

*Appellate court affirmed in part and reversed in part; circuit court affirmed in part and reversed in part; cause remanded with directions.*

Article I, section 9, clause 3, of the United States Constitution states that no “ex post facto Law shall be passed.” Article I, section 10, clause 1, provides that “[n]o State shall ***** pass any *** ex post facto Law ***.”