
734 A.2d 712 (1999)
355 Md. 339
Jose Armando MELGAR
v.
STATE of Maryland.
No. 152, Sept. Term, 1998.
Court of Appeals of Maryland.
August 5, 1999.
*713 Michael R. Malloy, Asst. Public Defender (Stephen E. Harris, Public Defender, on brief) Baltimore, for petitioner.
Annabelle L. Lisic, Asst. Atty. Gen. (J. Joseph Curran, Jr., Atty. Gen., of Maryland, on brief) Baltimore, for respondent.
Argued before BELL, C.J., and ELDRIDGE, RODOWSKY, RAKER, WILNER, CATHELL and THEODORE G. BLOOM, (Retired, specially assigned), JJ.
RAKER, J.
Jose Armando Melgar challenges his sentence of incarceration for twenty-five years without parole, imposed by the Circuit Court for Prince George's County pursuant to the enhanced penalty provision contained in Article 27, § 286(d) of the Maryland Code. He asserts that the State *714 did not satisfy its burden of proving one of the statutory predicates for imposing the enhanced penalty, that is, that he had served at least 180 days of a term of confinement in a correctional institution imposed as a result of a previous conviction under § 286 or § 286A. We must decide whether the required 180-day term of prior confinement may include time spent by a defendant in pretrial detention stemming from the charges upon which the previous conviction rested. We shall hold that because the time a defendant spends in pretrial detention ordinarily is not as "a result of a conviction," such time may not be included to satisfy the statutory requirement under § 286(d) of a term of confinement of at least 180 days. Accordingly, we shall reverse the judgment of the Court of Special Appeals upholding Melgar's mandatory, enhanced sentence.

I.
In July of 1997, the Grand Jury for Prince George's County indicted Petitioner, Jose Armando Melgar, on four counts: possession of cocaine with intent to distribute, in violation of Maryland Code (1957, 1996 Repl.Vol., 1998 Supp.), Article 27, § 286(a)(1);[1] possession of cocaine, in violation of § 287(a); making a false statement to a police officer, in violation of § 150(b); and resisting arrest, in violation of the common law. On October 16, 1997, following a two-day jury trial in the circuit court, Petitioner was found guilty on all four counts. The State served Petitioner with notice of intent to seek mandatory sentencing under § 286(d) based upon two previous drug convictions under § 286(b) and the concomitant, concurrent term of incarceration he had served for those convictions. Section 286(d) is an enhanced penalty provision for three-time, or so-called "third-strike," drug offenders; it reads, in pertinent part, as follows:
§ 286. Unlawful manufacture, distribution, etc.; counterfeiting, etc.; manufacture, possession, etc., of certain equipment for illegal use; keeping common nuisance.

