
203 Cal.App.3d 782 (1988)
250 Cal. Rptr. 730
THE PEOPLE, Plaintiff and Respondent,
v.
WILLIAM CHARLES CHANDLER, JR., Defendant and Appellant.
Docket No. B029918.
Court of Appeals of California, Second District, Division Five.
August 10, 1988.
*785 COUNSEL
David Y. Smith for Defendant and Appellant.
John K. Van de Kamp, Attorney General, Steve White, Chief Assistant Attorney General, Carol Wendelin Pollack and Patrick T. Brooks, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
KENNARD, J.
After termination of his probationary period, defendant petitioned the trial court under Penal Code section 1203.4 for leave to withdraw his plea of guilty and enter a plea of not guilty, and for a dismissal of the accusation against him. The court denied the relief requested. This appeal by defendant followed. Affirmed.

BACKGROUND
Pursuant to a plea bargain, defendant pleaded guilty to one count of receiving stolen property (Pen. Code, § 496, subd. (1)), and, on a motion by the People, the trial court dismissed six counts of robbery (Pen. Code, § 211). Proceedings were suspended. Defendant was placed on probation for a period of 3 years, subject to, among other conditions, spending the first 120 days in county jail and paying restitution in the sum of $2,571.65 through the probation department.
Just before the expiration of probation, defendant's probation officer asked the trial court to extend probation for an additional two years to enable defendant to pay off a balance of about $2,500 on the court-ordered restitution. On January 13, 1986, one day before the expiration of probation, the court held a hearing. It made a preliminary determination that defendant was in violation of probation based on his failure to pay full restitution. (1) (See fn. 1.) To toll the running of the statute and to retain jurisdiction, the court revoked probation, and set a formal violation hearing *786 for February 7, 1986.[1] On that date, defense counsel requested a continuance to March 7, 1986, which was granted.
At the March 7, 1986, hearing, the People called defendant's probation officer, Patricia Mallory, as a witness. She testified as follows: Upon being assigned defendant's case, Mallory told defendant the trial court had set restitution in the sum of $2,571.65, payable at $20 a month until paid in full within the three-year probationary period. Initially, defendant, who was unemployed, made some payments of $5 to $10 a month. A year or so later, after getting a job with the California Department of Transportation, defendant started paying $20 a month. At that time, defendant earned $131 a week. In June 1985, the probation officer discussed with defendant the large balance he still owed in restitution and the need to make larger monthly payments to ensure full payment before the expiration of probation in January 1986. On the date of the probation revocation hearing, defendant still owed a balance of $2,231.65 in restitution.
Based on this testimony, the trial court found a "prima facie" showing that defendant had failed to comply with the restitution condition. Thereafter, the probation officer testified on cross-examination that in her opinion defendant had tried to comply with the terms of probation. At the conclusion of the hearing, the court reinstated probation, which it then terminated under Penal Code section 1203.3.
A year later, defendant filed a motion under Penal Code section 1203.4 to withdraw his plea of guilty, to enter a plea of not guilty, and for a dismissal of the charge. The trial court denied the motion, based on its finding that, in failing to pay the full amount of restitution, defendant had not complied with the restitution condition. This appeal followed.

ISSUE PRESENTED
We are asked to determine whether the trial court was required to grant defendant's application for relief under Penal Code section 1203.4 because, as defendant contends, he had complied with the terms of probation during the probationary period, and the court terminated probation before defendant had paid restitution in full.


*787 DISCUSSION

1. Appealability of the Order

(2) Before discussing the merits of defendant's contention, we must determine whether the appeal is properly before us. Penal Code section 1237, subdivision (b) permits a defendant to appeal from "any order made after judgment, affecting the substantial rights of the party." In this case, following defendant's plea of guilty, the trial court suspended proceedings and granted defendant probation. Where, as here, the probationary period expires without revocation, the order granting probation must be considered the final judgment under the provisions of Penal Code section 1237, subdivision (a). The order denying defendant relief under Penal Code section 1203.4 was made after judgment, it affected the "substantial rights" of defendant, and it is therefore appealable. (People v. Johnson (1955) 134 Cal. App.2d 140, 142-143 [285 P.2d 74].)

