delivered the opinion of the court:
Michael J. Waller, State’s Attorney of Lake County, brings this original action for mandamus (Ill. Const. 1970, art. VI, § 4(a)) to compel the circuit court, pursuant to section 5 — 8—4(b) of the Unified Code of Corrections (730 ILCS 5/5 — 8—4(b) (West 1998)), to impose consecutive, rather than concurrent, sentences upon defendant, Roberto Flores. For the reasons that follow, the writ of mandamus is granted.
BACKGROUND
On August 17, 1999, defendant was convicted by a jury of three counts of predatory criminal sexual assault of a child. 720 ILCS 5/12 — 14.1 (West 1998). These convictions related to three separate incidents, involving three different minors, which occurred in Lake County between December 1, 1997, and August 1, 1998. Defendant’s sentencing hearing was held on October 22, 1999. During this hearing, the prosecutor argued that “pursuant to statute,” specifically, section 5 — 8—4(a) of the Unified Code of Corrections (730 ILCS 5/5 — 8—4(a) (West 1998)), the sentences imposed upon defendant with *396respect to each count must be imposed consecutively. The relevant portion of subsection (a) of section 5 — 8—4 provides:
“The court shall not impose consecutive sentences for offenses which were committed as part of a single course of conduct during which there was no substantial change in the nature of the criminal objective, unless *** the defendant was convicted of a violation of Section *** 12— 14.1 of the Criminal Code of 1961, in which event the court shall enter sentences to run consecutively.” 730 ILCS 5/5— 8 — 4(a) (West 1998).
Subsequently to the prosecutor’s request for the imposition of consecutive sentences, the following exchange occurred between the prosecutor and the court:
“THE COURT: What do you mean pursuant to statute? This isn’t the single transaction on three different victims? [Prosecutor]: It is in the same course of conduct.
THE COURT: Three different victims, three different days isn’t the same course of conduct. He can’t interpret the same course of conduct as being an overall reason to sexually assault children any more than rob a gas station.
* * *
Maybe the law has changed, but I looked this up a few years ago. You can’t tell from the statute. Your interpretation would be plausible by the words of the statutes themselves.”
In the alternative, the prosecutor argued before the circuit court that, even if the offenses forming the basis of defendant’s convictions were found to have not been committed in the “same course of conduct” within the meaning of subsection (a) of section 5 — 8—4, the imposition of consecutive sentences was nevertheless required pursuant to subsection (b) of section 5 — 8—4. The relevant portion of subsection (b) provides:
“The court shall not impose a consecutive sentence except as provided for in subsection (a) unless *** multiple sentences of imprisonment are imposed on a defendant for offenses that were not committed as part of a single course of conduct during which there was no substantial change in the nature of the criminal objective, and one of the of*397fenses for which the defendant was convicted was *** a violation of Section *** 12 — 14.1 of the Criminal Code of 1961, in which event the Court shall enter sentences to run consecutively.” 730 ILCS 5/5 — 8—4(b) (West 1998).
The prosecutor contended that, under the facts presented in this case, subsection (b) mandated that the circuit court impose consecutive sentences upon defendant. First, the prosecutor noted, defendant had been convicted of three counts of predatory criminal sexual assault of a child under section 12 — 14.1 of the Criminal Code of 1961 (720 ILCS 5/12 — 14.1 (West 1998)), a triggering offense mandating the imposition of consecutive sentences. Second, the prosecutor argued that the nature of defendant’s criminal objective, specifically, his sexual gratification, had not substantially changed during the course of committing the offenses.
After a brief recess, the circuit court rejected the State’s argument that either subsection (a) or (b) of section 5 — 8—4 mandated the imposition of consecutive sentences. The circuit court stated:
“The problem is not only the time span, but the single course, the nature of the criminal objective. In my opinion, we have three victims, the nature of the criminal objective changes. We can’t classify this as the criminal objective being sexually assaulting children. That is my opinion on the cases.”
The circuit court sentenced defendant to a 25-year term of imprisonment on each of the three counts, and ordered that the sentences be served concurrently.
Thereafter, the State filed with the circuit court a “motion to conform the sentences to section 5 — 8—4,” arguing in the alternative that either subsection (a) or (b) applied, and concluding that either section mandated the imposition of consecutive sentences. No response was filed to the State’s motion. The circuit court denied the motion. We allowed the State’s motion for leave to file a petition for a writ of mandamus. 155 Ill. 2d R. 381. No *398response has been filed in this court to the State’s petition.
ANALYSIS
Mandamus is an extraordinary remedy used to enforce, as a matter of right, a public officer’s performance of his or her public duties where no exercise of discretion on the officer’s part is involved. Lewis E. v. Spagnolo, 186 Ill. 2d 198, 229 (1999); Madden v. Cronson, 114 Ill. 2d 504, 514 (1986). A writ of mandamus “provides affirmative rather than prohibitory relief [citation] and can be used to compel the undoing of an act.” Noyola v. Board of Education of the City of Chicago, 179 Ill. 2d 121, 133 (1997). A writ of mandamus will be granted only if a plaintiff can establish a clear, affirmative right to relief, a clear duty of the public officer to act, and clear authority in the public officer to comply with the writ. Spagnolo, 186 Ill. 2d at 229; Noyola, 179 Ill. 2d at 133. Mandamus is not a substitute for appeal. Kellerman v. Crowe, 119 Ill. 2d 111, 118 (1987).
Before this court, the State has abandoned as its primary argument the contention advanced in the circuit court that subsection (a) of section 5 — 8—4 mandates that consecutive sentences be imposed upon defendant. Therefore, for the purpose of this appeal, we accept the finding of the circuit court that defendant did not commit the offenses as part of a “single course of conduct during which there was no substantial change in the nature of the criminal objective,” within the meaning of subsection (a). The State presently focuses its argument on subsection (b) of section 5 — 8—4, and maintains that defendant is subject to mandatory consecutive sentences under this provision. We agree.
Subsection (b) of section 5 — 8—4 was amended by Public Act 90 — 128, effective July 22, 1997. Prior to the 1997 amendment, subsection (b) left within the circuit court’s discretion the question of whether to impose con*399secutive sentences upon a defendant convicted of committing multiple offenses in separate courses of conduct. The provision allowed the court to impose consecutive sentences if, based upon the “nature and circumstances of the offense and the history and character of the defendant,” the court was “of the opinion that such a term is required to protect the public from further criminal conduct by the defendant.” 730 ILCS 5/5 — 8—4(b) (West 1996).
This court, in People v. Bole, 155 Ill. 2d 188 (1993), observed that the interplay between subsection (a) of section 5 — 8—4 and the preamended version of subsection (b) created “something of an anomaly, [in that it mandated the imposition of consecutive sentences for offenses committed in a single course of conduct, while] leaving the question of consecutive sentences within the discretion of the trial judge in what must be deemed the more serious situation of multiple offenses committed in separate courses of conduct.” Bole, 155 Ill. 2d at 198. We opined that although this result “might simply have been an oversight by the legislature,” it was “not one that we are able to correct under the guise of statutory interpretation.” Bole, 155 Ill. 2d at 198-99.
In response to Bole, the Illinois General Assembly passed the 1997 amendment to subsection (b), which mandated that the circuit court “shall enter sentences to run consecutively” when two factors are present. First, “multiple sentences of imprisonment” must be “imposed on a defendant for offenses that were not committed as part of a single course of conduct during which there was no substantial change in the nature of the criminal objective.” 730 ILCS 5/5 — 8—4(b) (West 1998). Second, a defendant must be convicted of one of several triggering offenses enumerated in subsection (b).1 730 ILCS 5/5 — 8— 4(b) (West 1998). A review of the 1997 amendment to *400subsection (b) of section 5 — 8—4 establishes that these changes “eliminat[ed] the trial court’s discretion to impose concurrent sentences when the enumerated offenses are committed in separate courses of conduct.” People v. Conley, 306 Ill. App. 3d 1, 11 n.1 (1999).
The offenses in this case were committed by defendant between December 1997 and August 1998, after the July 1, 1997, effective date of the amendment to subsection (b). Therefore, the amended version of this statutory subsection governs the matter at bar. Applying the provisions of subsection (b) to the instant cause, we find that the two factors requiring imposition of mandatory consecutive sentences on defendant were present here. First, multiple sentences of imprisonment were imposed upon defendant for “offenses that were not committed as part of a single course of conduct during which there was no substantial change in the nature of the criminal objective.” 730 ILCS 5/5 — 8—4(b) (West 1998). Second, defendant was found guilty of three counts of predatory criminal sexual assault of a child under section 12 — 14.1 of the Criminal Code of 1961 (720 ILCS 5/12 — 14.1 (West 1998)), one of the enumerated offenses which trigger the application of mandatory consecutive sentences under subsection (b).
As stated, a writ of mandamus will not be granted unless a plaintiff can show a clear, affirmative right to relief, a clear duty on the part of the public officer to act, and clear authority in the public officer to comply with the writ. We find that the necessary factors for the issuance of a writ of mandamus are present in this case.
Section 5 — 8—4(b) of the Unified Code of Corrections *401imposes specific requirements upon the circuit court with respect to the imposition of mandatory consecutive sentences, and the circuit court is responsible under the statute for enforcement of these sentencing requirements and imposing the appropriate sentence. The record reveals that, in the matter at bar, the circuit court did not apply the law as specified in section 5 — 8—4(b). Once the circuit court determined that defendant was not subject to mandatory consecutive sentences pursuant to subsection (a) of section 5 — 8—4 because defendant had not committed the offenses “as part of a single course of conduct during which there was no substantial change in the nature of the criminal objective,” the circuit court’s exercise of discretion was completed. Subsection (b) of section 5 — 8—4 unequivocally mandates imposition of consecutive sentences when multiple sentences of imprisonment are imposed on a defendant for the enumerated offenses when the offenses are committed in separate courses of conduct. See Conley, 306 Ill. App. 3d at 11 n.l. Because the circuit court had previously determined that defendant had not committed the offenses as part of a single course of conduct during which there was no substantial change in the nature of his criminal objective, and had imposed multiple sentences of imprisonment for an enumerated triggering offense, the circuit judge had no further discretion to exercise when sentencing defendant. It is well established that a sentencing judge “cannot impose a penalty not otherwise allowed by the sentencing statute in question.” People v. Wooters, 188 Ill. 2d 500, 506 n.l (1999); People ex rel. Daley v. Strayhorn, 119 Ill. 2d 331, 336 (1988). Because the concurrent sentences imposed upon defendant by the circuit court were not authorized by section 5 — 8—4(b), those sentences are void. See People v. Arna, 168 Ill. 2d 107, 113 (1995). Under the circumstances presented, the issuance of a writ of mandamus is appropriate to compel *402the circuit court to comply with mandatory legal standards. Strayhorn, 119 Ill. 2d at 336 (writ of mandamus appropriate in a homicide case to compel the trial court to comply with mandatory sentencing guidelines imposed by statute); see also Baltimore & Ohio R.R. Co. v. Mosele, 67 Ill. 2d 321, 334 (1977) (writ of mandamus issued to correct clear errors in the circuit court’s application of mandatory venue requirements); People ex rel. Chesapeake & Ohio Ry. Co. v. Donovan, 30 Ill. 2d 178, 180-81 (1964) (writ of mandamus issued directing circuit court to vacate order denying dismissal motion and “to rule upon that motion in the light of the applicable legal standards”).
CONCLUSION
For the foregoing reasons, the judgment of the circuit court is vacated. The writ of mandamus is issued. The matter is remanded to the circuit court, which is directed to resentence defendant in conformity with section 5 — 8—4(b) of the Uniform Code of Corrections, which requires that the sentences imposed upon defendant for each conviction for predatory criminal sexual assault of a child be served consecutively. It remains within the discretion of the circuit court to determine, within the permissible statutory sentencing range (see 720 ILCS 5/12 — 14.1 (West 1998); 730 ILCS 5/5 — 8—1(a)(3) (West 1998)), the length of each sentence to be imposed.
Judgment vacated;
writ issued;
cause remanded with directions.
took no part in the consideration or decision of this case.