
940 N.E.2d 1062 (2010)
239 Ill.2d 205
The PEOPLE of the State of Illinois, Appellant,
v.
Dione ALEXANDER, Appellee.
No. 108932.
Supreme Court of Illinois.
November 18, 2010.
*1063 Lisa Madigan, Atty. Gen., Kevin W. Lyons, State's Atty., of Peoria (Michael A. Scodro, Solicitor Gen., Michael M. Glick, Charles Redfern, Asst. Attorneys Gen., of Chicago, Patrick Delfino, Terry A. Mertell, Dawn Duffy, of Office of State's Attorneys Appellate Prosecutor, of Ottawa, of counsel), for the People.
Michael J. Pelletier, State Appellate Def., Robert Agostinelli, Deputy Def., Jay Wiegman, Asst. Appellate Def., of Office of the State Appellate Def., of Ottawa, for appellee.

OPINION
Justice BURKE delivered the judgment of the court, with opinion.
Defendant Dione Alexander was convicted of aggravated discharge of a firearm and unlawful use of weapons and sentenced to 24 years' imprisonment by the circuit court of Peoria County. The appellate court found defendant's sentence to be excessive and reduced it to the statutory mandatory minimum of six years. No. 3-08-0373 (unpublished order under Supreme Court Rule 23). For the reasons that follow, we reverse the appellate court's judgment and reinstate defendant's 24-year sentence.

BACKGROUND
Defendant's convictions resulted from a shooting incident on January 26, 2005, at Woodruff High School in Peoria, Illinois. Defendant fired several shots at Omar Porter, a fellow student, following a confrontation between defendant and Porter. The shooting took place in the hallway during a passing period when other students and teachers were present. A jury convicted defendant of aggravated discharge of a firearm (720 ILCS 5/24-1.2(a)(1) (West 2004)) and unlawful use of weapons (720 ILCS 5/24-1(a)(4) (West 2004)). The trial court sentenced defendant as a Class X felon to 24 years' imprisonment and a three-year period of mandatory supervised release (MSR). 730 ILCS 5/5-8-1 (a)(3) (West 2004) (sentencing range for a Class X felony is 6 to 30 years).
The appellate court reversed and remanded for a new sentencing hearing. People v. Alexander, No. 3-06-0263 (2008) (unpublished order under Supreme Court Rule 23). The appellate court held that the trial court had considered an improper aggravating factor at sentencing, namely, that the offense took place in a school. That factor should not have been considered in aggravation because it had already served to elevate the offense to a Class X *1064 felony. See 720 ILCS 5/24-1.2(b) (West 2004). See People v. Conover, 84 Ill.2d 400, 404-05, 50 Ill.Dec. 638, 419 N.E.2d 906 (1981) (a factor which is inherent in an offense may not also be considered by the sentencing court as an aggravating factor).
On remand to the trial court, the following evidence was introduced at the resentencing hearing on May 16, 2008. According to the original and updated presentence investigation reports, defendant was 15 years old at the time of his arrest. Defendant was residing with his natural father. Defendant's mother was serving a term of probation for the aggravated battery of a police officer. Of the 11 children in defendant's immediate family, one other sibling was in the care of the Juvenile Division of the Illinois Department of Corrections.
In June 2001, at age 12, defendant was taken into custody for stealing a purse, and in June 2002, he was detained by the police for throwing a rock at a car. In April 2003, defendant was charged as a juvenile with unlawful possession of a motor vehicle. In July 2003, defendant was charged with three counts of retail theft for stealing two BB guns and a pair of jeans. The two cases were consolidated, and defendant was adjudicated delinquent as to the motor vehicle charge. Defendant was made a ward of the court, placed on 15 months' probation, and 7 days' detention. When defendant failed to appear for a review hearing, a "no bond" warrant was issued, and defendant was sentenced to the Peoria Drug Treatment Youth Court. Four warrants were issued from November to January as a result of his failure to appear in drug court as ordered. Defendant failed to complete the drug court program and was discharged from the program.
On June 9, 2004, defendant was arrested for unlawful possession with intent to deliver a controlled substance and unlawful possession of a controlled substance. The arrest resulted from a drug raid at defendant's mother's home, where defendant was living at the time. He was adjudicated delinquent for the amended offense of attempted possession of a controlled substance and placed on probation for a term of 18 months. Defendant completed a life skills program and reported on his probation weekly until two weeks before his arrest in the present offense, when he stopped reporting. Defendant also had three curfew violations and one truancy violation from 2001 through 2003.
Defendant was enrolled in the ninth grade at Woodruff High School at the time of the shooting. He had participated in special education services for speech and language since the second grade. His father was receiving social security benefits as a result of defendant being classified a disabled child. Defendant's social history was marked by school suspensions for fighting, failing to follow school rules, and for disrespect to persons in authority.
Following his arrest for the offense in this case, defendant was detained for more than a year at the Peoria County Juvenile Detention Center. During that time, he attended educational classes, where it was reported that he cooperated with the staff and met expectations. A report indicated that he had adjusted positively to the structure and rules of the facility, had displayed appropriate behavior, and developed positive relationships with peers and staff. He was participating in the "Honor Pod" program. Defendant told the presentence investigator that he would like to complete his GED and study welding.
Defendant's juvenile detention record shows that defendant was written up on multiple occasions between February 2005 and February 2006 for fighting and threatening other detainees and staff. These *1065 incidents included "throwing chairs around the dayroom and threatening to do bodily harm to a staff member"; "threatening to smack" several female detainees; punching other detainees; and "attempting to attack" another detainee in connection with alleged gang activity.
Defendant was released on February 17, 2006, from the Peoria County jail to the custody of the Illinois Department of Juvenile Justice at the Illinois Youth Center in St. Charles. On March 2, 2006, he was transferred to the Illinois Youth Center in Harrisburg. The Harrisburg facility reported that defendant lost 30 days' good-conduct credit for fighting in December 2006 and lost 6 months' good-conduct credit for being involved in a dangerous disturbance in January 2007.
Defendant was released to the Illinois Department of Corrections facility in Menard on July 13, 2007. On August 1, 2007, he was transferred to the Pinckneyville Correctional Center, where he remained in custody until his transfer to the Peoria County jail on April 1, 2008, to await resentencing. Defendant received no reports of misconduct after January 2007.
Defendant wrote a letter addressed to the trial judge in which he stated that he had matured over the last four years and that he had learned from his mistakes. He wrote that he would like to apologize to Omar Porter and to all those he had endangered by his crime. He stated that he would like to complete his education so that he could improve his life.
The State requested that the trial court sentence defendant to 24 years' imprisonment. The prosecutor argued three statutory factors in aggravation: (1) that defendant's conduct threatened serious harm, (2) that defendant had a history of prior delinquency, and (3) that the sentence was necessary to deter others. The State asked the court to consider as nonstatutory aggravating factors defendant's incidents of fighting in school and in the juvenile detention facility, and the nature and circumstances of the offense.
Defense counsel argued that the appropriate sentencing range was between 6 to 10 years, noting defendant's age at the time of the crime, the nonviolent nature of his delinquency adjudications, the improvement in defendant's grades, and defendant's letter to the court. Defendant made a statement to the court in which he apologized for his crime, acknowledged that this was a serious case, and stated that he would learn from the situation and that it would not happen again.
After considering the arguments of counsel, the trial court again sentenced defendant to 24 years' imprisonment.
On appeal, the appellate court held that the sentence was excessive, and, pursuant to its authority under Supreme Court Rule 615(b)(4), reduced defendant's sentence to six years, the statutory minimum. See 134 Ill.2d R. 615(b)(4). The dissenting justice maintained that the majority's decision represented a reweighing of the sentencing factors, which circumvented and nullified the discretion of the sentencing judge. No. 3-08-0373 (unpublished order under Supreme Court Rule 23) (Holdridge, J., dissenting).
We granted the State's petition for leave to appeal. 210 Ill.2d R. 315(a).

