OPINION
WECHSLER, Judge.{1} In this appeal, we consider, in the circumstances of two consecutive sentences, whether a district court may revoke a defendant’s probation when (1) as to the second sentence, the violations occurred before the defendant had begun serving the sentence to which the probation is attached and (2) as to the first sentence, the defendant had completed serving the sentence. We conclude that the district court had the authority to revoke the probation attached to the second sentence but did not have the authority to revoke the probation attached to the first. We also conclude that the district court properly allocated probation credit as between the two sentences. We affirm as to the second sentence and reverse as to the first.
BACKGROUND
{2} On August 4, 1999, Defendant Phillip Oscar Lopez was convicted in two separate cases, CR 99-500 and CR 99-502, after he entered plea agreements. Both cases involved fourth degree felony charges of burglary of a vehicle and larceny and CR 99-500 also involved other crimes. The district court sentenced Defendant in both cases on August 30,1999. In CR 99-502, it imposed a six-year sentence. It suspended three years of the sentence, requiring Defendant to serve three years in custody and then three years on supervised probation concurrent with one year of parole. The district court ran the sentence in CR 99-500 consecutive to the sentence in CR 99-502. It suspended its entire five-year sentence and placed Defendant on supervised probation for that period. The conditions of the probation in both cases were substantially the same.
{3} Defendant served his three-year commitment in custody in CR 99-502 and completed his parole while in custody for an earlier charge. After Defendant had been released for nearly one year, the State filed petitions to revoke his probation in both cases for multiple violations since his release. Defendant admitted to the probation violations before the district court on July 22, 2004.
REVOCATION IN CR 99-500
{4} Prior to the district court’s acting on the petitions, Defendant completed his probation in CR 99-502 and began serving his probation in CR 99-500. Although the parties brought this transition to the district court’s attention and the district court indicated that it would order the case completed, it nevertheless entered an order revoking Defendant’s probation in CR 99-502 and sentencing Defendant to serve the six-year term followed by one year of parole with a credit of six years and fifty-six days for time spent in confinement and on probation. It revoked Defendant’s probation in CR 99-500 and sentenced Defendant to a term of five years followed by a one-year parole period, suspending two years and six months to be served on probation concurrent with parole. Defendant appeals the order revoking his probation and imposing sentence in both cases. We address Defendant’s arguments, even though he did not raise them to the district court, because they raise the issue of an illegal sentence that can be brought for the first time on appeal. See State v. Bachicha, 111 N.M. 601, 605, 808 P.2d 51, 55 (Ct.App.1991) (stating that because the district court lacks jurisdiction to impose an illegal sentence, it may be challenged for the first time on appeal). We subject the legality of a sentence to de novo review. State v. Brown, 1999-NMSC-004, ¶ 8, 126 N.M. 642, 974 P.2d 136.
{5} This Court has held that a district court may revoke probation and a suspended sentence even though the probation period has not begun. State v. Martinez, 108 N.M. 604, 607, 775 P.2d 1321, 1324 (Ct.App.1989); State v. Padilla, 106 N.M. 420, 422, 744 P.2d 548, 550 (Ct.App.1987). Our Supreme Court has similarly stated. State v. Rivera, 2004-NMSC-001, ¶ 21, 134 N.M. 768, 82 P.3d 939. Defendant seeks to distinguish these cases, correctly contending that they do not involve circumstances, as here, in which the defendant is not serving some portion of the sentence for which probation is revoked. Although we agree with Defendant that these eases may be distinguished on that basis, we decline to do so based on the underlying broad power of the district court over its criminal sentencing.
{6} Padilla is at the center of our analysis. The defendant in Padilla failed to return from work release while serving the custodial portion of his sentence. Padilla, 106 N.M. at 421, 744 P.2d at 549. In doing so, he violated the law and a condition of his subsequent probation. Id. This Court held that the district court had jurisdiction to revoke the defendant’s probation and suspended sentence despite the fact that the defendant had not begun serving the probation because he was still incarcerated. Id. at 422, 744 P.2d at 550. Because the suspension of the defendant’s sentence and probation emanated from the district court’s discretionary act of clemency, we reasoned that the district court retained jurisdiction to revoke its acts “for good cause shown at any time subsequent to the entry of judgment and prior to the expiration of the sentence.” Id. We followed Padilla in Martinez to hold that a sentencing court can revoke a suspended sentence of a defendant who violates a probationary condition while serving on parole before a probationary period began. Martinez, 108 N.M. at 607, 775 P.2d at 1324. Our Supreme Court built upon Padilla in Rivera to hold that a district court has jurisdiction to revoke probation when the probationary period has not begun and the defendant violates the conditions of probation while the case is on appeal without bond. Rivera, 2004-NMSC-001, ¶¶ 26-27, 134 N.M. 768, 82 P.3d 939. It pointed out that a district court’s discretion to suspend a sentence and order probation was part of its broad power to achieve the goal of rehabilitation. Id. ¶¶ 20-21.
{7} The district court exercised its broad sentencing power in granting Defendant clemency and structuring a rehabilitative sentence. Defendant did not have any right to such action. See State v. Follis, 81 N.M. 690, 692, 472 P.2d 655, 657 (Ct.App.1970) (“The suspension or deferment of a sentence is not a matter of right but is an act of clemency within the trial court’s discretion.”). The district court sentenced Defendant in CR 99-500 and CR 99-502 at the same time. It imposed partially suspended sentences and standard conditions of probation in both cases that applied equally to both cases. Thus, at the time of his actions, Defendant was on notice that he was violating conditions of his probation. Even though Defendant was not serving his sentence in CR 99-500 at the time of the violations, because the sentences were consecutive, Defendant still had to successfully complete his sentence in CR 99-502. Under Defendant’s argument, upon Defendant’s admission that he violated the probation conditions in CR 99-502, the district court could not take any action. But such a result is contrary to a sentencing court’s broad power as discussed in Padilla and Rivera. Rather, in connection with its broad power to grant clemency and structure rehabilitation, the district court had the ongoing ability, through Defendant’s conditions of probation, to monitor Defendant’s behavior to determine whether he continued to be capable of rehabilitation and suitable for clemency. It therefore did not make any difference that Defendant had yet to begin serving his sentence in CR 99-500 when he violated the conditions of the probation attached to that case. The district court retained jurisdiction to revoke his probation and suspended sentence.
{8} We note that Defendant, relying on a stated exception in Padilla, argues that we should apply the rule of lenity because Defendant could not have known that the judgment and sentence, ambiguous statutory authority, and case law would subject him to conditions of probation in CR 99-500 from the time of his original sentencing or at any time prior to the expiration of his sentence in CR 99-502. We do not agree. As we have discussed, Defendant had notice of the probation conditions because they applied in both eases. More significantly, given that Defendant has no right to a suspended sentence and probation, and given the general language of Padilla that a “sentencing court retains jurisdiction to revoke a suspended sentence for good cause shown at any time subsequent to the entry of judgment and prior to the expiration of the sentence,” we cannot say that Defendant could reasonably expect that he could violate conditions of his probation in CR 99.-500 prior to his sentence in that case with impunity. Padilla, 106 N.M. at 422, 744 P.2d at 550. As said in a special concurring opinion in James v. United States, 140 F.2d 392, 394 (5th Cir.1944) (Waller, J., specially concurring) (quoting Burns v. United States, 287 U.S. 216, 222, 53 S.Ct. 154, 77 L.Ed. 266 (1932)):
If, at any time before the defendant has completed the maximum period of probation, or before he has begun service of his probation, he should commit offenses of such nature as to demonstrate to the court that he is unworthy of probation and that the granting of same would not be in subservience of the ends of justice and the best interests of the public, or the defendant, the court could revoke or change the order of probation. A defendant on probation has no contract with the court. He is still a person convicted of crime, and the expressed intent of the Court to have him under probation beginning at a future time does not “change his position from the possession of a privilege to the enjoyment of a right.”
REVOCATION IN CR 99-502
{9} The State filed the petition to revoke probation in CR 99-502 on June 9, 2004. The district court held a hearing on the petition on July 22, 2004, held a sentencing hearing on November 3, 2004, and entered its order on December 9, 2004. The parties do not dispute that the underlying sentence expired on September 9, 2004. Because of the expiration of the sentence, the district court no longer had jurisdiction to take action. State v. Travarez, 99 N.M. 309, 311, 657 P.2d 636, 638 (Ct.App.1983). We reverse the district court’s order revoking Defendant’s probation and imposing sentence in CR 99-502.
{10} In reversing this order, we note that it grants Defendant credit for probation served of fifty-six days after the expiration of Defendant’s sentence in CR 99-502. However, Defendant is not entitled to any further credit as he contends on appeal because the district court properly gave him credit for the same fifty-six days in its order revoking probation and imposing sentence in CR 99-500.
CONCLUSION
{11} We affirm the district court’s order revoking probation and imposing sentence in CR 99-500 and reverse the order revoking probation and imposing sentence in CR 99-502.
{12} IT IS SO ORDERED.
I CONCUR: IRA ROBINSON, Judge. MICHAEL E. VIGIL, Judge (concurring in part and dissenting in part).