2. Trial Court's Denial of the Order

Penal Code section 1203.4 provides that a defendant who "has fulfilled the conditions of probation for the entire period of probation, or has been discharged prior to the termination of probation" is entitled as a matter of right to have the plea or verdict of guilty changed to one of not guilty, to have the proceedings expunged from the record, and to have the accusation dismissed.[2] (3a) As the state Supreme Court explained in Stephens v. Toomey (1959) 51 Cal.2d 864, 870-871 [338 P.2d 182]: "When such an order has been entered there is no further criminal prosecution pending against the defendant. He has then, without any further showing of rehabilitation on his part, received a statutory rehabilitation and a reinstatement to his former status in society insofar as the state by legislation is able to do so, with one exception, namely, that under section 1203.4 of the Penal Code the record in the criminal case may be used against him for limited purposes in any criminal proceeding thereafter brought against him."
(4a) Defendant does not dispute the fact that at the end of the three-year probationary period he had paid only $340 towards the court-ordered restitution of $2,571.65. He contends, however, his failure to pay restitution in full nevertheless constituted full compliance with the restitution condition as a result of the trial court's decision not to revoke probation. Implied *788 in that decision, he claims, was a finding of "the good conduct and reform" on his part. Thus, he argues, since he "fulfilled the conditions of his probation for the entire period thereof," the trial court was required to grant his motion for dismissal under Penal Code section 1203.4. We disagree.
The policy considerations underlying a probation violation hearing are different from those underlying a hearing under Penal Code section 1203.4, where, as here, the probationer's application for relief is based on a claim of full compliance with the terms of probation. Therefore, a trial court's decision not to revoke probation would not necessarily preclude a subsequent denial of a motion for dismissal under Penal Code section 1203.4, as we shall explain.
(5) A grant of probation is not a matter of right; it is an act of clemency designed to allow rehabilitation. (People v. Stender (1975) 47 Cal. App.3d 413, 425 [121 Cal. Rptr. 334]; People v. Johnson, supra, 134 Cal. App.2d 140, 143.) It is also, in effect, a bargain made by the People, through the Legislature and the courts, with the convicted individual, whereby the latter is in essence told that if he complies with the requirements of probation, he may become reinstated as a law-abiding member of society. (People v. Johnson, supra.) As an additional inducement, the "[r]emoval of the blemish of a criminal record" is held out through the provisions of Penal Code section 1203.4. (Ibid.)
(6) When the evidence shows that a defendant has not complied with the terms of probation, the order of probation may be revoked at any time during the probationary period. (Pen. Code, § 1203.2; Stephens v. Toomey, supra, 51 Cal.2d 864, 870.) In determining whether to revoke probation, a trial court must consider whether the convicted offender "`can be safely allowed to return to and remain in society.'" (People v. Hayko (1970) 7 Cal. App.3d 604, 610 [86 Cal. Rptr. 726].) The matter rests entirely within the broad discretion of the trial court, whose decision will not be reversed unless it was arbitrary or capricious. (People v. Buford (1974) 42 Cal. App.3d 975, 985 [117 Cal. Rptr. 333]; People v. Turner (1961) 193 Cal. App.2d 243, 247 [14 Cal. Rptr. 130].)
(3b) By contrast, a defendant moving under Penal Code section 1203.4 is entitled as a matter of right to its benefits upon a showing that he "has fulfilled the conditions of probation for the entire period of probation." It was apparently intended that when a defendant has satisfied the terms of probation, the trial court should have no discretion but to carry out its part of the bargain with the defendant. (People v. Johnson, supra, 134 Cal. App.2d 140, 144.) "The expunging of the record of conviction is, in essence, a form of legislatively authorized certification of complete rehabilitation *789 based on a prescribed showing of exemplary conduct during the entire period of probation." (People v. Turner, supra, 193 Cal. App.2d 243, 247.)
(4b) Here, the fact that the trial court did not revoke probation did not constitute a determination that defendant had fully complied with the restitution conditions. (People v. Turner, supra, 193 Cal. App.2d 243, 247.) As the court commented at the conclusion of the probation officer's testimony on direct examination at the probation violation hearing: "Evidently the defendant has had three years on probation. He appears to be young and able-bodied. The probation officer has indicated that she constantly made him aware of his obligation, and the most he paid was about $100, altogether, maybe $110 a year, and I think that is a prima facie indication that he has failed to comply with the condition."
Although the court could have revoked defendant's probation for failure to pay restitution in full (In re Davis (1957) 150 Cal. App.2d 790, 792 [310 P.2d 1031]), it chose not to do so. In arriving at that decision, the court may have been influenced by the probation officer's testimony on cross-examination that in her opinion defendant had tried to comply with the terms of probation. In not getting his probation revoked, defendant became the beneficiary of the trial court's leniency, which was a proper exercise of the court's broad discretion in this area. That decision, however, did not preclude the court from subsequently denying defendant's application for dismissal under Penal Code section 1203.4. In denying that application, the court specifically found defendant had not satisfied the probation condition on restitution. As the court commented: "I gave him the benefit of a doubt. We had a hearing. The probation officer came in. It's obvious he didn't make restitution, and [defendant's] own moving papers I believe state that restitution was $2,500... and that he paid $340."
Since defendant had not met the statutory requirement of fulfilling "the conditions of his probation for the entire period thereof," he failed to fully perform his part of the bargain. Therefore, the trial court was under no obligation to keep its end of the bargain, namely, "[r]emoval of the blemish of a criminal record" (People v. Johnson, supra, 134 Cal. App.2d 140, 143-144), and denial of defendant's motion under Penal Code section 1203.4 was proper (People v. Turner, supra, 193 Cal. App.2d 243).
(7) Additionally, defendant contends that the trial court's decision at the end of his probationary period to terminate probation rather than to extend it so he could pay the remainder due in restitution constituted a full discharge of all of the restraints and conditions of his probation, thus entitling him to the statutory relief requested. Penal Code section 1203.4 *790 provides that a probationer who "has been discharged prior to the termination of probation" is entitled to relief. Here, one day before defendant's probation was to expire, the trial court, in order to toll the running of the statute and retain jurisdiction, revoked probation based on the facts in the probation officer's report. The court then set a formal violation hearing for a date some two months later. At the conclusion of that evidentiary hearing, the court reinstated probation, which it then terminated under Penal Code section 1203.3. These facts establish defendant was not "discharged prior to the termination of probation."
Defendant's reliance on People v. Butler, supra, 105 Cal. App.3d 585 is misplaced. Like defendant in the case before us, the probationer in Butler failed to pay a substantial portion of the court-ordered restitution. But unlike defendant here, the defendant in Butler never contended he had fully complied with the terms of probation. Instead, the latter claimed that because the trial court had terminated probation three months before its expiration, he was entitled to a dismissal under Penal Code section 1203.4. The reviewing court agreed, holding that once probation is terminated early, a trial court has no discretion to deny relief under section 1203.4. (Id., at p. 589.) In so holding, the Butler court followed the statutory mandate to grant relief in any case in which a defendant "has been discharged prior to the termination of probation." That situation is not present here, where the trial court terminated probation at the end of the probationary period and at no time excused defendant from complying with the conditions of probation prior to the termination of probation.
To summarize, denial of defendant's application under Penal Code section 1203.4 was proper because of his failure to meet the statutory requirements of having "fulfilled the conditions of probation for the entire period of probation," or having been "discharged prior to the termination of probation."

DISPOSITION
The trial court's order denying defendant's application under Penal Code section 1203.4 is affirmed.
Lucas, P.J., and Ashby, J., concurred.
NOTES
[1]  The trial court's action was proper. When the probation is revoked during the probationary period, the trial court retains jurisdiction to sentence the defendant after the expiration of that term. (People v. Ham (1975) 44 Cal. App.3d 288, 293-294 [118 Cal. Rptr. 591].)
[2]  In addition to these two situations requiring relief, the statute allows a trial court to grant relief in any case in which the court, "in its discretion and the interests of justice," determines relief to be proper. Obviously, in the third situation, a grant of relief is discretionary. (People v. Butler (1980) 105 Cal. App.3d 585, 587 [164 Cal. Rptr. 475].) The third situation is not at issue here; only the first two are.