* * * * * *
(d)(1) A person who is convicted under subsection (b)(1) or subsection (b)(2) of this section or of conspiracy to violate subsection (b)(1) or subsection (b)(2) of this section shall be sentenced to imprisonment for the term allowed by law, but, in any event, not less than 25 years if the person previously:
(i) Has served at least 1 term of confinement of at least 180 days in a correctional institution as a result of a conviction of a previous violation of this section or § 286A of this article; and
(ii) Has been convicted twice, where the convictions do not arise from a single incident:
1. Under subsection (b)(1) or subsection (b)(2) of this section;
2. Of conspiracy to violate subsection (b)(1) or subsection (b)(2) of this section;
3. Of an offense under the laws of another state, the District of Columbia, or the United States that would be a violation of subsection (b)(1) or subsection (b)(2) of this section if committed in this State; or
4. Of any combination of these offenses.
(2) Neither the sentence required under paragraph (1) of this subsection nor any part of it may be suspended, and the person may not be eligible for parole except in accordance with Article 31B, § 11 of the Code.
Thus, in order to invoke the mandatory penalty of twenty-five years in prison without parole for a three-time drug offender under § 286, the State must establish three predicates, namely, that the defendant about to be sentenced: first, is presently convicted of violating or conspiring to *715 violate § 286(b)(1) or (b)(2); second, has two prior convictions, not arising out of a single incident, for violating or conspiring to violate § 286(b)(1) or (b)(2)or like offenses within another American jurisdiction; and third, has served at least one term of confinement of at least 180 days in a correctional institution as a result of conviction of a previous violation of § 286 or § 286A.
Petitioner did not dispute before the sentencing court, nor has he contested on appeal, the State's satisfaction of the first two predicates that we have outlined above as necessary for imposition of the three-time drug offender enhanced penalty. As to the third prerequisite, the State averred at the sentencing hearing in the present case that Petitioner had served a single term of confinement of 248 days as a result of his earlier drug convictions. Petitioner rebutted neither the State's presentation of evidence nor its argument at that time. The sentencing court found that the State had satisfactorily demonstrated fulfillment of all three predicates under the enhanced penalty provision of § 286(d). Stating that she had "no discretion but to impose the sentence the State requests," the court sentenced Petitioner to twenty-five years of imprisonment without the possibility of parole.
Petitioner noted a timely appeal to the Court of Special Appeals, contending for the first time that he did not qualify for the mandatory, three-time drug offender enhanced sentencing because the State had failed to demonstrate that he had served the 180-day term of confinement required by § 286(d)(1)(i).[2] When Petitioner was sentenced in 1996 on the earlier drug offenses, the court gave him credit for 107 days he had spent in pretrial detention at the Prince George's County Detention Center because of his inability to post the required bond. As it turned out, Petitioner served a total of 248 days concurrently on the prior two convictions before being released on probation. Petitioner argued that, because he had served 107 days as a result of his failure to post bond, he had served only 141 days "as a result of" a previous conviction under § 286, not the requisite 180 days. Therefore, Petitioner asserted, he did not qualify for the mandatory, enhanced penalty under § 286(d).
In an unreported opinion, the Court of Special Appeals affirmed the judgment of the circuit court, holding that the 180-day term of confinement mandated by § 286(d)(1)(i) implicitly includes pretrial detention served in relation to the same underlying, qualifying offense. We granted Melgar's petition for writ of certiorari to consider whether the Court of Special Appeals erred in concluding that the time Petitioner spent in pretrial detention may properly be considered in computing the statutory predicate that he must have served "at least 1 term of confinement of at least 180 days in a correctional institution as a result of a conviction of a previous violation" of § 286 or § 286A before the mandatory, enhanced penalty under § 286(d) could be imposed upon him.

II.
Petitioner contends that the trial court erred in finding that he had served at least one term of confinement of at least 180 *716 days in a correctional institution as a result of a conviction of a previous violation of § 286. While acknowledging that he had the two prior convictions necessary to support the imposition of the mandatory sentence pursuant to § 286(d) and likewise that he had served more than 180 days of confinement, he nonetheless points to the undisputed facts that he had served a total of 141 days in the Maryland Division of Correction and had received credit for the 107 days that he had spent in pretrial incarceration in the Prince George's County Detention Center. Petitioner insists that the 107 days spent at the detention center awaiting trial cannot be counted toward the statutory 180-day period: he was not detained "as a result of conviction"as is required under § 286(d)but simply because he was unable to post bail. He argues that the mere fact that the trial court gave him credit for the 107 days of pretrial incarceration cannot convert those 107 days into time served as a result of a conviction.
The State's counter-argument essentially mirrors the rationale expressed by the Court of Special Appeals in affirming Petitioner's sentence under § 286(d). The State explains that after his conviction on the prior offenses, Petitioner was sentenced by the court to a term of confinement of one year and a day, with credit toward that sentence for the 107 days he had served in pretrial detention. Because the total concurrent term of confinement Petitioner actually served for the previous offenses was 248 days, it satisfied the statutory predicate of a 180-day term of confinement as prescribed by § 286(d)(1)(i). Under the State's interpretation, § 286(d) does not preclude cumulating the entire period of confinement with respect to a single charge and conviction. The State suggests that it is disingenuous for Petitioner to argue that his 107 days of pretrial confinement should not count toward the statutory 180-day requirement given that he has already benefitted from having that time credited toward his sentence. See Maryland Code § 638C(a).[3]

