
609 P.2d 539 (1980)
David A. LOCK, Appellant,
v.
STATE of Alaska, Appellee.
No. 4195.
Supreme Court of Alaska.
April 11, 1980.
*541 Peter A. Galbraith, Galbraith & Frost, Anchorage, for appellant.
Gayle A. Horetski, Asst. Dist. Atty., Joseph D. Balfe, Dist. Atty., Anchorage, Avrum M. Gross, Atty. Gen., Juneau, for appellee.
Before RABINOWITZ, C.J., and CONNOR, BOOCHEVER, BURKE and MATTHEWS, JJ.

OPINION
CONNOR, Justice.
This appeal presents the question of whether time spent in a residential treatment house as a condition of probation should be credited towards the sentence imposed after the probation is revoked. Additionally, appellant challenges his sentence as being excessive.
While awaiting trial on the charge of burglary not in a dwelling, Lock escaped from the state jail annex. He was recaptured, and pled guilty to escape and to the burglary charge. Sentencing was deferred for two years and Lock was ordered placed on probation. As a special condition of probation, Lock was ordered to enroll in Family House, a residential rehabilitation program. He entered the program on May 4, 1977, and escaped on October 10, 1977. Upon recapture, three days later, Lock was ordered to spend the remainder of his term of probation in Akeela House, another rehabilitation program.[1] He entered this program on January 25, 1978, and escaped on March 14, 1978. He was returned to jail on March 23, 1978. His probation was subsequently revoked and he was sentenced to the maximum term on each of the original offenses: five years for burglary not in a dwelling,[2] and three years for escape,[3] with the sentences to run consecutively. The sentencing judge ordered that the 391 days Lock spent in jail be credited towards his sentence, but refused to give credit for the additional 207 days spent in Family House and Akeela House.
Lock contends that he has both a statutory and a constitutional right to credit for time served at Family House and Akeela House. Initially, he argues that failure to give such credit violates his rights under the double jeopardy clause of both the federal and state constitutions.[4] By being sentenced to the maximum term for the original offenses, without receiving credit for time served on probation at the Family and Akeela Houses, Lock maintains, he was given a sentence in excess of the maximum allowed by statute, and is thus subjected to multiple punishment in violation of his right against double jeopardy.[5]
The state urges that this case should be controlled by Paul v. State, 560 P.2d 754 *542 (Alaska 1977), in which we rejected the contention that the constitutional proscription against multiple punishment requires that credit be given for time spent on probation. In Paul, however, no claim was made that the defendant had been sentenced in excess of the statutory maximum by being denied credit for the period of probation. Rather, Paul argued that the reinstatement of his suspended sentence upon revocation of probation without granting credit for his probation time constituted an increase in the sentence originally imposed in violation of his right not to be placed in double jeopardy.[6]
The contention that the double jeopardy clause mandates that credit be given for time spent on probation has been rejected by a number of courts on the premise that probation does not constitute "punishment". See e.g., Hall v. Bostic, 529 F.2d 990 (4th Cir.1975), cert. denied, 425 U.S. 954, 96 S.Ct. 1733, 48 L.Ed.2d 199 (1976); Anglin v. Johnston, 504 F.2d 1165 (7th Cir.1974), cert. denied, 420 U.S. 962, 95 S.Ct. 1353, 43 L.Ed.2d 440 (1975); Thomas v. United States, 327 F.2d 795 (10th Cir.1964), cert. denied, 377 U.S. 1000, 84 S.Ct. 1936, 12 L.Ed.2d 1051 (1964); Jett v. Leverette, 247 S.E.2d 469 (W. Va. 1978); State v. Saavedra, 5 Conn.Cir. 367, 253 A.2d 677 (1968).[7] Appellant contends that the rationale of these cases should not be extended in the context of this case, where time on probation is spent under the restrictions of a rehabilitation program. Although appellant's argument is meritorious, we do not find it necessary to pass on this constitutional question, since there is another ground for decision.
The other basis of Lock's argument is that under AS 11.05.040(a) he has a statutory right to credit for time served at Family House and Akeela House. AS 11.05.040(a) provides:
"When a person is sentenced to imprisonment, his term of confinement begins from the day of his sentence. A person who is sentenced shall receive credit toward service of his sentence for time spent in custody pending trial or sentencing, or appeal, if that detention was in connection with the offense for which sentence was imposed. The time during which the person is voluntarily absent from the penitentiary, reformatory, jail, or from the custody of an officer after his sentence, shall not be estimated or counted as a part of the term for which he was sentenced."[8]
Lock's position is that "in custody" under this statute connotes more than time spent in traditional penal institutions, and should be read broadly to include other types of restrictive environments such as certain therapeutic programs and halfway houses. We agree.
In refuting Lock's position, the state places heavy reliance on Paul v. State, 560 P.2d at 758, where we held that upon revocation of probation the court is empowered under AS 12.55.090(b) "to order execution of the sentence up to but not beyond the maximum period originally specified" without crediting the period of probation against the original suspended sentence. Id. at 758, quoting from dictum in Jackson v. State, 541 P.2d 23, 26 (Alaska 1975). We think Paul is distinguishable from the case at bar in two respects.
*543 First, in Paul, the trial court, pursuant to AS 12.55.080,[9] actually imposed sentence but suspended the execution of a portion thereof. Thus, Paul could not claim that the time he spent on probation was "pending ... sentencing" within AS 11.05.040. Here, the imposition of sentence was suspended pursuant to AS 12.55.085(a),[10] but could be pronounced upon revocation of probation "at any time after the suspension of the sentence within the longest period for which the defendant might have been sentenced."[11] AS 12.55.085(c). See Cochran v. State, 586 P.2d 175, 177 (Alaska 1978); Jackson v. State, 541 P.2d at 26. The time Lock spent on probation in Family House and Akeela House was therefore literally "pending ... sentencing" within the language of AS 11.05.040.
More importantly, Paul is distinguishable as to the degree of restraints imposed as conditions of probation. Although certain limited restrictions were imposed on Paul while on probation, "the court, in an effort to rehabilitate Mr. Paul, permitted him to remain at liberty." 560 P.2d at 758. As conditions of probation, Paul was ordered to remain on his good behavior and "to make reasonable efforts to complete a course in vocational training." [emphasis added] Id. at 755. These restrictions did not interfere in any significant way with Paul's existing life. He was in no sense physically confined and was still free to make his own decisions regarding where to live and work, and with whom to associate. As such, Paul's restrictions could "in no manner ... be equated to serving a period of incarceration." Id. at 758.
We think that under certain circumstances the restraints imposed as conditions of probation may be so substantial that the defendant is, in legal effect, "in custody" although on probation. Confinement need not be penal in nature to be custodial. McNeil v. Director of Patuxent Institution, 407 U.S. 245, 92 S.Ct. 2083, 32 L.Ed.2d 719 (1972). Nor need the defendant be confined to a prison or jail in order to be "in custody" within the meaning of AS 11.05.040. Custodial confinement takes many forms and has been interpreted to include time spent in a mental hospital,[12] a juvenile detention center,[13] a diagnostic *544 center,[14] a hospital,[15] a halfway house,[16] and a hotel room.[17] The West Virginia Supreme Court, in holding that a parolee is entitled to credit towards his sentence for time spent on parole prior to revocation, recognized that:
"Time spent serving a sentence does not depend on the manner or location in which it is served. There are, to be sure, different degrees of confinement recognized in any penal system. The fact that some confinements are less restrictive than others should have no bearing in computing the time served on the sentence."
Conner v. Griffith, 238 S.E.2d 529, 534 (W. Va. 1977) (in Jett v. Leverette, 247 S.E.2d 469, 470 (W. Va. 1978), the court declined to extend Conner to probation). Similarly, in construing California's statute[18] governing credit for time spent "in custody" prior to commencement of sentence, the court in People v. Rodgers, 79 Cal. App.3d 26, 144 Cal. Rptr. 602, 605 (Cal. App. 1978) observed:
"[I]t is clear that the word `custody' connotes a concept quite different from incarceration or imprisonment. Further enlightenment regarding the plain meaning of `custody' in the context of criminal law may be drawn by analogy to use of that concept in habeas corpus proceedings. Traditionally the writ served the function of releasing a person from actual restraint, and early cases would only consider granting it to one in actual physical detention. Now, of course, the concept of `custody' has been expanded, so that anyone subject to restraints not shared by the `public generally' may be heard to seek the writ, for example, persons free on bail, on their own recognizance, on parole, on probation, and the like." (citations omitted)
The Rodgers court concluded that the defendant was entitled to credit upon his sentence for the time he spent on probation in Delancey Street, a halfway house rehabilitation program, even though the house "is not enclosed by locked fences; the doors are not locked during the day; there are no bars on the windows; there are no armed or unarmed guards." Id. 144 Cal. Rptr. at 604.[19]
The United States Supreme Court has made it clear that one may not be deprived of the protections guaranteed to those incarcerated in a traditional penal institution, simply because confinement is for purposes of "treatment" rather than punishment. McNeil v. Director of Patuxent Institution, 407 U.S. 245, 92 S.Ct. 2083, 32 L.Ed.2d 719 (1972); Jackson v. Indiana, 406 U.S. 715, 92 *545 S.Ct. 1845, 32 L.Ed.2d 435 (1972). That Court established in Jackson that an accused does not forfeit his due process rights when committed to a mental hospital pending a determination of competency to stand trial. In McNeil, the Court concluded that the defendant had been unconstitutionally confined in excess of the sentence imposed by the trial judge, despite the state's assertions that McNeil was being held for "treatment". We too find unconvincing the state's contention that commitment which is not penal in character does not constitute time spent in custody.
We are also unpersuaded by the state's assertion that a probationer cannot be considered "in custody" when he "voluntarily" accepts confinement as a condition of his probation. When faced with the choice between two years probation in a rehabilitation program and a potential sentence of eight years imprisonment, it can hardly be said that Lock voluntarily placed himself in Family House.
In enacting AS 11.05.040 we believe that the legislature intended that credit be given, upon sentencing, for time spent in special facilities and treatment programs.[20] Such an interpretation is consistent with the penal objective of rehabilitation which is expressed in the Alaska Constitution. See State v. Chaney, 477 P.2d 441, 444 (Alaska 1970). The language of AS 11.05.040 is in accord with § 3.6(a) of the American Bar Association's Standards Relating to Sentencing Alternatives and Procedures (Approved Draft, 1971),[21] which proposes that credit be given "for time spent in custody ... pending sentence." The commentary to this section states that it "is designed to assure that credit is awarded in instances where special treatment is imposed as a result of the conduct which underlies the criminal charge." Commentary (b) at 192.[22] Concerning another section of the ABA Standards, relating to commitment to special facilities and treatment programs as part of the sentencing process, the commentators note: "Credit should likewise be given against any prison term which is served after specified treatment has been provided. Credit in [this] context[s] would be required by section 3.6." American Bar Association Standards Relating to Sentencing Alternatives and Procedures, § 2.6, comment (b) at 115.
We conclude that upon revocation of probation, one is entitled to credit against his sentence on the original offense for time spent as a condition of probation, in a rehabilitation program which imposes substantial restrictions on one's freedom of movement and behavior. In the case at bar, there is no evidence on the record regarding the requirements of the Family House and Akeela House programs or the restrictions actually imposed on Lock while participating in those programs. While *546 placing Lock on probation, however, the sentencing judge described Family House Program as "pretty tough" and "much tougher than ... serving time in jail." In addition, the sentencing judge warned Lock that he would be returned to jail if he did not comply with the program's rules or left the home without permission. These admonishments, coupled with the fact that Lock "escaped" from both Family House and Akeela House and had to be "recaptured," sufficiently establishes that he was subjected to severe restraints on his freedom of movement. Therefore, we conclude that AS 11.05.040(a) compels that Lock be given credit against his sentence for the 207 days spent in Family House and Akeela House.
In reaching our decision, we are aware that denying credit for time in a treatment program would have the desirable effect of encouraging a probationer to complete the program and refrain from violating the terms of his probation. However, this deterrent effect does not outweigh the unfairness of requiring a probationer, because he is considered amenable to rehabilitation, to participate in a treatment program which imposes substantial restraints on his liberty, and then upon a violation of his probation, which may be trivial in nature, imposing a sentence of imprisonment for the original offense, undiminished by the time spent in the treatment program.
Appellant's other contention, that his sentence is excessive, is not persuasive. Lock was sentenced to the maximum term for both offenses for which he was convicted, with both sentences to run consecutively. We have recognized that "maximum sentences generally should not be imposed `without some foundation for characterizing a defendant as the worst type of offender.'" State v. Wortham, 537 P.2d 1117, 1120 (Alaska 1975); Galaktionoff v. State, 486 P.2d 919, 924 (Alaska 1971). Factors to consider in determining whether a defendant fits within this characterization include "prior criminal convictions, age, military records, employment history, drug or alcohol addiction, presentence report evaluations and recommendations, and behavior which has been considered to demonstrate an antisocial nature or dangerous propensities which pose a clear risk to the public." State v. Wortham, 537 P.2d at 1120.
Appellant is 36 years old. He has an extensive history of criminal involvement[23] and anti-social behavior. His work record is sporadic largely because he has been in numerous penal institutions since the age of 16. Lock admits to being an alcoholic, but attempts at treatment have been unsuccessful. Presentence reports and evaluations describe Lock as "anti-social" and a "fairly high risk in terms of committing further criminal acts."
The burglary offense was a breaking and entering of a store near Houston, Alaska. Assorted foodstuffs and other items were taken with a value of approximately $600. Although the amount of the property taken was not substantial, Lock's extensive past history of theft offenses is persuasive in our determination that the maximum sentence is appropriate.
As for the escape conviction, Lock was given the maximum sentence of three years.[24]
*547 By escaping first from jail, then from Family House, and finally from Akeela House, Lock has shown himself to be unamenable to rehabilitation. We cannot find that the maximum sentence was clearly mistaken when the escape conduct was recidivistic and a prior record of significant anti-social behavior had been shown.[25] Further, the superior court did not act incorrectly in having these maximum sentences run consecutive to each other. We have held that "the use of consecutive sentences is particularly appropriate in cases such as this, i.e., where one escapes while incarcerated on another charge." Walton v. State, 568 P.2d 981, 986 (Alaska 1977).
In view of the foregoing facts, we are unable to find that the judge was clearly mistaken in characterizing appellant as the worst type of offender. Nicholas v. State, 477 P.2d 447, 449 (Alaska 1970). Thus we affirm Lock's sentence, but order that the 207 days he spent in Family House and Akeela House be credited against his sentence.
AFFIRMED IN PART, BUT MODIFIED.
NOTES
[1]  The District Attorney agreed to a change in conditions of probation rather than revocation in response to Lock's allegations that he had been deprived of his constitutional rights and mistreated at Family House.
[2]  AS 11.20.100.
[3]  AS 11.30.090.
[4]  United States Constitution, Amendment V, and Alaska Constitution, art. I, sec. 9.
[5]  See Whitton v. State, 479 P.2d 302, 308 (Alaska 1970), in which we quoted with approval the teaching of North Carolina v. Pearce, 395 U.S. 711, 89 S.Ct. 2072, 23 L.Ed.2d 656 (1969), that the double jeopardy clause protects against multiple punishment for the same offense.
[6]  Paul was originally sentenced to a set term of imprisonment under AS 12.55.080 with all but sixty days of the sentence suspended. This sentence, together with his probation time, did not exceed the maximum sentence allowable for the offenses for which he was convicted.
[7]  For a discussion of the various constitutional attacks that have been made against the practice of denying credit for time served on probation and parole see A. Byrd, Constitutional Law  Equal Protection  Federal Statutes Differentiating Between Sentence Credit For Probation and Parole Time Satisfy Rational Basis Test, 31 Vand.L.Rev. 695 (1978); R. Singer and R. Hand, Sentencing Computation: Laws and Practices, 10 Crim.L.Bull. 318 (1974); Note, "A la Recherche du Temps Perdu": The Constitutionality of Denial of Credit on Revocation of Parole, 35 U.Chi.L.Rev. 762 (1968).
[8]  See Thompson v. State, 496 P.2d 651, 656 (Alaska 1972), granting credit for pre-trial detention time served prior to the enactment of AS 11.05.040(a), on "fairness" grounds.
[9]  AS 12.55.080 provides:

