When the trial court has determined that a violation of a condition of probation has occurred, the court may resentence but may not impose a sentence greater than that which was originally imposed and suspended.
The trial court, upon its determination that a probationer has violated one or more conditions of probation, enjoys many options. “These options vary from continuing the probation to reimposing the full remaining term of a suspended sentence.”
State v. Dopkowski 325 Md. 671, 678, 602 A.2d 1185 (1992). (Citations omitted. Emphasis added.)
The problem in this case arose because a trial court, having found a violation of probation, imposed an illegal sentence.
In 1982, appellant, James Merritt, pleaded guilty in the Circuit Court for Prince George’s County to eight crimes. The court imposed a combination of concurrent and consecutive sentences, but execution of those sentences was suspended in favor of probation.
In March of 1983, appellant pleaded guilty to another crime. As a result of that conviction, the court revoked appellant’s probation and ordered execution of the suspended sentences.
In December of 1990, the court granted a reconsideration of appellant’s sentences and suspended execution of the unserved balance of those sentences in favor of probation.
Appellant went on another crime spree. In 1992, he was convicted of crimes in Baltimore, Calvert, Charles, and Prince George’s Counties.
As a result of those convictions, the probation granted in 1990 was revoked. At that point, the court could have ordered execution of the remaining term of the unserved balance of the sentences suspended in 1990. Instead, the court purported to direct execution of the entire sentences (including the portions *111that were not suspended in 1990) with credit for time served. Although it may have appeared at the time to amount to the same thing, it was not. It was an illegal sentence. As we mentioned at the outset, when a court finds a violation of probation, it may direct execution of only that part of a sentence that was suspended; it may not execute that part of a sentence that has already been served.
Prison officials have refused to credit appellant’s present term of confinement with diminution of confinement credits he earned before his reconsideration of sentence was granted in 1990. Believing that he is entitled to such credit, appellant petitioned the Circuit Court for Prince George’s County for a writ of habeas corpus to challenge the legality of his confinement, claiming that he is entitled to immediate release to serve the remainder of his sentences on mandatory supervision. (Maryland Code, Article 41, § 4-501(13)). That court denied relief, and this appeal was taken from that judgment. We shall affirm.
When appellant was released from prison in 1990, the unsuspended portion of his sentences was fully executed, and the diminution of confinement credits he had earned became moot. Since his sentence was completely served, the possibility that a part of the sentence might be served on mandatory supervision became a non-issue. The unserved balance of his sentences was not simply stayed, it was conditionally suspended. If he had abided by the conditions of his probation, he could have avoided serving any part of the suspended sentences, either in prison or on mandatory supervision.
Appellant did not abide by the conditions of his probation, however, and his probation was revoked. As we said in Coley v. State, 74 Md.App. 151, 156, 536 A.2d 1166 (1988), “[I]f an order revoking a defendant’s probation returns the hearing judge to the original sentencing status, then any sentence so imposed must have the effect of an original sentence.” Prison officials have correctly treated appellant’s present term of confinement as separate and distinct from the term of confine*112ment he served prior to 1990. The denial of habeas corpus relief was proper.
JUDGMENT AFFIRMED.
COSTS TO BE PAID BY APPELLANT.