Opinion
LAMBDEN, J.Thuan Tan Tran pleaded guilty to three counts of grand theft (Pen. Code, § 487) in exchange for the prosecutor’s dismissal of two *385other pending cases and the court’s dismissal of an “out on bail” enhancement under section 12022.1.1 The court sentenced Tran to the aggravated sentence on each count for a total term of four years and four months, suspended imposition of sentence, and placed Tran on probation for five years on specified conditions, including serving 18 months in the county jail and Tran’s agreeing to waive his entitlement to custody credits under section 2900.5 for jail time served as against any future state prison sentence.
Tran appeals, arguing that the required prospective waiver of section. 2900.5 credits was not a reasonable condition of probation and constituted an unauthorized sentence. We agree and will remand with directions to strike the waiver as a condition of probation.
Factual and Procedural Background
Appellant Tran waived a preliminary hearing and entered a negotiated plea of guilty to the three counts of grand theft that were alleged in the amended complaint. Count 1 alleged theft of $9,500 from Washington Mutual Bank on September 1-2, 1998; count 2 alleged theft of $21,000 from Westamerica Bank on October 2, 1998; and count 3 alleged theft of $9,500 from California Federal Bank on September 17, 19, and 21, 1998. As part of the plea agreement, the prosecutor agreed to dismiss two other pending cases, and the court was to dismiss a sentence enhancement allegation under section 12022.1 for having committed a felony while on bail. The court, however, would be allowed to consider the conduct underlying the dismissed cases when it imposed sentence.
Appellant was a 23-year-old immigrant from Vietnam who came to the United States with his family in 1989. He became a citizen in 1996. At the time of the offenses, appellant was a student at the College of Marin, and was planning to transfer to a four-year college and earn a degree in computer graphics. A statement in mitigation, which was filed before the sentencing hearing, described appellant as a bright young man with no criminal record who became addicted to gambling and lost large sums of money. After he depleted his savings and reached the maximum limit on his credit cards, appellant stole from banks by depositing bad checks. The statement referred to a letter of support sent by the program coordinator of the Asian Advocacy Project of Catholic Charities, which described appellant as a promising member, even a role model, in the Asian refugee community. The letter described the gambling problem in the Asian community and the heartbreak that appellant’s behavior had caused his family.
*386The probation report recommended a suspended prison sentence of the aggravated term on each count, payment of full restitution, and five years’ probation, with appellant to serve 24 months in the county jail (8 months per count), and to be required to waive credit for this time against any future prison term. The probation department described the lengthy suspended prison sentence as being necessary to ensure compliance with the probation conditions, particularly the large sum of restitution to be paid.
At the sentencing hearing, both counsel and the probation officer presented arguments for and against the proposed waiver of credits under section 2900.5 for time spent in county jail as a condition of probation. The court indicated it would require such a waiver as a condition of granting probation. Defense counsel objected, arguing that section 2900.5 waivers are usually exacted from defendants who are getting a second chance at probation, and that the sole effect here would be to increase a potential prison sentence beyond the statutory maximum sentence if appellant failed on probation.
The court adhered to its position that appellant would be required to waive all of his county jail time against a future prison term. Appellant agreed to accept probation, even with the waiver condition. The court then imposed the maximum prison term available for the offenses to which appellant had pled: an aggravated term of three years on count 1, and consecutive terms of eight months each on counts 2 and 3 for a total of four years and four months. Execution of this sentence was suspended, and appellant was placed on probation for a period of five years on specified conditions, including restitution, service of 18 months in the county jail, and a waiver of any future credit for that time.
Argument
Appellant challenges only the requirement that, as a condition of probation, he waive his right to all credit that may be accrued under section 2900.5 against a suspended prison sentence.2 Appellant’s acceptance of this condition of probation does not preclude him from challenging it on appeal. His objection at the time of sentencing suffices to preserve the point for appeal. (People v. Welch (1993) 5 Cal.4th 228, 236-237 [19 Cal.Rptr.2d 520, 851 P.2d 802].)
*387Appellant argues that requiring him to waive section 2900.5 credit was not a reasonable condition of probation because the requirement bears no relationship to him, his offense, or his past record, and served only to enable the court to impose a longer sentence than that authorized by the Penal Code. Although courts have broad discretion to impose conditions of probation, the conditions must foster rehabilitation and protect public safety. (People v. Carbajal (1995) 10 Cal.4th 1114, 1120 [43 Cal.Rptr.2d 681, 899 P.2d 67].) The conditions also must be reasonably related to the crime of which the defendant was convicted or to future criminality. (Id. at p. 1121; People v. Lent (1975) 15 Cal.3d 481, 486 [124 Cal.Rptr. 905, 541 P.2d 545].)
As previously mentioned, the trial court imposed the longest prison sentence the law allows. It suspended execution of that sentence on condition that appellant serve 18 months in the county jail, and required appellant to waive prospectively all of this time against his potential future prison term. The court’s stated purpose in imposing the waiver requirement was to add greater incentive for appellant to comply with the conditions of probation. The court was especially concerned about the large amount of restitution required and reasoned that the prospect of such a lengthy prison sentence would motivate appellant to satisfy the restitutionary requirement as well as the other conditions of probation.
Waivers of section 2900.5 have been approved in prior cases, but appellant maintains that the current situation goes beyond any waivers that have previously been approved. A review of the prior cases supports appellant’s claim.
People v. Johnson (1978) 82 Cal.App.3d 183 [147 Cal.Rptr. 55] was the first case to affirm the authority of the trial court to require a defendant to waive the custody credit provisions of section 2900.5. The defendant in Johnson had been placed on probation on condition that he serve one year in jail. He served the jail time and then violated probation. The defendant requested continued probation with additional jail time. The court thought it had no authority to grant the request because section 19a (now § 19.2) limited jail time as a condition of probation to one year, and section 2900.5 required that the defendant be credited for all days in custody. As the Court of Appeal observed: “The net result of these two legislative efforts is that if a defendant has served a year in jail as a condition of probation, a violation means either a prison sentence or a fatherly (or motherly) lecture on the evils of crime.” (82 Cal.App.3d at p. 185.) After reviewing the legislative history of the provisions and finding that they were enacted for the benefit of the prisoners, the court determined that they could be waived by the defendant: “Thus, we conclude that where a defendant who has spent a year in the *388county jail as a condition of probation subsequently commits a probation violation, the sentencing judge should not be forced to choose between ignoring the violation or imposing sentence to state prison. The court should be free to choose either of these options in the exercise of its discretion but it should also have the power, with the consent of the defendant, to fashion an intermediate disposition by modifying probation to provide for additional time up to one year in jail.” (Id. at p. 188.)
In People v. Ambrose (1992) 7 Cal.App.4th 1917 [9 Cal.Rptr.2d 812], the defendant was placed on probation on condition that he serve 240 days in the county jail. The defendant violated probation. The court reinstated him on probation on the condition that he successfully complete a residential alcohol abuse program at Diablo Valley Ranch (the ranch) and that he waive not only the 196 days of custody credit he had accrued, but also any credit he would earn for time spent at the ranch. (7 Cal.App.4th at p. 1920.) The defendant completed the program and then violated probation again. The trial court revoked probation and imposed the previously suspended concurrent three-year prison terms. Due to the defendant’s prior waiver of custody credit, the court granted no credit for that time.
This court (Division Two) held that the defendant’s waiver of his right to future credit was valid, relying on the reasoning from People v. Johnson, supra, 82 Cal.App.3d 183 that the legislative history supported allowing a defendant to waive his statutory right for the benefit of a less onerous disposition than would otherwise be available. The court’s approval was accompanied by the following proviso: “This does not mean, of course, that we would endorse a situation in which the denial of future credit enabled the court to impose a term which is longer than the maximum allowable for the offense. Even if a defendant agrees to such a negotiated disposition, a trial court should not impose a sentence in excess of the maximum allowable for the plea entered. Appellant would be entitled to discharge from custody at the ranch if and when his total custodial time, including time at the ranch, equaled the maximum incarceration period.” (People v. Ambrose, supra, 7 Cal.App.4th at p. 1924.)
In People v. Salazar (1994) 29 Cal.App.4th 1550 [35 Cal.Rptr.2d 221], our colleagues in Division One affirmed the trial court’s refusal to grant custody credits upon revoking probation and sentencing the appellant to state prison after he had violated his probation for the third time. Following the appellant’s second probation violation, he had waived all prior credits for “ ‘all purposes’ ” in order to gain reinstatement to probation. The.court observed that trial courts had begun routinely obtaining such waivers from repeat probation violators, “who, like appellant, have already served substantial *389amounts of county jail time as a condition of probation, and are approaching the maximum time set forth in Penal Code section 19.2.” (Id. at p. 1553.) The court concluded that the appellant must have understood that when he waived his prior custody credits “ ‘for all time and for all purposes,’ ” it included the eventuality of a state prison sentence. (Id. at pp. 1554-1556; accord, People v. Burks (1998) 66 Cal.App.4th 232 [77 Cal.Rptr.2d 698] [waiver of custody credits upon reinstating probation after probation violation included waiver as to prison time as well].)3
Appellant is correct in asserting that the waiver of custody credits exacted in this case exceeds that approved.in any of the prior cases. None of the prior cases involved a waiver of custody credits as a condition of probation when the trial court had also imposed the maximum prison sentence allowed by statute. Indeed, the opinion in Ambrose acknowledged the impropriety of a such a waiver requirement.
Appellant argues that the waiver condition-is unreasonable in that it is not related either to the offense or the offender and serves only to lengthen the prison sentence he will serve in the hypothetical event that he goes to prison. Such a purpose, appellant maintains, is not one of the considerations mentioned in section 1202.7.4 (See People v. Carbajal, supra, 10 Cal.4th at p. 1120.) Appellant recognizes that punishment is acknowledged by section 1202.7 as an appropriate consideration. The punishment contemplated, appellant argues, is that authorized by law and not a sentence that violates “mandatory provisions governing the length of confinement.” (People v. Scott (1994) 9 Cal.4th 331, 354 [36 Cal.Rptr.2d 627, 885 P.2d 1040].)
*390We agree that the waiver in this case differs from those approved in other cases. Unlike the waiver in Ambrose, this waiver cannot have any effect on appellant’s attitude toward a residential treatment program. All of appellant’s local time is to be served in the county jail. To the extent that his other conditions of probation—such as payment of full restitution and participation in Gamblers Anonymous—bear on his rehabilitation, the section 2900.5 waiver is irrelevant to them. The only purpose served by the waiver condition is to lengthen appellant’s prison sentence beyond the maximum allowed if he were to violate probation. The waiver condition does not serve to deter him from future violations; the suspended prison sentence is a sufficient deterrent. Nor is it necessary to persuade him to take seriously his conditions of probation because there is no basis for believing he will not do so. The threat of a lengthy prison sentence is sufficient incentive.
The People suggest that we should reverse and remand for the trial court to redetermine whether probation should be granted. Such a disposition, in our view, would be inappropriate and tantamount to penalizing appellant for having appealed. (See, e.g., People v. Hood (1969) 1 Cal.3d 444, 459 [82 Cal.Rptr. 618, 462 P.2d 370]; People v. Ali (1967) 66 Cal.2d 277, 281-282 [57 Cal.Rptr. 348, 424 P.2d 932].) The trial court has already determined under the criteria set forth in rule 414 of the California Rules of Court that probation is suitable for appellant. Accordingly, we will remand the case with directions to place appellant on probation on reasonable conditions that do not require a waiver of custody credits under section 2900.5. (See People v. Richards (1976) 17 Cal.3d 614, 624 [131 Cal.Rptr. 537, 552 P.2d 97], disapproved on other grounds in People v. Carbajal, supra, 10 Cal.4th at p. 1126; People v. Penoli, supra, 46 Cal.App.4th at p. 310.)
Disposition
The order granting probation is reversed, and the case is remanded with directions to place appellant on probation on reasonable conditions that do not include a requirement that he waive credit for time served in jail. In all other respects the judgment is affirmed.
Haerle, Acting P. J., and Ruvolo, J., concurred.
Respondent’s petition for review by the Supreme Court was denied May 24, 2000.
Unless otherwise indicated, all statutory references are to the Penal Code.
Section 2900.5 provides in pertinent part: “In all felony and misdemeanor convictions, . . . when the defendant has been in custody, including, but not limited to, any time spent in a jail. . . , all days of custody of the defendant, including days served as a condition of probation in compliance with a court order, and including days credited to the period of confinement pursuant to Section 4019, shall be credited upon his or her term of imprisonment ....’’ (§ 2900.5, subd. (a).)
Custody credit waivers had become so routine that some courts began requiring them as a standard practice when a defendant was sent to a drug rehabilitation program as a condition of probation. A panel of this court disapproved that practice in People v. Penoli (1996) 46 Cal.App.4th 298 [53 Cal.Rptr.2d 825], reasoning as follows: “The court’s ‘standard practice’ represents not a case-specific application of sentencing discretion, but a preconceived determination applicable to all cases in which the question might arise. Adherence to this practice constituted an erroneous failure to exercise the discretion vested in the court by law.” (Id. at p. 303.)
In People v. Torres (1997) 52 Cal.App.4th 771 [60 Cal.Rptr.2d 803], Division Five of this district disagreed with Penoli and approved a trial court’s imposition as a standard condition of probation the waiver of custody credits for time served in a drug treatment program. Neither of these cases, however, involved a claim that the sentence exceeded the statutory maximum.
Section 1202.7 provides: “The Legislature finds and declares that the provision of probation services is an essential element in the administration of criminal justice. The safety of the public, which shall be a primary goal through the enforcement of court-ordered conditions of probation; the nature of the offense; the interests of justice, including punishment, reintegration of the offender into the community, and enforcement of conditions of probation; the loss to the victim; and the needs of the defendant shall be the primary considerations in the granting of probation.”