
680 A.2d 464 (1996)
343 Md. 2
Robert DEDO
v.
STATE of Maryland.
No. 109, Sept. Term, 1995.
Court of Appeals of Maryland.
July 31, 1996.
*465 John L. Kopolow, Asst. Public Defender (Stephen E. Harris, Public Defender, on brief), Baltimore, for Petitioner.
Tarra DeShields-Minnis, Asst. Atty. Gen. (J. Joseph Curran, Jr., Atty. Gen., on brief), Baltimore, for Respondent.
Argued before MURPHY, C.J., and ELDRIDGE, RODOWSKY, CHASANOW, KARWACKI, BELL and RAKER, JJ.
RAKER, Judge.
The question we must decide in this case is whether Maryland Code (1957, 1992 Repl. Vol., 1995 Supp.) Art. 27, § 638C(a),[1] requires that a defendant be granted credit toward his sentence for the time he spent in home detention between his conviction and sentencing. We shall hold that the defendant was entitled to credit for time spent in home detention because he was committed to the custody of the Warden of the Wicomico County Detention Center ("WCDC") and, under a home detention agreement, was subject to prosecution for escape for any unauthorized absence from his home.
Robert Dedo was arrested on August 15, 1993, and charged with possession with intent to distribute a controlled dangerous substance in violation of Art. 27, § 286. On October 14, 1993, he was released on bond. He was subsequently indicted and convicted of possession with intent to distribute a controlled dangerous substance (Lysergic Acid Diethylamide).
Dedo requested a deferral of sentencing until the end of August 1994. He indicated that he would be willing to accept any arrangement that the court determined would assure his appearance for sentencing. The following colloquy occurred between the court and the parties:
THE COURT: ... Are we ready to proceed with sentencing today?
[DEFENSE COUNSEL]: Your Honor, as a result of some discussions with [the prosecutor] *466 which I think you are aware and as a result of Mr. Dedo's having some insurance available until the end of August, we would be asking for a deferral of sentence and any type of arrangement to assure that he comes back would be agreeable to the defendant.
THE COURT: All right.
[DEFENSE COUNSEL]: Just for the record, I will show [the prosecutor], this is his last appointment where he is insured.
THE COURT: It is my understanding the State has no objection?
[STATE]: With some qualifications, Your Honor. I believe there have been some discussions about
THE COURT: He will be placed on home detention pending scheduling of the sentence.
...
THE COURT: ... The defendant will be ordered on home detention. How is that arranged?
[STATE]: And with the stipulation that he have electronic monitoring, and the defense would request that as well. Your Honor, I would ask
THE COURT: You want electronic monitoring and any violation of the home detention will result in him being incarcerated pending sentencing.
[STATE]: Your Honor, I further request that the defendant be directed to report immediately to the office.
...
THE COURT: All right. He will be ordered to report there directly after court.
The court order committing Dedo to home detention pending sentencing reads as follows:
TO: WARDEN, WICOMICO COUNTY DETENTION CENTER
YOU ARE HEREBY COMMANDED TO RECEIVE THE BODY OF THE ABOVE NAMED DEFENDANT, WHO IS COMMITTED FOR FURTHER ACTION AS FOLLOWS:
Awaiting Further Proceedings before the Circuit Court for Wicomico County: SentencingDefendant on Home Detention and electronic monitoring until sentencing after August 30, 1994.
Dedo signed a Wicomico County Department of Corrections home detention contract that provided that "[a]ny unexcused or unexplained absence during curfew hours will be considered an escape and you will be charged accordingly." Dedo agreed to be "incarcerated" in his home and to be subject to custodial monitoring by both telecommunications technology and surveillance by home detention staff members. Dedo agreed to permit the County Department of Corrections to connect a portable video camera to his telephone to conduct the electronic monitoring. Dedo also agreed to permit members of the home detention staff to enter his home at any time to install or inspect the equipment and to ensure his compliance with all rules, regulations and conditions of the Home Detention Program; to refrain from possessing or using alcoholic beverages; to submit to random urinalysis and breath alcohol testing; and to disciplinary action for any lateness, failure to call in, busy phone line for an extended time, or failure to respond to a call. The agreement also provided:
I further understand that if I violate any of the above conditions of Home Detention, my sentence may be terminated and I will be returned to the Wicomico County Detention Center for the remainder of my sentence. At the absolute discretion of the Home Detention Director and on the Director of the Wicomico County Detention Center.
On September 2, 1994, the court sentenced Dedo to two years in the Department of Corrections. Dedo requested credit against his sentence for the time he spent in home detention. The State objected and argued that the period of time Dedo spent in home detention "was a pre-trial release situation," not incarceration, and therefore, he was not entitled to credit against his sentence. The judge refused to give Dedo credit for the time he spent in home detention, stating that "[h]ome detention is not in jail."
Dedo appealed to the Court of Special Appeals. The court affirmed the judgment of the circuit court, holding that Art. 27, § 638C(a) "does not require credit to be *467 awarded for time spent in home detention after conviction but prior to sentencing." Dedo v. State, 105 Md.App. 438, 453, 660 A.2d 959, 966 (1995). Relying on Balderston v. State, 93 Md.App. 364, 612 A.2d 335 (1992), the intermediate appellate court held that the time Dedo spent in home confinement pending sentencing did not constitute "custody" under Art. 27, § 638C(a) because Dedo requested home detention and the conditions of his home detention would have allowed him "to leave his house to visit the doctor." Dedo, 105 Md.App. at 454, 660 A.2d at 966. The court also noted that there was "no ... indication in the record as to what restrictions were placed on appellant's home detention or whether the home detention was a condition of his continued release on bond."[2]Id. at 453, 660 A.2d at 965. We granted Dedo's petition for writ of certiorari.
Dedo contends that under Art. 27, § 638C(a), a defendant sentenced to a term of confinement is entitled to credit against his sentence for time spent in custody as a result of that charge. He argues that he is entitled to credit for the presentence confinement he spent in home detention because he was committed to the custody of the WCDC Home Detention Program, a program the County operates pursuant to Art. 27, § 645-II. He asserts that under that program a defendant is entitled to credit for each day of any court imposed sentence he serves in home detention. He recognizes, as he must, that he was committed to the program pending sentencing. He argues, however, that Art. 27, § 638C(a) makes presentence confinement the equivalent of post-sentencing confinement for purposes of credit. Therefore, he concludes that he is entitled to credit. In addition, Dedo contends that under Art. 27, § 638C(a), he was entitled to receive credit against his sentence for the time he spent under home detention because he was "in custody"; that is, he was actually in the constructive custody of the WCDC even though he was physically confined in his home. He further asserts that he was in "custody" while in home detention because the Home Detention Contract provided that he could be charged with escape under Art. 27, § 139 for any unauthorized departure from his home. Alternatively, Dedo contends that the trial judge abused his discretion in denying credit for the time he served in home detention.
The State argues that Dedo is not entitled to credit against his sentence for the time he spent in home detention while awaiting sentencing because home detention is not "custody" within the contemplation of the statute, nor can it be considered the equivalent of custody. The State views Dedo's participation in the home detention program as voluntary, and thus, not the equivalent of incarceration, because home detention was imposed at Dedo's behest to enable him to visit his personal physician. The State also argues that he was not committed to a jail or a correctional facility. The State also suggests that home detention was utilized by the court as a "form of conditional bond."
Article 27, § 638C(a) mandates that where an individual is in custody before trial and is subsequently convicted on the charge for which that individual was held, the "time spent in custody prior to the imposition of sentence must be credited against the sentence imposed." Fleeger v. State, 301 Md. 155, 160, 482 A.2d 490, 493 (1984). The statute has a dual purpose: to preclude a defendant from "banking" time before he or she commits a new offense and to eliminate "dead" time, which is time spent in custody *468 that will not be credited to a future sentence. Id. at 163-65, 482 A.2d at 494-95. We observed in Fleeger that "[b]y enacting § 638C(a), the General Assembly sought to ensure that a defendant receive as much credit as possible for time spent in custody as is consistent with constitutional and practical considerations." Id. at 165, 482 A.2d at 495; see also Maus v. State, 311 Md. 85, 101, 532 A.2d 1066, 1074 (1987).
The question is whether commitment to the custody of the Warden of the WCDC with placement in home detention subsequent to conviction but before sentencing constitutes "custody" within the meaning of the credit statute. In order to come within the purview of the statute, Dedo must show that he is (1) "in custody" and (2) in a jail, correctional institution, hospital, mental hospital or other agency.[3]
In Maus v. State, 311 Md. 85, 532 A.2d 1066 (1987), we had occasion to consider the meaning of the phrase "in the custody of any state, county or city jail, correctional institution, hospital, mental hospital or other agency" within the meaning of Art. 27, § 638C(a). Maus contended that under the statute, he was entitled to credit against his sentence for the time he spent at Second Genesis, a residential drug treatment program, imposed at his request as a condition of his probation. This Court rejected his argument that his stay at Second Genesis was the functional equivalent of imprisonment and found that residence in a facility such as Second Genesis is not custody within the context of Art. 27, § 638C(a). Maus, 311 Md. at 104, 532 A.2d at 1076. In construing the meaning of the word "custody," we found that the plain language of the statute was of little assistance because the statute does not provide a definition of "custody" and does not make clear whether the legislature intended to allow credit for time spent in a facility such as Second Genesis. Id. at 101, 532 A.2d at 1074. We observed, however, that the statute appeared to be modeled on § 3.6(a) of the ABA Standards for Criminal JusticeStandards Relating to Sentencing Alternatives and Procedures (Approved Draft 1968), and thus, the ABA Standards provided valuable guidance in interpreting Art. 27, § 638C(a). We concluded that under § 3.6(a) of the ABA Standards, credit should be awarded for time spent in a drug treatment facility, when the defendant "is civilly committed to the treatment facility and when, in cases of unauthorized departure, he or she is guilty of the crime of escape." Id. at 103, 532 A.2d at 1075. We deemed mere supervision insufficient to qualify as custody; in order to qualify for credit, the custody "had to be involuntary and pursuant to a court commitment to a public institution." Id. at 101, 532 A.2d at 1074.
We held that the legislature did not intend to provide credit for time spent in facilities such as Second Genesis. Id. at 104, 532 A.2d at 1076. We noted that the court could not have committed a defendant to Second Genesis and that participation in the program was voluntary. Nor could the court have imposed "imprisonment" as a condition of Maus' probation. Id.; see also Flaherty v. State, 322 Md. 356, 364, 587 A.2d 522, 525 (1991); Stone v. State, 43 Md.App. 329, 335, 405 A.2d 345, 348 (1979). We found it highly significant that Maus could not have been punished with escape under Art. 27, § 139 for an unauthorized departure from the Second Genesis program. See Maus, 311 Md. at 104, 532 A.2d at 1076.
In Balderston, the Court of Special Appeals considered whether home detention, requested by the defendant as a condition of probation, was custody under Art. 27, § 638C(a). 93 Md.App. at 365, 612 A.2d at 336. In that case, the defendant's probation had been revoked and the original sentence reimposed. The defendant argued that he should be given credit for the time spent in home detention because his confinement was *469 tantamount to imprisonment and custody. The court rejected the defendant's contention and concluded:
[V]oluntary home detention, a situation in which a defendant can leave his home to go to work, and has freedom of movement and association within his home, cannot be considered "custodial," or the equivalent of custody. On the contrary, the reason appellant requested that he be permitted to participate in home confinement is because it is not the equivalent of custody, i.e., he could tend to his responsibilities and maintain his job.
Id., 93 Md.App. at 370, 612 A.2d at 338.
In the instant case, the Court of Special Appeals relied primarily on Balderston and Maus in concluding that Dedo was not entitled to credit for the time he spent in home detention post-conviction but pre-sentencing. The court noted, as well, that the majority of courts that have considered whether home confinement constitutes custody for purposes of crediting time have held that it does not. Dedo, 105 Md.App. at 454, 660 A.2d at 966.
We find, however, that both Maus and Balderston are distinguishable from the instant case. Where a defendant is punishable for the crime of escape for an unauthorized departure from the place of confinement, the custody requirement of Art. 27, § 638C(a) is met. A defendant is not in "custody" for purposes of Art. 27, § 638C(a) if the conditions of the defendant's confinement do not impose substantial restrictions on the defendant's freedom of association, activity and movement such that unauthorized absence from the place of confinement would be chargeable as the criminal offense of escape under Art. 27, § 139.
This approach is consistent with the view we embraced in Maus and what appears to be the view of the majority of jurisdictions that have considered whether to grant credit against a sentence. See Maus, 311 Md. at 103, 532 A.2d at 1075; see also, e.g. Lock v. State, 609 P.2d 539, 545-46 (Alaska 1980) (defendant entitled to credit where residential treatment program placed substantial restrictions on freedom of movement and behavior such that unexcused departure considered escape); State v. Babcock, 226 Kan. 356, 597 P.2d 1117, 1121-22 (1979) (denying credit because circumstances of defendant's placement in halfway house did not make unauthorized departure punishable under escape statute); State v. Reyes, 207 N.J.Super. 126, 504 A.2d 43, 52 (App.Div.), cert. denied, 103 N.J. 499, 511 A.2d 671 (1986) (credit for time spent in residential drug treatment facility available only if restrictions so confining that violations constitute offense of escape); State v. Gilbert, 115 Wis.2d 371, 340 N.W.2d 511, 515 (1983) (suggesting that credit is due if any part of defendant's status would be considered "custody" for purposes of the criminal escape statute); Prejean v. State, 794 P.2d 877, 879 (Wyo.1990) (credit is due when charge of escape from detention in community correctional facility will lie). This construction is also consistent with the purpose of Art. 27, § 638C(a) which, as we earlier noted, was enacted to avoid the undesirable consequences of "dead time." Construing Art. 27, § 638C(a) to provide credit for home detention prior to sentencing under the circumstances of this case would effectuate this purpose.
In the instant case, the restraints placed upon Dedo while in home detention clearly were sufficiently incarcerative to satisfy the custody requirement of Art. 27, § 638C(a). Initially, we note that the WCDC home detention contract characterized Dedo's confinement as incarceration. For any unexcused or unexplained absence from his home during curfew hours, Dedo could have been charged with escape under Art. 27, § 139. Moreover, Dedo was actually committed to the custody of the Warden of WCDC, and, throughout the period of his home detention, Dedo was subject to the control of the Warden and the Home Detention staff; any violation of the home detention would have resulted in his immediate imprisonment. Dedo's movements and activities were electronically monitored through telecommunications video surveillance equipment, and he was required to permit members of the home detention staff into his home at any time of the day to install and/or inspect the monitoring equipment and to ensure his compliance with the rules of his home detention. In addition, he was not permitted to possess or consume *470 alcoholic beverages and was subject to random urinalysis and breath alcohol testing.
Further, we believe that where an individual is punishable for escape for any unexcused absence from the place of confinement, his confinement is necessarily involuntary. Following his conviction, Dedo requested "any type of arrangement to assure that he comes back" for sentencing in order to allow him to receive medical treatment. We are not persuaded that Dedo's request signifies that the time he spent in home detention was voluntary. Cf. Lock, 609 P.2d at 545 (defendant faced with choice between probation in residential treatment program and imprisonment can not be said to have voluntarily chosen condition of probation). Because Dedo could have been charged with escape for any unexcused absence from his home during curfew hours, his participation in the home detention program was involuntary. Compare Reyes, 504 A.2d at 52 (denying credit for time spent in residential drug program because violation of program restrictions did not constitute offense of escape). Accordingly, we find that the circumstances of Dedo's home detention clearly indicate that he was in custody.
We also find that under the circumstances of this case Dedo's home qualifies as an institution contemplated by the terms of Art. 27, § 638C(a). The trial court ordered Dedo committed to the Warden of the WCDC pending sentencing to be "incarcerated" at his home under the county's home detention program. Because Dedo was committed to the custody of the Warden for incarceration, he was in the constructive custody of a public institution.
We note that the Attorney General, in a 1991 opinion letter, stated that an individual confined in home detention was "incarcerated `in a local detention center,' in the sense that the prisoner's home can be said to be an extension of the local detention center." 91 Op. Att'y Gen. 189, 192 (1991). Further, in a 1994 opinion letter, the Attorney General stated that "[a]n inmate on post-conviction home detention is in the custody of the Division of Corrections pursuant to a court order, and, upon violation of a condition of home detention, may be remanded to prison without further action by the court." 94 Op. Att'y Gen. 279, 283 (1994). While advisory only, we find the opinions persuasive.
Accordingly, we hold that under Art. 27, § 638C(a) the trial court was required to give Dedo credit against his sentence for the time he spent in home detention from June 15, 1994, until September 2, 1994.
JUDGMENT OF THE COURT OF SPECIAL APPEALS REVERSED. CASE REMANDED TO THAT COURT FOR FURTHER PROCEEDINGS IN ACCORDANCE WITH THIS OPINION. COSTS TO BE PAID BY WICOMICO COUNTY.
NOTES
[1]  Section § 638C(a) provides in pertinent part:

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. (emphasis added).
Unless otherwise indicated, all following statutory citations are to Maryland Code (1957, 1992 Repl.Vol., 1995 Supp.) Art. 27.
[2]  Following the decision of the Court of Special Appeals, the record was amended to include copies of the "Commitment Pending Further Action" and the "Wicomico County Department of Corrections Home Detention Contract Agreement." These documents were not before the Court of Special Appeals when it considered this case. In this regard, the court noted:

Although the record does not disclose what restrictions, if any, were imposed on appellant, it is clear that the operation of the home monitoring would allow appellant, at the least, to leave his house to visit the doctor. Accordingly, as explained in Balderston, the reason appellant requested home detention is because it is not the equivalent of custody, i.e., he could tend to his medical and insurance needs. Therefore, we hold that appellant's time spent in home confinement post conviction but presentence is not "custody" for the purpose of crediting time served pursuant to section 683C(a).
Dedo v. State, 105 Md.App. 438, 454, 660 A.2d 959, 966 (1995) (footnote omitted).
[3]  We concluded in Maus v. State, 311 Md. 85, 105 n. 9, 532 A.2d 1066, 1076 n. 9 (1987), that § 638C(a) deals only with public institutions, as evidenced by the fact that the institutions enumerated in the statute are all modified by the adjectives "state," "county" or "city." Nonetheless, this construction does not preclude our finding that custody includes the concept of "constructive custody." See Johnson v. Warden, 196 Md. 672, 674, 75 A.2d 843, 844 (1950) (holding that individual on work release to private farm from State Reformatory for Males was punishable for escape).
