delivered the opinion of the court:
Defendant, Tommie Lee Spencer, was charged in the circuit court of St. Clair County with two counts of armed robbery. Following negotiations, defendant pleaded guilty to two counts of the reduced charge robbery. After a sentencing hearing, the court sentenced defendant to probation for a term of two years with periodic imprisonment on weekends at the county jail from 6 p.m. Friday until 6 a.m. Monday, and that defendant pay for his incarceration at a rate of $5 per day while so incarcerated. Subsequently, defendant’s probation was revoked for his failure to comply with the periodic imprisonment terms of his probation and defendant was sentenced to a term of six to 18 years imprisonment on the underlying charge.
Defendant appeals contending that the sentence is excessive and that it was imposed, not for the original crime, but for the violation of the special conditions of the probation.
The charge against defendant stemmed from an incident in which defendant and an accomplice robbed two victims at gunpoint. During the course of the robbery, one of the victims was struck with the gun by defendant’s accomplice. At the time the trial court imposed the sentence of probation, the court warned defendant that his failure to comply with the conditions of the probation would lead to the imposition of a severe sentence of imprisonment. Following the revocation of defendant’s probation, the trial court commented on the warnings that it had given defendant at the time he was placed on probation.
Supreme Court Rule 615(b)(4) (Ill. Rev. Stat. 1973, ch. 110A, par. 615(b)(4)) authorizes this court to reduce sentences imposed by the trial court. However, in order to do so we must find a manifest and arbitrary abuse of the trial court’s discretion. Such an abuse will be found to exist if the sentence imposed is at variance with the purpose and spirit of the law, or greatly disproportionate to the nature of the crime. People v. Wright, 56 Ill. 2d 523, 309 N.E.2d 537; People v. Willett (5th Dist. 1976), 44 Ill. App. 3d 545, 358 N.E.2d 657; People v. Grau (5th Dist. 1975), 29 Ill. App. 3d 327, 330 N.E.2d 530.
It is fundamental that in determining what sentence to impose the court considers the history and character of the defendant in order to assess his rehabilitative potential. (See Ill. Rev. Stat. 1973, ch. 38, pars. 1005—8—1(c)(3) and 1005—6—1(a).) When a defendant who has been convicted of an offense is admitted to probation, and that probation is subsequently revoked, the court may resentence the defendant to any sentence that would have been appropriate for the original offense. (People v. Willett; People v. Elsner, 27 Ill. App. 3d 957, 327 N.E.2d 592; People v. Bullion, 21 Ill. App. 3d 297, 314 N.E.2d 731.) The sentence imposed upon revocation may not be punishment for the offense which *381causes the revocation although the subsequent offense may be considered as constituting a part of defendant’s history and character and his possibilities for rehabilitation. (People v. Willett; People v. Tatum, 29 Ill. App. 3d 251, 330 N.E.2d 281; People v. Harden, 6 Ill. App. 3d 172, 284 N.E.2d 716.) In imposing sentence the court must take full cognizance of all factors relevant to the rehabilitation potential of the defendant. The sentencing judge is not required to close his eyes to defendant’s conduct while on probation which reflects on his possibilities for rehabilitation.
The facts of the crime are detailed above. The defendant could have been prosecuted on two counts of armed robbery and doubtless convicted. We surmise that it was because of defendant’s age, 17 at the time of the offense, that the State agreed after negotiations to reduce the charges to two counts of robbery and consent to the punishment of probation with periodic imprisonment. Defendant rejected the opportunity extended, even after the warning given by the court, and disregarded the terms and conditions of his probation. He reported for his weekend incarceration only rarely and when he did report he was drunk. This conduct was definitely a part of the history and character of defendant and reflected adversely upon his potential for rehabilitation and the court properly could consider it in imposing sentence.
Since sentencing is primarily a function of the trial judge who sees the defendant and is in a superior position to appraise him and evaluate the likelihood of his rehabilitation, a reviewing court will not modify a sentence that is within statutory limits unless it is greatly at variance with the purpose and spirit of the law or greatly disproportionate to the nature of the crime. (People v. Wright; People v. Willett; People v. Grau.) We find no such departure present here. In addition to the two robberies for which sentence was imposed the court had for consideration the fact that defendant had been previously convicted of one felony (theft) and four misdemeanors, two of them for unlawful use of weapons, one for disturbing the peace and one for disorderly conduct. We will not disturb the sentence.
Affirmed.
KARNS, J., concurs.