"Suspension of sentence and probation. Upon entering a judgment of conviction of a crime, or at any time within 60 days from the date of entry of that judgment of conviction, a court, when satisfied that the ends of justice and the best interest of the public as well as the defendant will be served thereby, may suspend the imposition or execution or balance of the sentence or a portion thereof, and place the defendant on probation for a period and upon the terms and conditions as the court considers best."
[10]  AS 12.55.085(a) provides:

"Suspending imposition of sentence. (a) If it appears that there are circumstances in mitigation of the punishment, or that the ends of justice will be served, the court may, in its discretion, suspend the imposition of sentence and may direct that the suspension continue for a period of time, not exceeding the maximum term of sentence which may be imposed, and upon the terms and conditions which the court determines, and shall place the person on probation, under the charge and supervision of the probation officer of the court during the suspension."
[11]  We see no conflict between AS 12.55.085(c) and AS 11.05.040(a). AS 12.55.085 merely defines the period in which sentencing may be imposed after it has been deferred; it in no sense precludes the granting of credit towards that sentence as required by AS 11.05.040(a). In fact, AS 12.55.085(c) was amended, effective May 2, 1979, to add that the pronouncement of sentence upon revocation of probation is "subject to the limitation specified in AS 12.55.086(c)." AS 12.55.086(c) provides, "If probation is revoked and the defendant is sentenced to imprisonment, [as a special condition of probation pursuant to AS 12.55.086(a)], he shall receive credit for time served under this section."
[12]  People v. Gravlin, 52 Mich. App. 467, 217 N.W.2d 404, 405 (1974) (defendant entitled to credit towards his sentence for time spent in a mental hospital pending competency to stand trial under statute requiring that "time spent in custody ... be credited against any sentence imposed ... .")
[13]  State v. Hersman, 242 S.E.2d 559, 561 (W. Va. 1978) (double jeopardy clause requires that credit be given for time spent in juvenile detention).
[14]  State v. Shaw, 202 Neb. 766, 277 N.W.2d 106, 111 (1979) (defendant entitled to credit for time spent in diagnosis for sociopath proceedings).
[15]  People v. Noble, Sup., 207 N.Y.S.2d 467, 469 (App.Div.2d 1960).
[16]  People v. Rodgers, 79 Cal. App.3d 26, 144 Cal. Rptr. 602, 605 (1978) (time spent in halfway house rehabilitation facility is within statute requiring credit for time spent in custody prior to sentencing). People v. Stange, 91 Mich. App. 596, 283 N.W.2d 806 (1979) (time spent in drug rehabilitation center as condition of probation is within statute requiring credit for time spent in "jail" prior to sentencing).
[17]  People ex rel. Cohalan v. Warden of City Prison, Sup., 96 N.Y.S.2d 749, 750 (S.Ct. 1950).
[18]  California Penal Code § 2900.5(a) provides in relevant part:

