Opinion
Introduction
The trial court awarded defendant Rene Gisbert 88 days of presentence custody credits after defendant pled guilty to second degree vehicle burglary. The court later granted the prosecution’s motion to vacate the credits, and defendant appeals from that postjudgment order.
The trial court had jurisdiction to entertain the prosecution’s motion because an unauthorized sentence may be corrected at any time. Defendant was not entitled to any presentence custody credits because he would not have been free of custody but for his incarceration while awaiting trial on the second degree vehicle burglary charge, as he was already committed to state prison in connection with an earlier burglary conviction. The award of presentence custody credits where credits were impermissible made the first sentence unauthorized. We therefore affirm the postjudgment order.
Statement of Facts and Procedural History
On September 9, 2010, defendant pled guilty to a felony count of second degree burglary (Pen. Code, §§ 459, 460, subd. (b)), and was sentenced to two years in state prison. (All further statutory references are to the Penal Code.)
*280On December 1, 2010, the Orange County District Attorney filed a new felony complaint against defendant, charging him with a separate felony count of second degree vehicle burglary. The date of the alleged crime in the second case was June 10, 2010. On March 4, 2011, defendant’s notice and demand for trial, pursuant to section 1381,1 was forwarded to the district attorney’s office from the court.
Defendant appeared for arraignment in the second case on April 19, 2011, at which time he pled guilty. Defendant was sentenced on the same day; at that time, the trial court stated it did not believe defendant was entitled to any presentence custody credits, a position with which the prosecutor agreed. Defendant’s counsel argued that defendant should receive 44 days of actual custody credits, plus 44 days of good conduct credits, representing the time between the notice and demand for trial and defendant’s sentencing. The court sentenced defendant to 16 months in state prison, to be served concurrently with the two-year sentence on the first case, and awarded him a total of 88 days of presentence custody credits, over the prosecutor’s objection.
On May 6, 2011, the prosecution filed a motion to vacate presentence credits. After a hearing, the court concluded the award of presentence custody credits was incorrect, and granted the motion to vacate the credits. An amended abstract of judgment reflecting zero days of presentence custody credits was prepared and filed. Defendant timely appealed.
Discussion
A trial court generally loses jurisdiction “to resentence a criminal defendant once execution of the sentence has commenced.” (People v. Karaman (1992) 4 Cal.4th 335, 344 [14 Cal.Rptr.2d 801, 842 P.2d 100].) The Attorney General argues, however, that the failure to award the legally mandated amount of presentence custody credits was an unauthorized sentence that could be corrected whenever it was discovered. (People v. Taylor (2004) 119 Cal.App.4th 628, 647 [14 Cal.Rptr.3d 550]; People v. Acosta (1996) 48 Cal.App.4th 411, 428, fn. 8 [55 Cal.Rptr.2d 675].) A sentence is unauthorized “where it could not lawfully be imposed under any circumstance in the particular case [such as] . . . where the court 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].)
*281Defendant argues the sentence was not unauthorized, and therefore not subject to correction at any time, because the trial court had the discretion to award presentence custody credits in this case. Defendant relies on section 2900.5, subdivision (b), which provides that presentence custody credit shall be given “only where the custody to be credited is attributable to proceedings related to the same conduct for which the defendant has been convicted. Credit shall be given only once for a single period of custody attributable to multiple offenses for which a consecutive sentence is imposed.” Defendant argues that the reference to consecutive sentences in the second sentence of section 2900.5, subdivision (b), “implies that if concurrent sentences are imposed, then credit for a single period of custody may be applied to multiple cases being served concurrently.”
The Attorney General counters that the second sentence of section 2900.5, subdivision (b) “simply means that when a defendant is convicted of multiple offenses he is only entitled to one accrual of credits on all the charges and not credits on individual counts.” Case law supports the Attorney General’s interpretation of the statute. In People v. Bruner (1995) 9 Cal.4th 1178, 1192, footnote 9 [40 Cal.Rptr.2d 534, 892 P.2d 1277], the California Supreme Court noted that “there is no indication the 1978 amendment [to section 2900.5, which added the second sentence to subdivision (b),] was concerned with concurrent sentences for unrelated conduct imposed in multiple proceedings. By its terms, the amendment does no more than clarify that when consecutive terms are imposed for multiple offenses in a single proceeding, only one of the terms shall receive credit for presentence custody, while leaving undisturbed the accepted principle that when concurrent sentences are imposed at the same time, presentence custody is credited against all.”
A defendant is not entitled to presentence custody credits when he or she is charged with a crime while already incarcerated and serving a sentence on a separate, earlier crime. (People v. Bruner, supra, 9 Cal.4th at p. 1180; In re Joyner (1989) 48 Cal.3d 487, 489 [256 Cal.Rptr. 785, 769 P.2d 967]; In re Rojas (1979) 23 Cal.3d 152, 155 [151 Cal.Rptr. 649, 588 P.2d 789].) The test is whether the defendant would have been free “but for” his or her incarceration on the second crime. “[W]hen presentence custody may be concurrently attributable to two or more unrelated acts, and where the defendant has already received credit for such custody in another proceeding, the strict causation rules of Joyner should apply. Here, defendant received credit for all presentence custody in his parole revocation proceeding, and he has failed to demonstrate that but for the cocaine possession leading to his current sentence, he would have been free, or at least bailable, during that presentence period. Hence, he is not entitled to duplicative credit against the current sentence.” (People v. Bruner, supra, at pp. 1180-1181.)
*282We conclude the trial court did not have discretion to award presentence custody credits for the period after defendant filed his section 1381 notice and demand for trial, because he would not have been free from custody but for being held for trial on the second burglary charge. Therefore, the award of presentence custody credits was an unauthorized sentence, which the trial court had jurisdiction to correct at any time. There was no error in the trial court’s order granting the motion to vacate the credits.
Disposition
The postjudgment order is affirmed.
Rylaarsdam, Acting P. J., and Aronson, J., concurred.