The opinion of the court was delivered by: Justice Garman
 Docket No. 95713-Agenda 4-November 2003.
 In 1999, defendant, Ernest Thompson, entered negotiated pleas of guilty to one count of aggravated battery (720 ILCS 5/12-4(b)(11) (West 1998)) and one count of violation of an order of protection (720 ILCS 5/12-30(a) (West 1998)). Because defendant had been previously convicted of violating an order of protection, the latter charge was a Class 4 felony (720 ILCS 5/12-30(d) (West 1998)). In return for defendant's plea, the State agreed to dismiss two other counts of the indictment.
 There was no agreement as to sentencing. At the guilty plea hearing, the circuit court of Champaign County admonished defendant pursuant to Supreme Court Rule 402 (177 Ill. 2d R. 402) and obtained a factual basis for the plea. Following a sentencing hearing, the circuit court imposed an extended-term sentence of nine years on the aggravated battery conviction and a concurrent, extended-term sentence of six years on the conviction of violation of an order of protection.
 On February 28, 2000, defendant filed a pro se post-conviction petition pursuant to the Post-Conviction Hearing Act (Act) (725 ILCS 5/122-1 through 122-8 (West 1998)). Although the petition advanced various general constitutional claims, defendant did not challenge his sentences. The circuit court dismissed the petition as frivolous and patently without merit. On appeal, defendant argued that (1) his extended-term sentences violated Apprendi v. New Jersey, 530 U.S. 466, 147 L. Ed. 2d 435, 120 S. Ct. 2348 (2000); (2) Public Act 83-942 (Pub. Act 83-942, eff. November 23, 1983), amending the Act to allow dismissals of petitions prior to the appointment of counsel, violated the single subject rule of the Illinois Constitution (Ill. Const. 1970, art. IV, §8(d)); and (3) the extended-term sentence for violation of an order of protection is void because an extended-term sentence could be imposed only on the aggravated battery conviction. The appellate court rejected all three contentions. As to the third argument, the court acknowledged that where a defendant has been convicted of multiple offenses of differing classes, an extended-term sentence may be imposed only on the conviction for the offense within the most serious class. However, the court found that the issue was not cognizable in post-conviction proceedings, as it is not a matter of substantial deprivation of constitutional rights. The court also found that defendant had waived the issue by not raising it prior to his post-conviction appeal. 335 Ill. App. 3d 1027, 1029-30. We granted defendant's petition for leave to appeal (177 Ill. 2d R. 315).
 Defendant argues that the extended-term portion of his sentence for violation of an order of protection is void and that he may, therefore, attack it at any time, even in this post-conviction appeal. The State argues that the sentence is not void, but is merely voidable. The State further contends that defendant has waived his right to challenge the extended-term sentence because he failed to raise the issue before the circuit court on a motion to withdraw guilty plea or in his post-conviction petition. These issues raise questions of law which we review de novo. People v. Hall, 198 Ill. 2d 173, 177 (2001).
 Section 5-8-2(a) of the Unified Code of Corrections (Code) (730 ILCS 5/5-8-2(a) (West 1998)) provides in relevant part that "[a] judge shall not sentence an offender to a term of imprisonment in excess of the maximum sentence authorized by Section 5-8-1 for the class of the most serious offense of which the offender was convicted unless the factors in aggravation set forth in paragraph (b) of Section 5-5-3.2 were found to be present." Aggravated battery is a Class 3 felony (720 ILCS 5/12-4(e) (West 1998)), while violation of an order of protection with a prior violation is a Class 4 felony (720 ILCS 5/12-30(d) (West 1998)). In People v. Jordan, 103 Ill. 2d 192, 206 (1984), this court held that the plain language of section 5-8-2(a) of the Code requires that when a defendant has been convicted of multiple offenses of differing classes, an extended-term sentence may be imposed only on the conviction within the most serious class.
 The State concedes that defendant's extended-term sentence on his conviction for violation of an order of protection was improper under Jordan. In the appellate court, the State did not contest defendant's assertion that the extended-term portion of his sentence was void. However, it now argues that the improper portion of the sentencing order is merely voidable, thus making the error capable of waiver.
 The principle has often been stated that a sentence, or portion thereof, that is not authorized by statute is void. See, e.g., People ex rel. Waller v. McKoski, 195 Ill. 2d 393, 401 (2001); People v. Williams, 179 Ill. 2d 331, 336 (1997); People v. Arna, 168 Ill. 2d 107, 113 (1995); People v. Wade, 116 Ill. 2d 1, 5-6 (1987); In re T.E., 85 Ill. 2d 326, 333 (1981); People v. Simmons, 256 Ill. App. 3d 651, 652 (1993); People v. Perruquet, 181 Ill. App. 3d 660, 663 (1989).
 This principle applies in the instant case. Defendant was convicted of two offenses of differing classes. Pursuant to section 5-8-2(a) of the Code, the circuit court could impose an extended-term sentence only on the greater offense, i.e., aggravated battery. Accordingly, the extended-term sentence imposed on the order of protection conviction was unauthorized by statute and void.
 The State's voidable argument is not supported by the above case law. People v. Davis, 156 Ill. 2d 149 (1993), cited by the State, is not a sentencing case. The State further attempts to support the appellate court's decision in this case by noting that the circuit court had the authority to impose extended-term sentences in one judgment provided it were to find that defendant's two offenses were unrelated. Thus, the State argues, the improperly imposed extended-term sentence is merely voidable. This court, in People v. Coleman, 166 Ill. 2d 247, 257 (1995), held that section 5-8-2(a) of the Code allows imposition of extended-term sentences on separately charged offenses of differing classes that arise from unrelated courses of conduct. The State does not argue, however, that defendant's two offenses were unrelated. In fact, a reading of the counts of the indictment to which defendant pleaded guilty leaves no doubt that both offenses arose from precisely the same course of conduct on defendant's part, i.e., striking the victim about her head and face with his hands or fists. That the circuit court may validly impose extended-term sentences on multiple offenses of differing classes in circumstances not present here does not make the sentence imposed on defendant voidable.
 We have very recently reiterated that a sentence which does not conform to a statutory requirement is void. People v. Pinkonsly, 207 Ill. 2d 555, 569 (2003), quoting People v. Arna, 168 Ill. 2d 107, 113 (1995). As the circuit court here lacked the statutory authority to impose an extended-term sentence on the conviction for violation of an order of protection, the extended-term portion of that sentence is void.
 We now turn to the question of whether defendant may challenge the void order in this appeal. It is a well-settled principle of law that a void order may be attacked at any time or in any court, either directly or collaterally. See, e.g., Sarkissian v. Chicago Board of Education, 201 Ill. 2d 95, 103 (2002), quoting Barnard v. Michael, 392 Ill. 130, 135 (1945); JoJan Corp. v. Brent, 307 Ill. App. 3d 496, 502 (1999); Potenz Corp. v. Petrozzini, 170 Ill. App. 3d 617, 618 (1988).
 Defendant cites our decision in Arna, where the defendant was convicted of two counts of attempted first degree murder and sentenced to concurrent terms of imprisonment. Although the State did not raise the issue on appeal, the appellate court, sua sponte, determined that consecutive sentences were mandatory. The court vacated the defendant's sentences and remanded to the circuit court for imposition of consecutive sentences. This court affirmed, finding that the circuit court's order imposing concurrent sentences was not authorized by statute and was void. Because the order was void, the appellate court had the authority to correct it at any time and, consequently, did not err in vacating the concurrent sentences. Arna, 168 Ill. 2d at 113.
 In Perruquet, the defendant was convicted of deviate sexual assault, rape, and aggravated kidnapping and received extended-term sentences on all convictions. In a decision that predated our decision in Jordan, the appellate court rejected the defendant's argument that, under section 5-8-2(a) of the Code, he could not receive an extended-term sentence on the aggravated kidnapping conviction because that offense was a Class 1 felony, whereas the other two offenses were Class X felonies. Sometime after the Jordan decision was issued, the defendant filed a post-conviction petition, in which he did not raise any argument as to his extended-term sentence on the aggravated kidnapping conviction. The circuit court dismissed the petition as frivolous and without merit. On appeal, the defendant did raise the argument. The appellate court held that the extended-term portion of the sentence was void under Jordan. The court rejected the State's argument that the sentencing issue was a matter of statutory construction and, therefore, not cognizable in a post-conviction ...