ANALYSIS
The sole issue on appeal is whether the trial court abused its discretion in sentencing defendant to 24 years' imprisonment. Supreme Court Rule 615(b)(4) grants a reviewing court the power to reduce a sentence. 134 Ill.2d R. 615(b)(4). That power, however, should be exercised "`cautiously and sparingly.'" People v. Jones, 168 Ill.2d 367, 378, 213 *1066 Ill.Dec. 659, 659 N.E.2d 1306 (1995), quoting People v. O'Neal, 125 Ill.2d 291, 300, 126 Ill.Dec. 71, 531 N.E.2d 366 (1988). A reviewing court may not alter a defendant's sentence absent an abuse of discretion by the trial court. People v. Hauschild, 226 Ill.2d 63, 312 Ill.Dec. 601, 871 N.E.2d 1 (2007). A sentence will be deemed an abuse of discretion where the sentence is "greatly at variance with the spirit and purpose of the law, or manifestly disproportionate to the nature of the offense." People v. Stacey, 193 Ill.2d 203, 210, 250 Ill.Dec. 4, 737 N.E.2d 626 (2000), citing People v. Fern, 189 Ill.2d 48, 54, 243 Ill.Dec. 175, 723 N.E.2d 207 (1999).
The trial court has broad discretionary powers in imposing a sentence, and its sentencing decisions are entitled to great deference. Stacey, 193 Ill.2d at 209, 250 Ill.Dec. 4, 737 N.E.2d 626 (citing Fern, 189 Ill.2d at 53, 243 Ill.Dec. 175, 723 N.E.2d 207, and People v. Perruquet, 68 Ill.2d 149, 154, 11 Ill.Dec. 274, 368 N.E.2d 882 (1977)). "A reviewing court gives great deference to the trial court's judgment regarding sentencing because the trial judge, having observed the defendant and the proceedings, has a far better opportunity to consider these factors than the reviewing court, which must rely on the `cold' record." Fern, 189 Ill.2d at 53, 243 Ill.Dec. 175, 723 N.E.2d 207. "The trial judge has the opportunity to weigh such factors as the defendant's credibility, demeanor, general moral character, mentality, social environment, habits, and age. [Citations.] Consequently, the reviewing court must not substitute its judgment for that of the trial court merely because it would have weighed these factors differently. [Citation.]" Stacey, 193 Ill.2d at 209, 250 Ill.Dec. 4, 737 N.E.2d 626.
Upon reviewing the record, we find that the trial court did not abuse its discretion in sentencing defendant to 24 years' imprisonment.
The record shows that the trial court considered the appropriate factors in aggravation and mitigation. At the resentencing hearing, the trial judge stated that he considered the presentence investigation reports, arguments of counsel, and defendant's statement. The court found no statutory mitigating factors and three statutory aggravating factors: (1) that defendant's conduct threatened serious harm, (2) that defendant had a history of prior delinquency, and (3) that the sentence was necessary to deter others from committing the same crime. The court found that it was likely defendant would commit similar offenses in the future, based on his multiple incident reports while being held in the juvenile detention facility.
It is clear from the remarks of the trial judge that he did not rely on the improper factor that the shooting occurred in a school. Rather, the court concluded that the nature and circumstances of the offense warranted a sentence at the higher end of the 6-to-30-year sentencing range. Specifically, the court noted that five shots were fired into a crowd of people as retaliation for threats from the victim and with total disregard for the potential harm to others. The court recognized that, had defendant fired a gun one time on school grounds with no bystanders, he would have qualified as a Class X felon with a six-year minimum sentence. See 720 ILCS 5/24-1.2(b) (West 2004); 730 ILCS 5/5-8-1(a)(3) (West 2004). Under the facts of this case, however, defendant shot at Porter multiple times, in the middle of a crowded hallway filled with students, teachers, and other school officials while school was in session. He endangered not only Porter but also innocent bystanders.
Defendant contends that the 24-year sentence did not properly take into *1067 account his age at the time of the offense, his tumultuous background, or his potential for rehabilitation. The record shows that the trial court did consider the mitigating evidence. Moreover, "[a] defendant's rehabilitative potential * * * is not entitled to greater weight than the seriousness of the offense." People v. Coleman, 166 Ill.2d 247, 261, 209 Ill.Dec. 782, 652 N.E.2d 322 (1995).
The sentencing judge adequately considered the appropriate factors, and it is not our duty to reweigh the factors involved in his sentencing decision. The appellate court, however, reweighed the sentencing factors, overemphasizing the mitigating factors while minimizing aggravating factors. The court found that the trial court "failed to give due consideration to Alexander's social background and facts evidencing his rehabilitative potential, including the improvement in his conduct while in detention." No. 3-08-0373 (unpublished order under Supreme Court Rule 23). The court also held that the trial court "gave undue weight to factors in aggravation, including the improper factor that the offense occurred in a school." No. 3-08-0373 (unpublished order under Supreme Court Rule 23). The appellate court substituted its own judgment for that of the trial court because it would have weighed the factors differentlyan improper exercise of the powers of a reviewing court. See People v. Streit, 142 Ill.2d 13, 19, 153 Ill.Dec. 245, 566 N.E.2d 1351 (1991).
We find that the sentence imposed on defendant by the trial court was not "greatly at variance with the spirit and purpose of the law, or manifestly disproportionate to the nature of the offense." See Stacey, 193 Ill.2d at 210, 250 Ill.Dec. 4, 737 N.E.2d 626. Accordingly, we hold that the trial court did not abuse its discretion in imposing a 24-year sentence on defendant.

CONCLUSION
For the foregoing reasons, we reverse the judgment of the appellate court and reinstate defendant's 24-year sentence.[1]
Appellate court judgment reversed; circuit court judgment affirmed.
Chief Justice KILBRIDE and Justices FREEMAN, THOMAS, GARMAN, KARMEIER, and THEIS concurred in the judgment and opinion.
NOTES
[1]  We note that defendant has filed a motion to strike certain statements in the State's reply brief referring to defendant's conduct subsequent to the resentencing hearing. Because of our disposition in this case, there is no need to consider the contested material. Defendant's motion is denied as moot.
