979 F.2d 854
NOTICE: Ninth Circuit Rule 36-3 provides that dispositions other than opinions or orders designated for publication are not precedential and should not be cited except when relevant under the doctrines of law of the case, res judicata, or collateral estoppel.Victor H. ESPINOSA, Respondent-Appellee,v.UNITED STATES of America, Petitioner-Appellant.
No. 91-10549.
United States Court of Appeals, Ninth Circuit.
Submitted Oct. 5, 1992.*Decided Nov. 23, 1992.

Before KILKENNY, GOODWIN and FERGUSON, Circuit Judges.


1
Victor H. Espinoza appeals the district court's denial of his habeas corpus petition1 for credit for time spent in a halfway house prior to serving his sentence for possession with intent to distribute marijuana.   We have jurisdiction pursuant to 28 U.S.C. § 1291, and we reverse.


2
A district court's decision to deny a habeas corpus petition is reviewed  de novo.   Tripati v. Henman, 843 F.2d 1160, 1162 (9th Cir.), cert. denied, 488 U.S. 982 (1988).


3
Victor Espinosa was charged with possession with intent to distribute over 100 kilograms of marijuana, in violation of 21 U.S.C. §§ 841(a)(1) and 841(b)(1)(B)(vii).   On January 16, 1990, as a condition of release while his case was pending, Espinosa was ordered to reside at Behavioral Systems Southwest Community Center ("Behavioral Systems") in Phoenix, Arizona, and to participate in substance abuse counseling and submit to urinalysis testing.   Espinosa pleaded guilty in March 1990 and was sentenced in May 1990.   Espinosa spent more than seven months in Behavioral Systems before being imprisoned on September 4, 1990.


4
Espinosa contends that he should be granted credit against his sentence for the time spent in Behavioral Systems.   We agree.  "A defendant shall be given credit toward the service of a term of imprisonment for any time he has spent in official detention prior to the date the sentence commences...."  18 U.S.C. § 3585(b).   A person is in official detention when conditions of release approach incarceration.   Mills v. Taylor, 967 F.2d 1397, 1400 (9th Cir.1992).   We have held that "confinement to a treatment center 'fall[s] convincingly within both the plain meaning and the obvious intent' of 'official detention' as it is used in section 3585."   Id. at 1401 (quoting  Brown v. Rison, 895 F.2d 533, 536 (9th Cir.1990)).   The conditions of Espinosa's release approached incarceration,  see Brown, 895 F.2d at 536, and the district court erred in denying Espinosa credit for time served while detained at Behavioral Systems.   The district court's denial of Espinosa's habeas corpus petition is REVERSED, and we remand for resentencing consistent with this memorandum disposition.



*
 This panel unanimously agrees that this case is appropriate for submission without oral argument.   Fed.R.App.P. 34(a) and 9th Cir.R. 34-4


**
 This disposition is not appropriate for publication and may not be cited to or by the courts of this circuit except as provided by 9th Cir.R. 36-3


1
 Although the district court accepted Espinosa's motion as a motion to correct a sentence pursuant to 28 U.S.C. § 2255, a claim for credit for time spent in official detention prior to sentencing is a challenge to the manner of execution, rather than the legality, of a sentence.   See Doganiere v. United States, 914 F.2d 165, 169 (9th Cir.1990), cert. denied, 111 S.Ct. 1398 (1991).   A challenge to the manner of execution of a sentence is properly brought under 28 U.S.C. § 2241.   United States v. Giddings, 740 F.2d 770, 772 (9th Cir.1984).   Accordingly, we construe Espinosa's motion as a habeas corpus petition pursuant to 28 U.S.C. § 2241


