
777 P.2d 217 (1989)
Joseph HESTER, Appellant,
v.
STATE of Alaska, Appellee.
No. A-2843.
Court of Appeals of Alaska.
July 28, 1989.
*218 Kurt M. LeDoux, Kodiak, for appellant.
R. Bruce Roberts, Asst. Dist. Atty., Nathan A. Callahan, Dist. Atty., Kodiak, and Douglas B. Baily, Atty. Gen., Juneau, for appellee.
Before BRYNER, C.J., and COATS and SINGLETON, JJ.

OPINION
COATS, Judge.
Joseph Hester pled no contest to driving while intoxicated, AS 28.35.030. Magistrate Anna M. Moran sentenced Hester to sixty days with forty days suspended and imposed a fine of $1,000 with $500 suspended. The court also revoked Hester's license for one year and placed Hester on probation for two years. As one of the conditions of probation, the court ordered that Hester "[c]omply with the recommendations of alcohol screening." In an "Order for Alcohol and Assignment" issued at the time of sentencing, the court more specifically directed that Hester "enroll in and satisfactorily complete a program to be designated by the Kodiak Alcohol Safety Action Program" (Kodiak ASAP). The Kodiak Council on Alcoholism (KCA), the overseer of the Kodiak ASAP, recommended that Hester serve thirty days in the Hope House residential alcohol treatment center. Hester moved to modify his sentence on the ground that the KCA's recommendation constituted an illegal sentence. The court denied Hester's motion and Hester appeals from this ruling. We reverse.
On appeal, Hester argues, as he did below, that the KCA's recommendation of thirty days to serve in the Hope House amounts to an enhancement of his original sentence in contravention of the double jeopardy clause of the Alaska Constitution. See Alaska Const. art. I, § 9. Hester relies on Lock v. State, 609 P.2d 539 (Alaska 1980), to support his argument. In Lock, the Alaska Supreme Court concluded that the defendant was entitled to receive credit against his overall sentence for the time he spent as a condition of probation in two residential rehabilitation programs, Family House and Akeela House. Lock, 609 P.2d at 545. In the court's view, because the defendant was subject to severe restraints on his freedom of movement while a resident in the two programs, he was "in custody" within the meaning of AS 11.05.040(a).[1]Id. at 546. In reaching its decision, the court noted:
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. 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, a juvenile detention center, a diagnostic center, a hospital, a halfway house, and a hotel room.
Id. at 543-44 (citation and footnotes omitted).
We agree with Hester that the Lock decision mandates that Hester's case be remanded for resentencing. Hester's original sentence of sixty days with forty days suspended requires that Hester serve twenty days in confinement. If the KCA's recommendation is followed, Hester's sentence will include twenty days of imprisonment and thirty additional days of custodial confinement at the Hope House, for a total of fifty days of confinement. We recognize *219 that a court may impose conditions of probation which are reasonably related to a person's rehabilitation. Roman v. State, 570 P.2d 1235, 1240 (Alaska 1977). However, where, as here, these conditions severely restrict a defendant's freedom of movement, they shall be regarded as the functional equivalent of imprisonment. See Lock, 609 P.2d at 546.
We have previously held that the court may not delegate its authority to sentence a defendant. See Brezenoff v. State, 658 P.2d 1359, 1363-64 (Alaska App. 1983) (court may not delegate to probation officer authority to make decision regarding the total amount of restitution owed or the terms of payment). It follows that the sentencing court may not delegate its authority to impose conditions of probation which are the functional equivalent of incarceration. Such a holding is consistent with the language found in AS 28.35.030(c), which states:

Operating a vehicle, aircraft or watercraft while intoxicated. (c) Upon conviction under this section... the court shall order, and a person convicted under this section shall undertake, for a term specified by the court, that program of alcohol education or rehabilitation that the court, after consideration of any information compiled under (d) of this section, finds appropriate.

(Emphasis added). The statute specifically provides that the court shall determine both the program of rehabilitation to be completed by the defendant and the period of time the defendant must be enrolled in the program.
Accordingly, we conclude that the KCA's recommendation that Hester serve thirty days in the Hope House residential alcohol treatment center constitutes an illegal sentence. The recommendation resulted from an improper delegation of the court's sentencing authority and, in effect, amounts to an enhancement of Hester's original sentence in contravention of the double jeopardy clause of the Alaska constitution.
The case is REMANDED for resentencing consistent with this decision.[2]
NOTES
[1]  AS 11.05.040(a) provided as follows:

Computation of term of imprisonment and stay. (a) 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.
This statute has been renumbered and amended, but remains substantially the same. See AS 12.55.025(c).
[2]  The state contends this case is not ripe for review by this court because Hester failed to seek review of KCA's recommendation with the sentencing court. The state points out that the court's order, dated July 24, 1987, specifically states the following: "If you object to the recommendations of the alcohol treatment agency, you may request that this court review their recommendations." We reject the state's argument. Hester filed a motion to modify sentence in which he specifically requested the court to overturn KCA's recommendation of thirty days to serve in the Hope House.