"(a) In all felony and misdemeanor convictions, either by plea or by verdict, when the defendant has been in custody, including but not limited to any time spent in a jail, camp, work furlough facility, halfway house, rehabilitation facility, hospital, prison, juvenile detention facility, or similar residential institution, all days of custody of the defendant, including days served as a condition of probation in compliance with a court order, and including days credited to the period of confinement pursuant to Section 4019, shall be credited upon his... term of imprisonment... ."
[19]  The Michigan Court of Appeals recently addressed the identical issue presented here: whether defendant is entitled to credit against his ultimate sentence for time spent in a drug rehabilitation center as a condition of probation. People v. Stange, 91 Mich. 596, 283 N.W.2d 806 (1979). The Stange court concluded that time spent in the center amounted to confinement analagous to "jail" within the meaning of Michigan's statute requiring credit for presentence incarceration.
[20]  The state argues that the reference to time voluntarily absent from a "penitentiary, reformatory, jail, or from the custody of an officer" in the last sentence of AS 11.05.040(a) is meant to define "custody" within the second sentence. We do not agree. The last sentence governs counting time absent from the enumerated facilities after sentencing, while the second sentence refers to time spent "in custody pending trial or sentencing."
[21]  The full text of § 3.6(a) reads:

"(a) Credit against the maximum term and any minimum term should be given to a defendant for all time spent in custody as a result of the criminal charge for which a prison sentence is imposed or as a result of the conduct on which such a charge is based. This should specifically include credit for time spent in custody prior to trial, during trial, pending sentence, pending the resolution of an appeal, and prior to arrival at the institution to which the defendant has been committed."
American Bar Association Project on Standards for Criminal Justice, Standards Relating to Sentencing Alternatives and Procedures, Special Committee on Minimum Standards for the Administration of Criminal Justice (Approved Draft, 1971).
[22]  The same commentary notes that

"[T]he Advisory Committee would agree with the provision in Title I of the Narcotics Rehabilitation Act of 1966 to the effect that credit be given for time spent as the result of a civil commitment for addiction if criminal proceedings based on conduct which led to the commitment are subsequently resumed."
Id. § 3.6 comment (b) at 193.
[23]  These offenses have been largely property crimes or alcohol-related. Convictions include burglary, car theft, accessory after the fact to robbery, fraudulent use of credit cards, numerous traffic violations including several drunk driving charges and several probation violations.
[24]  At the time of Lock's escape, the applicable escape statute, AS 11.30.090(1), provided:

"A person who escapes or attempts to escape from the custody of a peace officer under a lawful arrest or from a jail or institution in which he is detained by a peace officer or confined by direction of a court in this state is punishable:
(1) if the custody of confinement is by an arrest on a charge of a felony, or conviction of a felony, by a fine of not more than $5,000, or by imprisonment for not less than one year nor more than three years, or by both... ."
At present, the maximum is five years. See AS 11.30.095; see also One v. State, 592 P.2d 1193 (Alaska 1979).
[25]  See One v. State, 592 P.2d 1193 (Alaska 1978); Morgan v. State, 582 P.2d 1030 (Alaska 1979).