III.
In construing a statute, the objective is to ascertain and give effect to the intent of the Legislature. Lewis v. State, 348 Md. 648, 653, 705 A.2d 1128, 1130 (1998). To discern legislative intent, we look first to the plain language of the statute, "as the words of the statute, given their ordinary and popularly understood meaning, are the primary source of legislative intent." Gargliano v. State, 334 Md. 428, 435, 639 A.2d 675, 678 (1994). If the language of the statute is plain and clear, and expresses a meaning consistent with the statute's goals and apparent purpose, our inquiry is ordinarily at an end. Id., 639 A.2d at 678. If the language is ambiguous or unclear, we then examine the surrounding circumstances, including legislative history, prior case law and the statute's purpose to discern legislative intent. Lewis, 348 Md. at 653, 705 A.2d at 1131.
Furthermore, § 286(d), an enhanced penalty statute, is highly penal and must be strictly construed so that the defendant is only subject to punishment contemplated by the statute. Jones v. State, 324 Md. 32, 38, 595 A.2d 463, 466 (1991); see also Dickerson v. State, 324 Md. 163, 172, 596 A.2d 648, 652 (1991); Wynn v. State, 313 Md. 533, 539-40, 546 A.2d 465, *717 468 (1988). When doubt exists regarding the punishment imposed by a statute, the rule of lenity instructs that a court
"not interpret a ... criminal statute so as to increase the penalty that it places on an individual when such an interpretation can be based on no more than a guess as to what [the legislature] intended."
White v. State, 318 Md. 740, 744, 569 A.2d 1271, 1273 (1990) (quoting Simpson v. United States, 435 U.S. 6, 15, 98 S.Ct. 909, 914, 55 L.Ed.2d 70 (1978) (in turn quoting Ladner v. United States, 358 U.S. 169, 178, 79 S.Ct. 209, 214, 3 L.Ed.2d 199 (1958))); Gargliano, 334 Md. at 437, 639 A.2d at 679; Monoker v. State, 321 Md. 214, 222-23, 582 A.2d 525, 529 (1990).
We have many times stated the rule that "[w]here the General Assembly has required or permitted enhanced punishment for multiple offenders, the burden is on the State to prove, by competent evidence and beyond a reasonable doubt, the existence of all of the statutory conditions precedent for the imposition of enhanced punishment." Jones, 324 Md. at 37, 595 A.2d at 465 (citing several cases). Applying all the aforementioned principles to the facts and circumstances of the present case, we conclude that the 180-day previous term of confinement required under § 286(d) as a statutory predicate for imposing a twenty-five year mandatory sentence without parole may not be satisfied by cumulating a term of confinement of less than 180 days served post-conviction under the Division of Correction along with however many days have been credited for time spent in pretrial detention. This is true even though all time was served in relation to the same offense for which a defendant was previously charged and sentenced under § 286.
The plain language of the statute "as a result of a conviction" is clear and unambiguous. Time spent in pretrial detention does not come within the 180-day requirement mandated by § 286(d) because such time is not "as a result of a conviction" but merely the consequence of a defendant's not posting bail. Indeed, as Petitioner points out, the language in § 638C's provision of credit against a sentence for time served in pretrial detention is markedly different. Rather than employing the phrase "as a result of conviction," the General Assembly chose to describe the period in pretrial detention that is to be credited under that statute as "time spent in custody... as a result of the charge for which sentence is imposed or as a result of the conduct on which the charge is based." Section 638C(a). We agree with the observation by the Court of Special Appeals in its unpublished consideration of the present case that "[w]e must presume that when the Legislature enacted § 286(d), it was well aware of § 638C and the relationship it would have to the newer statute." (Citations omitted).[4] We view the differences of diction in the two statutesone *718 granting credit, the other enhancing punishmentas indicating a likewise distinct legislative intent: the non-applicability of time credited for pretrial detention under § 638C(a) toward the 180-day term of confinement under § 286(d)(1)(i).
Both parties rely on this Court's decision in Jones, 324 Md. 32, 595 A.2d 463, as support for their respective, yet directly contrary, interpretations of the statutory requirement found in § 286(d)(1)(i). Indeed, in Jones, we reviewed this same provision in considering whether the State had proved the necessary predicate for the enhanced punishment imposed upon Jones under § 286(d). The State argues that even though this Court refused to permit cumulation of confinements for separate convictions or incidents to satisfy the 180-day requirement, we did not rule out totaling the entire period of confinement with respect to a single charge and conviction. Moreover, the State seizes upon our statement in Jonesto the effect that the fact that under his sentence "Jones was given credit for time served [in pretrial detention]... effectively started the term of confinement" at the time his pretrial detention began, see id. at 39, 595 A.2d at 467as establishment of a rule that time spent in pretrial detention may indeed comprise part of the 180-day term of confinement required under § 286(d)(1)(i). Petitioner retorts that this issue, which he describes as "the significance of the words `as a result of conviction,'" was not before the Jones Court and implicitly suggests that we lend little credence to a one sentence dictum upon which the State would hinge our present analysis.
We held in Jones that the sentencing court may not find that the 180-day requirement for a mandatory sentence under § 286(d) has been satisfied based merely on the fact that a defendant was sentenced to one year of unsuspended time.[5]Id. at 37, 595 A.2d at 465. In concluding that the State had failed to satisfy its burden, we further observed:
The requirement that a minimum of 180 days be served in at least one term of confinement is a limitation that prevents imposing enhanced punishment by cumulating, in order to reach 180 days, time served in separate confinements, on separate convictions, for separate incidents, when no single component equals or exceeds 180 days. Additionally, by imposing the 180 day minimum, the legislature was ensuring that those who received the enhanced punishment had been accorded a fair chance at rehabilitation in the prison system and had not responded.
Id. at 38, 595 A.2d at 466. We made clear that the critical feature of the statutory requirement and phrase "term of confinement" means time actually served, not simply the length of the sentence imposed. Id., 595 A.2d at 466. Yet never did we focus upon the meaning of the phrase "as a result of a conviction."
Thus, we agree with Petitioner that in Jones the precise issue presented herein was not before us. Nevertheless, Jones is important for several points. In addition to holding that a sentence of one year "unsuspended time" is insufficient proof that the defendant actually had served at least 180 days as a result of a prior conviction, and indicating that the State may not cumulate periods of time served, we noted that an enhanced penalty statute is by nature highly penal, and hence must be strictly construed. Id., 595 A.2d at 466. Strict construction, in the context of a penal statute, "means a construction favorable to the accused, and against the State." *719 State v. Polley, 97 Md.App. 192, 200, 627 A.2d 562, 565 (1993). Just as importantly, we reemphasized one of the goals of enhanced punishment statutesto identify and punish severely those offenders who "had been accorded a fair chance at rehabilitation in the prison system and had not responded." Jones, 324 Md. at 38, 595 A.2d at 466 (quoted in Gargliano, 334 Md. at 443, 639 A.2d at 682).
Our conclusion that time spent in pretrial detention, because it is not as a result of a conviction, may not be tacked on to time served post-conviction in a term of confinement so as to satisfy the 180-day predicate under § 286(d)(1)(i) is consistent with the Legislature's desire to accord to a defendant a true opportunity and fair chance at rehabilitation before being sentenced under the enhanced penalty statute. Many opportunities for rehabilitation that are bestowed upon inmates who have been sentenced to incarceration generally are not available to pretrial detainees. For example, inmates sentenced to the Division of Correction are presumably subject to the guidelines and objectives of the Division, which include the inmates' "successful reintegration into the community through programs of remediation, treatment, training, education, and work release." C.O.M.A.R. § 12.02.01.02. Conversely, pretrial detainees in local detention centers often are not provided with the same, full opportunities for rehabilitation because of their statusthat they have not yet been convicted and sentenced.
Although local detention centers offer many rehabilitative services to both pretrial detainees and sentenced inmates, there nonetheless remains a distinction between the two regarding the availability of some programs because of the lesser potential for reducing recidivism in pretrial offenders. Most notably, correctional facilities in several jurisdictions in Maryland offer to inmates the opportunity to participate in a drug treatment program entitled "High Intensity Drug Trafficking Area" (HIDTA).[6] This federally funded program is designed specifically to treat chronic substance-abusing, criminal offenders. Participation in HIDTA, however, is routinely limited to sentenced inmates and is not usually made available to pretrial detainees. Such a restriction is in place, for instance, at the Prince George's County Detention Center where Petitioner spent his pretrial detention. See PRINCE GEORGE'S COUNTY DEPARTMENT OF CORRECTIONS, HIDTA IMPACT PROGRAM para. 4 (n.p., n.d.).
In sum, the public policy goal of affording criminal offenders a meaningful chance at rehabilitation before subjecting them to mandatory, enhanced penalties and the incomplete availability of rehabilitative services to pretrial detainees underscore the purposefulness of the Legislature's choice of the phrase "as a result of conviction." In our view, this distinct statutory phrase reflects the legislative intent that time in pretrial detention neither suffice nor in any degree supplement the statutory prerequisite of a minimum 180-day term of prior confinement for imposing an enhanced penalty upon a three-time drug offender under § 286.
We therefore conclude that Petitioner's 107 days of pretrial detention were not "as a result of conviction" and that cumulating those days to reach the statutory 180-day predicate under § 286(d)(1)(i) is inconsistent with both the plain language and legislative purpose of the statute as a whole. Because Petitioner had not served at least one term of confinement of at least 180 days in a correctional institution as a result of a conviction of a previous violation of § 286, he was improperly sentenced.
*720 JUDGMENT OF THE COURT OF SPECIAL APPEALS REVERSED. CASE REMANDED TO THAT COURT WITH DIRECTIONS TO VACATE THE SENTENCE IMPOSED BY THE CIRCUIT COURT FOR PRINCE GEORGE'S COUNTY AND TO REMAND THE CASE TO THAT COURT FOR RE-SENTENCING CONSISTENT WITH THIS OPINION. COSTS IN THIS COURT AND IN THE COURT OF SPECIAL APPEALS TO BE PAID BY PRINCE GEORGE'S COUNTY.
NOTES
[1]  Unless otherwise indicated, all subsequent statutory references shall be to Maryland Code (1957, 1996 Repl.Vol., 1998 Supp.), Article 27.
[2]  Petitioner did not in any way argue to the sentencing court that he was ineligible for mandatory, enhanced sentencing. As to Melgar's raising this issue for the first time on appeal, the Court of Special Appeals noted, "Although appellant makes this argument for the first time on appeal, we shall consider it. `When the trial court has allegedly imposed a sentence not permitted by law, the issue should ordinarily be reviewed on direct appeal even if no objection was made in the trial court.' Walczak v. State, 302 Md. 422, 427, 488 A.2d 949 (1985). See also Passamichali v. State, 81 Md.App. 731, 744, 569 A.2d 733, cert. denied, 319 Md. 484, 573 A.2d 808 (1990)." Our grant of certiorari in this case is consistent with the intermediate court's having rendered a decision on this issue below. See Maryland Code (1974, 1998 Repl.Vol.) § 12-307(1) of the Courts and Judicial Proceedings Article.
[3]  Section 638C(a) provides, in relevant part:

