OPINION
KLEINSCHMIDT, Judge.The issue in this case is whether time spent in a drug rehabilitation program as a condition of probation is time spent “in custody” within the meaning of the statute which mandates credit against a sentence of imprisonment for presentence incarceration. We hold that when a defendant is *581confined in such a program under conditions which the trial court finds are as onerous and as restrictive on movement and conduct as those a defendant would experience if he were in jail, a defendant is entitled to credit for such time if he is later sentenced to imprisonment.
FACTS
The defendant pled guilty to attempted sale of narcotic drugs and was placed on probation for five years. He violated probation and was reinstated on intensive probation. He violated probation again and was again reinstated on intensive probation on condition that he participate in the New Arizona Family, a residential drug treatment program. The defendant again violated probation by failing to successfully complete the drug rehabilitation program. He admitted his failure and probation was revoked. He was sentenced to a mitigated term of imprisonment of 3.75 years. His request that he receive credit against his sentence for the 297 days that he spent in the New Arizona Family was denied. It is from this denial that he appeals.
At the disposition hearing at which the defendant was sentenced to prison, he and a drug counselor described the regimen that participants in the New Arizona Family were required to follow. The defendant was required to rise daily at 6:00 a.m. to attend to his personal grooming and clean his room. At 7:00 a.m., he attended roll call and a half hour later ate breakfast. From 8:00 to 9:00 a.m., Monday through Saturday, the defendant was required to help clean the facility compound. From 9:20 to 10:00 a.m., he attended a meeting at which matters of concern to the program were discussed. From 10:30 until 11:30 a.m., the defendant attended a group drug counseling session.
Lunch was scheduled from noon to 1:00 p.m., and the defendant then, on Tuesdays, attended a counseling session from 1:30 to 3:30 p.m. On Fridays, he attended small group sessions during this period and at other times attended individual counseling sessions.
Each day at 6:00 p.m., a general meeting of residents lasted from one to two hours. This was followed by yet another group meeting. The defendant had free time between 9:00 and 10:00 p.m., when he was required to go to bed.
During the periods between these activities, the defendant had work assignments, such as kitchen duty. He was also required to read and report on books on drug abuse and to study for his general equivalency diploma.
For the first thirty days of the program, the defendant was not allowed any contact with people outside the New Arizona Family. The only outside contacts allowed thereafter were for such things as doctor’s appointments and court appearances. Contact with his own family members was minimal.
The defendant, who had considerable experience with incarceration, testified that his time spent in the rehabilitation program was much more difficult than jail. The trial judge apparently accepted this assessment but nevertheless denied the request for credit. She said:
And, I do not find any current case law in the State of Arizona which would ... support giving you credit for that time in the New Arizona Family, even though I agree it probably was tougher and stricter in many ways than your county jail time was.
THE DEFENDANT IS ENTITLED TO CREDIT
We acknowledge at the outset that there is Arizona case law at odds with our conclusion, and there is a split of authority among other jurisdictions on this issue. We first discuss the reasons for our decision before turning our attention to the contrary authority.
The question turns on the construction to be placed on A.R.S. section 13-709(B). That statute provides:
All time actually spent in custody pursuant to an offense until a prisoner is sentenced to imprisonment for such offense shall be credited against the term of im*582prisonment otherwise provided for by this chapter.
We must, if possible, determine what the legislature intended when it enacted this statute. Presumably, one of the legislature’s purposes in enacting the statute was to afford equal protection of the law to those who must remain in jail pending trial because they are unable to post bond. See State v. Gray, 122 Ariz. 445, 449, 595 P.2d 990, 994 (1979); State v. Mathieu, 165 Ariz. 20, 795 P.2d 1303 (App.1990). Too, an argument has been made that proscriptions against double punishment mandate such credit. See Sentencing—Granting Credit For Time Served, 13 Ariz.L.Rev. 402, 408-9 (1971). Most important, we assume that the animus for the statute was simple fairness. We see nothing in the wording of the statute itself that throws much light on what the legislature might have intended regarding time spent in a program like the New Arizona Family. We look then to common sense, reason, and fairness as we perceive these qualities to bear on the question.
We conclude that because the defendant was in custody pursuant to court order, compelled to live under conditions that were as confining and restrictive as those he would have been subjected to in jail, he ought to receive credit for that time against his sentence. We find nothing that would suggest the legislature intended otherwise. The dissent observes that when the legislature has intended a defendant to receive credit for time spent in custody in various circumstances, it has enacted appropriate legislation to effect that purpose. This is not to say, however, that the legislature has foreseen every circumstance that should properly give rise to credit for presentence incarceration.
Our decision is supported by authority from other jurisdictions. For example, in Lock v. State, 609 P.2d 539 (Alaska 1980), the Supreme Court of Alaska decided a case identical to this one in all important respects. The Alaska statute, section 11.-05.040(a), provided in part:
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.
Lock, 609 P.2d at 542.
In Lock, the defendant had, as a condition of probation, been ordered to participate in two different residential rehabilitation programs. When his probation was revoked, the trial judge refused to allow him credit on his sentence for the time he had spent in those programs. The Supreme Court of Alaska reversed, saying:
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).
Lock, 609 P.2d at 543.
The court then went on to list examples of how confinement in institutions like mental hospitals and halfway houses has been construed as time spent “in custody” for purposes of credit towards a sentence and said:
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.
Id. at 545.
For cases which reach similar conclusions, see People v. Stange, 91 Mich.App. 596, 283 N.W.2d 806 (1979); Commonwealth v. Usher, 264 Pa.Super. 435, 399 A.2d 1129 (1979). For a review of the cases on both sides of the question, see Annot., 24 A.L.R. 4th 789 (1983).
CONTRARY AUTHORITY
The only Arizona case directly on point is against the defendant. In State v. Vasquez, 153 Ariz. 320, 736 P.2d 803 (App. 1987), Division Two of this court held that time spent in Amity House, a residential *583treatment facility, was not spent “in custody” within the meaning of A.R.S. section 13-709(B). The court compared that statute with A.R.S. section 13-903CE),1 which requires that defendants who have been incarcerated in a jail as a condition of probation shall receive credit for such incarceration against a sentence imposed later. It rejected the suggestion that the statutes were ambiguous and concluded that time spent “in custody” meant time spent in the actual or constructive control of jail or prison officials. In so doing, the court considered the earlier decision of the Arizona Supreme Court in Green v. Superior Court, 132 Ariz. 468, 647 P.2d 166 (1982), which held that credit must be allowed for time a defendant spends on work furlough or authorized release if the defendant is in such status while serving a jail sentence. In citing Green, Division Two stressed that in such a circumstance, the person on work furlough or authorized release was still under the control of jail officials.
The appellate court went on to say, citing á Florida decision, that there is a “key conceptual difference” between structured rehabilitation and incarceration and added that it believed that denying credit for time spent in a rehabilitative program will encourage probationers to abide by the rules of the program and adhere to the terms of probation. Vasquez, 153 Ariz. at 322, 736 P.2d at 805.
Another recent Arizona case from this court, which is also against the defendant’s position, bears on the question. In State v. Cereceres, 166 Ariz. 14, 800 P.2d 1 (App. 1990), the issue was whether the defendant was entitled to credit for presentence incarceration for the day he spent in police custody on the day of his arrest before he was booked into the county jail. The court concluded that he was not entitled to credit for that day because time spent pursuant to arrest was not time “in custody.” In its analysis, the court noted that A.R.S. section 13-709(B) is located in the chapter on the penal code relating to sentencing, stating:
The word ‘custody’ thus appears in the context of serving a sentence of imprisonment. Its effect is to reduce the sentence a defendant ultimately receives by the length of time he has already been incarcerated for. the offense. Accordingly, we can reasonably infer that the legislature intended that custody, for purposes of A.R.S. § 13-709(B), be equated with incarceration in a jail or prison and not merely with the substantial restraint of freedom which is commensurate with an arrest or detention.
Id. at 15, 800 P.2d at 2.
The court then drew support for its conclusion based on legislative history. Finally, the court agreed with the state, which had relied on Vasquez, to reach its conclusion.
We do not agree with the result that Division Two reached in Vasquez or that this court reached in Cereceres. Vasquez turns on whether a defendant is in the custody of the jail or prison authorities. We think it more logical and more fair to ask: By what authority and under what conditions was the defendant confined? How restricted were his movements? How controlled was his behavior? If the answer to these questions is that the defendant was confined by state authority under conditions as onerous, as restricted in movement, and as controlled in behavior as would have applied if he were actually in a jail or prison, he ought to receive credit for time spent in that manner.
In our opinion, Cereceres does not give enough weight to the fact that the defendant in that case actually did spend time on the day of his arrest in police custody. While we recognize, as did the panel that decided Cereceres, that the term “in custody” is susceptible of semantic manipulation, we simply think that the policy behind A.R.S. section 13-709(B) militates strongly against the Cereceres result.
Some courts in other jurisdictions have also come to a result different from ours. See Pennington v. State, 398 So.2d 815 (Fla. 1981); State v. Babcock, 226 Kan. 356, *584597 P.2d 1117 (1979); State v. Smeen, 147 N.J.Super. 229, 371 A.2d 93 (1977); Poole v. Koehler, 160 A.D.2d 880, 554 N.Y.S.2d 312 (1990); Hughes v. Powers, 453 N.W.2d 608 (N.D.1990); State v. Lohnes, 266 N.W.2d 109 (S.D.1978).
In several of those cases, Poole and Hughes, for example, the courts treated the matter summarily. In Pennington and Babcock, the statutes construed allowed credit only for time spent in jail. In Lohnes, the court looked to a statute that provided that when a juvenile offender was returned to court for violating an order of commitment after having been committed to the state training school, proceedings “shall be resumed as if no warrant or order committing him or her to the training school had been made.”
In Smeen, the court concluded that the defendant should not receive credit for time spent in a drug treatment center where he was at liberty by an exercise of his own will to leave that facility. Here, we assume that it is true that the defendant could have walked off the premises of the New Arizona Family whenever he chose to violate the terms of his probation. This is no different from the situation of a defendant who is always free not to return from work furlough, a status that earns credit against a sentence which may be imposed later. See Green, 132 Ariz. 468, 647 P.2d 166. In any event, the relevant point is that the defendant should get credit for the time he actually spent in a program that, pursuant to court order, severely restricted his movement and controlled his behavior, even if he did not complete the program.
We realize that trial judges will have to decide on a case-by-case basis whether to credit time based upon a knowledge of various programs to which defendants are committed. In view of the relatively few programs available, we doubt that this will cause much practical difficulty. It may be helpful to observe that, in our opinion, confinement to one’s own home as a condition of probation would not qualify a defendant for presentence incarceration credit. See People v. Ramos, 138 Ill.2d 152, 149 Ill. Dec. 273, 561 N.E.2d 643 (1990) (credit for presentence confinement to one’s own home is impermissible because home confinement is less onerous than institutional confinement). Finally, we are aware that a refusal to allow credit for time spent in a treatment program like the New Arizona Family may, to some degree, encourage completion of the program. We are also aware that a person who leaves such a program without permission is arguably subject to a charge of escape. We have weighed these factors in arriving at our decision. The other problems the dissent sees in the administration of the rule we adopt are matters that can be resolved as they arise.
This court has, pursuant to A.R.S. section 13-4035, fully reviewed the record for fundamental error. After reviewing the record we find that no reversible error was committed in these proceedings.
The order of the trial court denying the defendant credit for time spent in the New Arizona Family is vacated.
. Now section 13-903(F).