§ 638C. Credit against sentence for time spent in custody.
(a) Any person who is convicted and sentenced shall receive credit against the term of a definite or life sentence or credit against the minimum and maximum terms of an indeterminate sentence for all time spent in the custody of any state, county or city jail, correctional institution, hospital, mental hospital or other agency as a result of the charge for which sentence is imposed or as a result of the conduct on which the charge is based, and the term of a definite or life sentence or the minimum and maximum terms of an indeterminate sentence shall be diminished thereby.
[4]  Section 286(d) was enacted by the Laws of Maryland, 1988, Ch. 439, and became effective July 1, 1988. By that time, § 638C had been in place for well over a decade, having been enacted by the Laws of Maryland, 1974, Ch. 735. The Court of Special Appeals interpreted the interplay between the two statutes in much different fashion, and to the opposite conclusion of our holding today, reasoning that

[t]here is no indication whatsoever that the Legislature intended for sentencing courts to impose lengthier sentences upon defendants who have been detained prior to trial in order to promote rehabilitation or to facilitate the imposition of mandatory sentences. Nor is there any indication that the Legislature intended to favor defendants who serve a portion of their sentences prior to trial over defendants who do not....
We note that the first of the Court of Special Appeals's conclusions is founded in part upon the questionable notion that sentencing courts look favorably upon mandatory sentences and would seek to facilitate their application. In addition, the second of the court's conclusions ignores the fact that pretrial release is not mandatory but rather is simply permissive. More importantly, however, the intermediate court minimizes the significance of the greater rehabilitative services extended to sentenced inmates versus the lack of such made available to pretrial detainees. See infra note 6 and accompanying text.
[5]  A sentence of one year "unsuspended time" will not satisfy the State's burden to establish eligibility for the enhanced penalty under § 286(d) because the defendant may not have actually served 180 days in a correctional institution. See Jones v. State, 324 Md. 32, 37, 595 A.2d 463, 465 (1991). We explained that Jones "was at least eligible for consideration for parole after he had served three months of that sentence, excluding any credits against the sentence," id., 595 A.2d at 465, thus rendering the conclusion that Jones actually served 180 days mere speculation, see id. at 38, 595 A.2d at 466.
[6]  The Maryland jurisdictions participating in the federal "High Intensity Drug Trafficking Area" program are Baltimore City and Baltimore, Charles, Howard, Montgomery, and Prince George's Counties. The Washington Baltimore High Intensity Drug Trafficking Area project is funded by the Office of National Drug Control Policy under grant number I7WBP528.
