                  FOR PUBLICATION
  UNITED STATES COURT OF APPEALS
       FOR THE NINTH CIRCUIT

AMADOU LAMINE DIOUF,                   
             Petitioner-Appellee,
                                            No. 07-55337
              v.
                                             D.C. No.
MICHAEL B. MUKASEY, Attorney               CV-06-07452-TJH
General,
           Respondent-Appellant.
                                       

AMADOU LAMINE DIOUF,                   
                Petitioner-Appellee,
                 v.
MICHAEL B. MUKASEY, Attorney
General; MICHAEL CHERTOFF,
Secretary, Department of
Homeland Security; JULIE L.                  No. 08-55504
MYERS, Assistant Secretary, United
                                               D.C. No.
States Immigration and Customs
Enforcement; NORMA BONALES-                2:06-cv-07452-
GARIBAY Field Officer Director,               TJH-FMO
U.S. Immigration and Customs                   OPINION
Enforcement; GEORGE MOLINAR,
Chief of Detention and Removal
Operations, San Pedro Detention
Facility; STUART CORTEZ Officer-
in-Charge, San Pedro Detention
Facility,
            Respondents-Appellants.
                                       
        Appeal from the United States District Court
           for the Central District of California
         Terry J. Hatter, District Judge, Presiding

                            13195
13196                 DIOUF v. MUKASEY
                   Argued and Submitted
           January 7, 2008—Pasadena, California

                  Filed September 18, 2008

        Before: Jerome Farris, Raymond C. Fisher, and
             Milan D. Smith, Jr., Circuit Judges.

            Opinion by Judge Milan D. Smith, Jr.
                       DIOUF v. MUKASEY                   13199


                         COUNSEL

Gjon Juncaj, U.S. Department of Justice, Civil Division,
Office of Immigration Litigation, Washington, D.C.; Thomas
H. Dupree, Jr., U.S. Department of Justice, Washington, D.C.,
for the respondents-appellants.

Cecillia D. Wang, ACLU Foundation, Immigrants’ Rights
Project, San Francisco, California; Ahilan T. Arulanantham,
ACLU Foundation of Southern California, Los Angeles, Cali-
fornia, for the petitioner-appellee.


                          OPINION

MILAN D. SMITH, JR., Circuit Judge:

   This consolidated appeal addresses whether the length of an
alien’s detention under the Immigration and Nationality Act
(INA), 8 U.S.C. § 1101 et seq., entitled him to the writ of
habeas corpus under 28 U.S.C. § 2241 and Zadvydas v. Davis,
533 U.S. 678 (2001). The appeal also addresses whether the
district court abused its discretion by preliminarily enjoining
an Immigration Judge (IJ) to conduct a bond hearing for the
alien, who at the time was in his twenty-third month of deten-
tion and awaiting judicial review of an order denying his
request to reopen his removal proceedings. We hold that the
district court erred by granting the writ of habeas corpus
because the alien’s detention was not “indefinite,” and that the
13200                    DIOUF v. MUKASEY
preliminary injunction constituted an abuse of discretion
because it was issued on the erroneous premise that the deten-
tion was governed by § 236 of the INA, 8 U.S.C. § 1226,
rather than § 241, 8 U.S.C. § 1231. We therefore reverse the
grant of habeas relief, and vacate and remand with respect to
the preliminary injunction.

      FACTUAL AND PROCEDURAL BACKGROUND

   Petitioner-Appellee Amadou Lamine Diouf was admitted to
the United States in 1996 on an F-1 non-immigrant student
visa. The visa expired in June 2002. In December 2002, Diouf
was found in possession of less than 30 grams of marijuana
and charged with a misdemeanor under Revised Code of
Washington § 69.50.401(e) (2002). Diouf pleaded guilty the
following month.

   The Government initiated removal proceedings against
Diouf in January 2003, alleging that he was removable
because he had (1) remained in the United States after the
expiration of his student visa in violation of 8 U.S.C.
§ 1227(a)(1)(B), (2) failed to maintain non-immigrant status
in violation of § 1227(a)(1)(C)(i), and (3) committed a
controlled-substance offense in violation of § 1227(a)(2)
(B)(i). The IJ determined that Diouf was subject to removal
due to these charges. However, at Diouf’s request, the IJ
ordered in lieu of removal that Diouf voluntarily depart from
the United States by June 24, 2003. The IJ further ordered that
Diouf would be removed to Senegal if he did not depart vol-
untarily by the specified date. Diouf waived appeal and posted
bond on March 3, 2003.

   Following his release, Diouf retained counsel to reopen the
removal proceedings and adjust his status from non-
immigrant alien to lawful permanent resident on the basis of
his planned marriage to Marie Campbell,1 a United States citi-
  1
   The INA provides that an alien spouse of a United States citizen may
acquire the status of lawful permanent resident. 8 U.S.C.
                           DIOUF v. MUKASEY                         13201
zen to whom Diouf had become engaged in 2002. Diouf and
Campbell married on June 17, 2003. The deadline for Diouf’s
voluntary departure passed one week later. On June 27,
Campbell filed an I-130 petition in light of their recent mar-
riage. Although counsel also prepared a motion to reopen the
removal proceedings and a request for an extension of the vol-
untary departure period, he did not file those documents at
that time.

   Upon learning that Diouf remained in the country after the
June 24 departure deadline, Immigration and Customs
Enforcement (ICE) sent a notice requiring him to present him-
self for removal on September 4, 2003. Diouf failed to report
as instructed, so ICE cancelled his bond, apprehended him at
his home on March 29, 2005, and detained him pending exe-
cution of the removal order. ICE made arrangements for
Diouf to depart for Senegal on May 26, 2005, but, after Diouf
refused to leave on that date, continued to detain him. ICE
warned Diouf on July 20, 2005, that he would be fined or
imprisoned for up to four years under 8 U.S.C. § 1253(a) if
he continued to refuse to depart.

   Diouf subsequently undertook a series of legal maneuvers
to prevent his removal. On May 31, 2005, he filed a motion
to reopen the case before the IJ in light of his pending I-130
petition. On June 28, the IJ denied the motion as untimely.
Diouf did not appeal.

   After obtaining new counsel, Diouf filed a second motion
to reopen in September 2005, this time arguing that his first
attorney had provided ineffective assistance by (1) failing to

§ 1151(b)(2)(A)(i). For the change in status to occur, the citizen spouse
must file a Form I-130 Petition for Alien Relative pursuant to 8 U.S.C.
§ 1154(a)(1)(A)(i), see 8 C.F.R. § 204.1(a)(1), and the alien spouse must
file a Form I-485 application for adjustment of status pursuant to 8 U.S.C.
§ 1255. See Freeman v. Gonzales, 444 F.3d 1031, 1040 (9th Cir. 2006)
(describing this procedure).
13202                  DIOUF v. MUKASEY
timely file a motion to reopen after the marriage, (2) failing
to seek an extension of the voluntary departure date, and (3)
failing to appeal the grant of voluntary departure. The IJ
denied the motion on September 7, 2005, because it was not
accompanied by a certificate of service.

  Diouf refiled the second motion to reopen on December 8,
2005. The IJ denied the motion on the grounds that it was
untimely and that Diouf was ineligible for a status adjustment.
Diouf requested a stay of removal pending appeal, but the
Board of Immigration Appeals (BIA) denied that request on
May 26, 2006.

   Two months later, the BIA affirmed the IJ, holding that the
motions to reopen were untimely and that the ineffective
assistance claims lacked merit. With regard to the first claim,
the BIA found that Diouf’s original counsel could not have
timely filed a motion to reopen in connection with the appli-
cation for adjustment of status because the filing deadline
occurred approximately three weeks before Diouf married
Campbell, and the marriage was the only asserted justification
for the adjustment. The BIA then found that the attorney’s
failure to request an extension of the voluntary departure
deadline was harmless because the IJ had already granted
Diouf the maximum period allowed for voluntary departure.
The BIA also found that the attorney’s decision not to appeal
the grant of voluntary departure was reasonable because
Diouf had expressly waived the appeal.

   On May 5, 2006, Diouf filed a pro se appeal of the IJ’s
original voluntary departure order. On June 8, 2006, the BIA
dismissed the appeal as untimely.

   While seeking relief before the IJ and BIA, Diouf also filed
a series of petitions with this court. On June 1, 2005, he filed
a pro se petition for review and a motion to stay his removal
pursuant to General Order 6.4(c). See Dkt. No. 05-73252. We
granted a temporary stay and on June 16, 2005, ordered Diouf
                       DIOUF v. MUKASEY                   13203
to submit a copy of the BIA order that he sought to challenge.
Diouf subsequently filed a petition to proceed in forma
pauperis and obtain counsel, but failed to provide a copy of
a reviewable BIA order. We therefore dismissed the petition
for lack of jurisdiction on August 9, 2005, issuing the man-
date on August 31, and lifting the temporary stay.

   On August 29, 2005, Diouf filed a second pro se petition
for review and another motion for a stay of removal. See Dkt.
No. 05-75026. We again entered a temporary stay and on Sep-
tember 19, 2005, ordered Diouf to pay a filing fee and provide
either a correct alien identification number or a copy of the
BIA order he sought to challenge. Diouf did not comply with
this order, so we issued another order on November 4, 2005,
directing him either to comply with the requirements of the
September 19 order or show cause why the petition should not
be dismissed for lack of jurisdiction. Diouf filed a response on
December 5, 2005. On January 31, 2006, we found that the
petition was not a timely challenge to a final order of removal,
and dismissed for lack of jurisdiction. We subsequently
granted a request from Diouf for an extension of time to file
a motion to reconsider, but Diouf ultimately did not file the
motion. The mandate issued on May 1, 2006, and the stay
lifted. Diouf filed a motion to reopen on May 4, but we con-
strued the motion as one for reconsideration and denied it as
untimely on May 22.

   Diouf filed a third pro se petition for review and motion for
stay of removal on February 7, 2006. See Dkt. No. 06-70731.
We entered another temporary stay on March 10, 2006, and
again directed Diouf to pay the filing fee and provide either
a correct alien identification number or a copy of the BIA
order he sought to challenge. Diouf did not respond. On April
5, we dismissed the petition for failure to prosecute, and the
stay lifted.

   Diouf filed a fourth pro se petition for review and request
for a stay of removal eight days later. See Dkt. No. 06-71922.
13204                   DIOUF v. MUKASEY
We again entered a temporary stay and ordered Diouf to pro-
vide his alien identification number and a copy of the BIA
order he sought to challenge. Diouf complied with this order
on May 15, 2006, clarifying that his petition challenged the
BIA’s July 2006 denial of his motions to reopen. We granted
the motion for a stay of removal on July 21, 2006, and
appointed pro bono counsel to represent Diouf on January 17,
2007. The case remains pending before another panel of this
court.

   Diouf filed a fifth and final pro se petition on August 15,
2006, again seeking review of the BIA’s July 2006 denial of
the motions to reopen. See Dkt. No. 06-73991. This petition
was consolidated with Diouf’s fourth petition on October 16,
2006, and remains pending before the other panel. See id.

   Diouf remained in detention while he pursued relief before
the IJ, BIA, and this court. To determine whether the deten-
tion remained justified, ICE conducted a post-order custody
review pursuant to 8 C.F.R. § 241.4 on July 25, 2006.2 ICE
determined that Diouf should remain in custody pending
removal because his “criminal history and lack of family sup-
port” suggest he might flee if released. The detention there-
fore continued.

   On November 21, 2006, Diouf filed a petition for the writ
of habeas corpus in the district court. He requested that the
court enter a preliminary injunction for immediate release on
the grounds that his lengthy detention violates § 236(a) of the
INA, 8 U.S.C. § 1226(a), and the Due Process Clause of the
Fifth Amendment. As an alternative to immediate release,
Diouf requested a preliminary injunction ordering the IJ to
hold a hearing at which the Government would have the bur-
den of justifying the detention.
  2
   The record does not support the Government’s contention that Diouf
also received a post-order custody review on July 21, 2005.
                      DIOUF v. MUKASEY                   13205
   The district court entered the following preliminary injunc-
tion on January 4, 2007:

    Petitioner must be within thirty days afforded an
    individual hearing before an immigration judge con-
    cerning whether his prolonged detention is justified.
    At the hearing, the immigration judge shall order
    Petitioner released on reasonable conditions unless
    the government shows by clear and convincing evi-
    dence that Petitioner presents a sufficient danger or
    risk of flight to justify his detention in light of how
    long he has been detained already and the likelihood
    of his case being finally resolved in favor of the gov-
    ernment in the reasonably foreseeable future.

Pursuant to the injunction, the IJ conducted a hearing on Feb-
ruary 9, 2007, to determine whether Diouf’s prolonged deten-
tion remained justified. The IJ held, after receiving evidence
from both sides, that Diouf did not present a sufficient danger
to the community or risk of flight to justify the detention,
which by then had extended over twenty-two months. The IJ
accordingly released Diouf on bond the same day. The Gov-
ernment appeals the district court’s preliminary injunction.

   While the Government’s appeal of the preliminary injunc-
tion was pending before this panel, a magistrate judge issued
a report and recommendation concerning Diouf’s petition for
habeas corpus under 28 U.S.C. § 2241. The magistrate judge
recommended that the district court grant the petition because
the length of Diouf’s detention violates 8 U.S.C. § 1226(a).
The district court adopted this recommendation on February
6, 2008, granted the petition, and ordered Diouf released on
the conditions previously imposed by the IJ. The Government
also appeals this decision. We consolidated this appeal with
the Government’s earlier appeal of the preliminary injunction,
and now address them both.
13206                  DIOUF v. MUKASEY
   JURISDICTION AND STANDARD OF REVIEW

   We have jurisdiction over the appeal of the preliminary
injunction pursuant to 28 U.S.C. § 1292(a)(1), and over the
appeal of the grant of the writ of habeas corpus pursuant to
28 U.S.C. § 2253(a). The entry of the preliminary injunction
is reviewed for an abuse of discretion, Earth Island Inst. v.
U.S. Forest Serv., 442 F.3d 1147, 1156 (9th Cir. 2006), and
the grant of habeas relief is reviewed de novo, Bowen v.
Hood, 202 F.3d 1211, 1218 (9th Cir. 2000).

                        DISCUSSION

                               I.

   The first step in evaluating the Government’s appeals is to
determine whether Diouf was detained under § 236 or § 241
of the INA, 8 U.S.C. §§ 1226 and 1231, at the time the district
court entered the preliminary injunction and granted habeas
relief. As we recently explained in Prieto-Romero v. Clark,
534 F.3d 1053 (9th Cir. 2008), these statutes apply at different
stages of an alien’s detention. Section 1226(a) provides the
Attorney General with discretionary authority to release aliens
on bond or conditional parole prior to the removal period. See
id. at 1059-60. Section 1231(a)(2), by contrast, mandates
detention “during” the removal period established in
§ 1231(a)(1). Id. at 1059. Lastly, § 1231(a)(6) provides the
Attorney General with discretionary authority to detain cer-
tain classes of aliens “beyond” the removal period, or to
release them subject to the terms of supervision in
§ 1231(a)(3). Id.; see also Zadvydas v. Davis, 533 U.S. 678,
683 (2001) (describing these differences); Casas-Castrillon v.
Dep’t of Homeland Sec., ___ F.3d ___, 2008 WL 2902026, at
*2 (9th Cir. July 25, 2008) (same).

   The Government argues that the district court abused its
discretion by entering the preliminary injunction and granting
habeas relief on the erroneous premise that Diouf was at the
                           DIOUF v. MUKASEY                         13207
time being detained prior to the removal period and, thus,
under § 1226(a). Specifically, the Government contends that
Diouf was being detained under § 1231(a)(2) because (1)
Diouf’s order of removal became administratively final on
June 25, 2003, when he failed to depart within the voluntary
departure period, (2) the administrative finalization of the
order of removal initiated the 90-day removal period of
§ 1231(a)(1)(A), and (3) Diouf’s filing of multiple unsuccess-
ful petitions for review with this court extended the removal
period pursuant to § 1231(a)(1)(C)3 to mandate the entire por-
tion of the detention that followed the first 90 days. Diouf
argues in response that he was being detained prior to the
removal period, and thus under § 1226, because he had a peti-
tion for review pending before this court and a judicial stay
of removal in place when the district court granted injunctive
and habeas relief. He claims that § 1231 did not apply because
§ 1231(a)(1)(B)(ii) dictates that his removal period begins
only once this court enters a final order on his pending peti-
tions for review—an event that has not yet occurred. For the
reasons set forth below, we hold that Diouf was being
detained under § 1231(a)(6) when the district court granted
the writ of habeas corpus, and when it entered the preliminary
injunction.

                                    A.

   [1] We begin by noting that Diouf’s order of removal is
administratively final. Because the IJ issued an alternate order
of removal in connection with the grant of voluntary depar-
ture, and Diouf did not timely appeal to the BIA, Diouf’s
order of removal became administratively final “upon over-
  3
   This statute provides: “The removal period shall be extended beyond
a period of 90 days and the alien may remain in detention during such
extended period if the alien fails or refuses to make timely application in
good faith for travel or other documents necessary to the alien’s departure
or conspires or acts to prevent the alien’s removal subject to an order of
removal.” 8 U.S.C. § 1231(a)(1)(C).
13208                  DIOUF v. MUKASEY
stay of the voluntary departure period.” 8 C.F.R. § 1241.1(f).
Diouf’s voluntary departure period ended on June 24, 2003.
Thus, the order of removal became administratively final on
June 25, the first day of his overstay.

                              B.

   [2] We further conclude that Diouf’s detention was autho-
rized under § 1231, rather than § 1226. Section 1231(a)(1)(B)
provides that the removal period begins on the latest of the
following:

    (i) The date the order of removal becomes admin-
    istratively final.

    (ii) If the removal order is judicially reviewed and if
    a court orders a stay of the removal of the alien, the
    date of the court’s final order.

    (iii) If the alien is detained or confined (except under
    an immigration process), the date the alien is
    released from detention or confinement.

Diouf’s removal period thus began on June 25, 2003—the
date his removal order became administratively final—unless
§§ 1231(a)(1)(B)(ii) or (iii) dictate a later date. See 8 U.S.C.
§ 1231(a)(1)(B)(i). We hold that neither of them does. Section
1231(a)(1)(B)(ii) is inapplicable because, although Diouf’s
appeals to this court resulted in several stays of removal,
those appeals did not entail judicial review of a removal
order, as the plain text of the statute requires. Diouf never
identified the order he sought to challenge in his first three
appeals, and the fourth and fifth appeals challenged only the
BIA’s July 2006 denial of his motions to reopen. Diouf does
not contend that § 1231(a)(1)(B)(iii) applies. Accordingly,
Diouf’s removal period began on June 25, 2003, pursuant to
§ 1231(a)(1)(B)(i).
                       DIOUF v. MUKASEY                    13209
   Our recent decisions in Prieto-Romero and Casas-
Castrillon support this conclusion. In Prieto-Romero, the peti-
tioner had obtained a stay of removal from this court in an
appeal that both remained pending and challenged the BIA’s
affirmance of his removal order. 534 F.3d at 1057. We held
in part that the petitioner was detained under § 1226(a), rather
than § 1231, because § 1231(a)(1)(B)(ii) dictated that the
removal period had not commenced. See id. at 1059-61. How-
ever, we made clear that the statutory basis for the petitioner’s
detention would have been different if the pending petition for
review had not challenged an administratively final order of
removal, explaining that the “beginning of the removal period
is not delayed by every judicially entered stay,” id. at 1060 n.6
(emphasis in original), and that the “entry of a stay of removal
for any . . . reason [other than review of a removal order]—for
example, a stay entered while a court reviews an alien’s
§ 2241 habeas petition or petition for review of the BIA’s
denial of a motion to reopen—does not prevent the removal
period from beginning,” id. (emphasis added). Casas-
Castrillon followed this construction of § 1231(a)(1)(B)(ii).
See 2008 WL 2902026, at *3 (holding that the petitioner was
detained under § 1226 rather than § 1231 at the time he filed
his habeas petition because he had obtained a stay of removal
and was awaiting judicial review of his petition for review of
a final order of removal).

                               C.

   Having determined that Diouf’s removal period began on
June 25, 2003, we now locate within § 1231(a) the specific
basis for Diouf’s detention on January 4, 2007, the date of the
preliminary injunction, and on February 6, 2008, the date of
the grant of habeas relief.

   [3] Unsurprisingly, the rather lengthy procedural history of
this case does not present a straightforward application of
§ 1231(a). The standard removal period should have ended on
September 23, 2003—90 days after Diouf’s order of removal
13210                      DIOUF v. MUKASEY
became final. See 8 U.S.C. § 1231(a)(1). ICE attempted to
ensure Diouf’s removal within this period by instructing him
to appear for deportation on September 4, 2003. Diouf, how-
ever, refused to cooperate, and ICE was unable to apprehend
him until March 29, 2005. Diouf again refused to leave the
United States on May 26, 2005. His refusal to depart contin-
ued until at least July 20, when ICE warned him that such
conduct could result in fines and imprisonment. We conclude
that by frustrating ICE’s efforts to effect removal in this man-
ner, Diouf “conspire[d] or act[ed] to prevent [his] removal,”
and thereby extended his removal period. Id. § 1231(a)(1)(C).
Similar acts of obstruction have previously warranted exten-
sions. See Lema v. INS, 341 F.3d 853, 856 (9th Cir. 2003)
(alien refused to “cooperate fully and honestly with officials
to secure travel documents”); Pelich v. INS, 329 F.3d 1057,
1059 (9th Cir. 2003) (alien refused to fill out a passport appli-
cation).

   [4] Given that § 1231(a)(1)(C) applies, we must determine
the effect of Diouf’s obstructionism on the calculation of the
removal period. In Lema and Pelich, we held that
§ 1231(a)(1)(C) extended the removal period for the duration
of the obstruction. Lema, 341 F.3d at 856; Pelich, 329 F.3d
at 1059. However, the conduct at issue in those cases was
ongoing at the time the cases were decided. See Lema, 341
F.3d at 856; Pelich, 329 F.3d at 1059. As a result, neither
Lema nor Pelich decided the effect of § 1231(a)(1)(C) in cir-
cumstances, such as Diouf’s, that involve a closed period of
obstruction. Because the latest evidence of Diouf’s obstruc-
tion is the July 20, 2005 warning for failure to depart, we
must decide how much of the removal period remained after
that date.4
   4
     We decline to find in the absence of positive evidence that Diouf con-
tinued to refuse to cooperate after July 20. Though an inference of subse-
quent obstruction may not be unreasonable, it is the burden of the
government to document the conduct that extends the removal period
under § 1231(a)(1)(C). Given what is at stake for the alien, we believe it
inappropriate to allow the Government to satisfy its burden on inferences
alone. Cf. United States v. Salerno, 481 U.S. 739, 755 (1987) (“In our
society liberty is the norm, and detention . . . is the carefully limited
exception.”).
                           DIOUF v. MUKASEY                          13211
   [5] The text of § 1231(a) permits two different approaches.
First, the 90-day clock could toll for the duration of the activ-
ity that triggered § 1231(a)(1)(C), and, following the latest
date of documented obstruction, Diouf’s mandatory detention
under § 1231(a)(2) could continue for the unexpended portion
of the clock. Under this approach, Diouf’s removal period and
mandatory detention would have terminated on August 8,
2005—19 days after the July 20 warning letter—because 71
days of the removal period had already lapsed between the
finalization of his order of removal and his failure to appear
for removal on September 4, 2003. Alternatively, the 90-day
clock could restart following the latest date of documented
obstruction. This would mean that Diouf’s removal period
and mandatory detention under § 1231(a)(2) lasted until Octo-
ber 18, 2005—90 days after the July 20 warning letter.

   We find the latter approach more appropriate. The purpose
of the 90-day period is to afford the government a reasonable
amount of time within which to make the travel, consular, and
various other administrative arrangements that are necessary
to secure removal. See Khotesouvan v. Morones, 386 F.3d
1298, 1300 (9th Cir. 2004). Using a single 90-day clock prior
to and following a lengthy period of obstruction would, in
many cases, frustrate that purpose by substantially truncating
the amount of time within which the removal arrangements
must be made. In Diouf’s case, the passage of over twenty-
two months between the original removal date of September
4, 2003, and the latest date of documented obstruction
required the government to restart the process of executing his
removal. Without a new 90-day clock, the government would
have had only 17 days to complete its work, after which the
statutory basis for Diouf’s detention would have shifted from
§ 1231(a)(2) to § 1231(a)(6).5
   5
     The question of whether to toll the original 90-day clock or start a new
clock following a period of obstruction may carry more significant conse-
quences in cases involving the removal of aliens to whom § 1231(a)(6)
does not apply. It is possible that the government would have to release
such aliens upon the expiration of the 90-day clock because § 1231(a)
does not appear to otherwise provide for detention beyond the removal
period.
13212                  DIOUF v. MUKASEY
   The Government argues that Diouf extended the removal
period under § 1231(a)(1)(C) even beyond October 18, 2005,
by repeatedly and unsuccessfully petitioning for relief before
this court. We reject this argument. Diouf’s appeals to this
court plainly did not constitute a “fail[ure] or refus[al] to
make timely application in good faith for travel or other docu-
ments necessary to . . . departure.” 8 U.S.C. § 1231(a)(1)(C).
Nor were they a “conspir[acy] or act[ ] to prevent . . . remov-
al.” Id. As we explained in Prieto-Romero, § 1231(a)(1)(C)
pertains only to intentionally obstructionist, bad faith tactics
that are designed to frustrate the government’s attempts to
effectuate a removal order, not to an alien’s good faith
attempt to make use of legally available judicial review and
remedies. 534 F.3d at 1060-61. Diouf’s appeals fell within
this latter category. His first three petitions were each dis-
missed for non-compliance with routine appellate procedures,
but we attribute those results to Diouf’s status at the time as
a pro se litigant who was unfamiliar with the appellate pro-
cess, not to bad faith. Moreover, the final two petitions
resulted in a stay of removal. The entry of the stay signifies
that, at the very least, the petitions have presented a “serious
legal question[ ]” or have some “probability of success on the
merits.” See Abbassi v. INS, 143 F.3d 513, 514 (9th Cir. 1998)
(“We evaluate stay requests under the same standards
employed by district courts in evaluating motions for prelimi-
nary injunctive relief.”).

   [6] Because Diouf’s removal period ended on October 18,
2005, the statutory basis for his subsequent detention was
§ 1231(a)(6). The statute provides:

    An alien ordered removed who is inadmissible under
    section 1182 of this title, removable under section
    1227(a)(1)(C), 1227(a)(2), or 1227(a)(4) of this title
    or who has been determined by the Attorney General
    to be a risk to the community or unlikely to comply
    with the order of removal, may be detained beyond
                            DIOUF v. MUKASEY                          13213
      the removal period and, if released, shall be subject
      to the terms of supervision in paragraph (3).

Section 1231(a)(6) governed at the time of the preliminary
injunction and the grant of habeas relief because Diouf’s
detention on those dates occurred “beyond” the removal
period. Diouf, moreover, falls within the class of aliens to
whom the statute applies because he was ordered removed
and is “inadmissible under section 1182” of Title 8. Id.
§ 1231(a)(6).6

                                     II.

   We next address whether Diouf was entitled to the writ of
habeas corpus. The Government contends that the district
court erred in granting the writ because the length of Diouf’s
detention fell within the limits of § 1231(a)(6) and was con-
sistent with the implicit limitation that Zadvydas v. Davis, 533
U.S. 678 (2001), imposes on the Attorney General’s detention
authority. Diouf argues that his detention had become indefi-
nite due to the absence of any certainty as to precisely when
it would conclude, and that it was therefore not authorized
under any immigration detention statute. See Zadvydas, 533
U.S. 678.

   [7] We agree with the Government. As we have explained,
see supra § I.C, Diouf’s detention was authorized by
§ 1231(a)(6) because he was ordered removed and was inad-
missible under § 1182. An alien is entitled to habeas relief
after a presumptively reasonable six-month period of deten-
  6
    Section 1182 provides that an alien convicted of “a violation of . . . any
law or regulation of a State, the United States, or a foreign country relating
to a controlled substance (as defined in section 102 of the Controlled Sub-
stances Act (21 U.S.C. § 802)), is inadmissible.” 8 U.S.C. § 1182(a)(2)(A)
(i)(II). Diouf’s conviction for possession of marijuana under Washington
law falls within this provision because marijuana is a “controlled sub-
stance” within the meaning of 21 U.S.C. § 802(6). See 21 U.S.C. § 812
Schedule I(c)(10).
13214                  DIOUF v. MUKASEY
tion under § 1231(a)(6) only upon demonstration that the
detention is “indefinite”—i.e., that there is “good reason to
believe that there is no significant likelihood of removal in the
reasonably foreseeable future.” Zadvydas, 533 U.S. at 701;
see also Clark v. Suarez-Martinez, 543 U.S. 371, 377-78
(2005) (extending Zadvydas to aliens who are detained under
§ 1231(a)(6) and inadmissible under § 1182). Diouf’s deten-
tion undoubtedly extended beyond the presumptively reason-
able period of six months. However, he fails to demonstrate
that there was “no significant likelihood of removal in the rea-
sonably foreseeable future.” Zadvydas, 533 U.S. at 701. In
Prieto-Romero, we construed this language to require the
alien to show that he would be unremovable even if the gov-
ernment defeated his petition for review. 534 F.3d at 1063.
The record provides no reason to believe such would be the
case with Diouf. There is no evidence, for example, that Sene-
gal would refuse to accept him, or that his removal is barred
by our own laws. See id. (citing Zadvydas, 533 U.S. at 697).
Indeed, ICE successfully completed the arrangements for
Diouf’s removal prior to the originally scheduled removal
date of September 4, 2003, and again on May 26, 2005; Diouf
was not removed at those times solely because of his own
refusal to cooperate. The government, therefore, could con-
tinue to have an interest in detaining Diouf to effect his
removal, and the detention remained authorized by
§ 1231(a)(6). Zadvydas, 533 U.S. at 699; Prieto-Romero, 534
F.3d at 1065. That the detention did not have a certain end
date does not change the analysis. Id. at 1063; see also Casas-
Castrillon, 2008 WL 2902026, at *5 (concluding that an
alien’s detention was not unauthorized by statute on the basis
of the length of his nearly seven-year detention because noth-
ing would prevent his removal if he were ultimately unsuc-
cessful in his then-pending petition for review).

                              III.

   The remaining question is whether the district court abused
its discretion by preliminarily enjoining the IJ to hold a bond
                       DIOUF v. MUKASEY                    13215
hearing at which the Government was required to release
Diouf unless it could prove by clear and convincing evidence
that Diouf was a flight risk or a danger to the community. As
we noted in Casas-Castrillon, “[t]here is a difference between
detention being authorized and being necessary as to any par-
ticular person.” 2008 WL 2902026, at *5. The Government
contends that the injunction was an abuse of discretion
because Diouf was subject to mandatory detention under
§ 1231(a)(2) and was, therefore, ineligible for release on
bond. The Government also argues that even if bond were
potentially available, the injunction incorrectly required the IJ
to place on ICE the burden of proving Diouf’s ineligibility for
release, rather than place on Diouf the burden of proving his
eligibility. Diouf argues that he was entitled to the hearing as
a matter of due process, and that bond was properly granted.

   [8] We hold that the injunction constituted an abuse of dis-
cretion insofar as it relied on the erroneous premise that Diouf
was being detained under § 1226. As we have explained, the
detention at the time of the injunction occurred under
§ 1231(a)(6), not § 1226. See Negrete v. Allianz Life Ins. Co.
of N. Am., 523 F.3d 1091, 1096 (9th Cir. 2008) (explaining
that a district court abuses its discretion if it enters prelimi-
nary injunctive relief because of a misapprehension of the law
governing the underlying issues in the litigation).

   Whether the injunction was also an abuse of discretion spe-
cifically because it ordered a bond hearing is another matter.
Contrary to the Government’s argument, Diouf’s detention
under § 1231(a)(6) did not render him categorically ineligible
for release on bond. Section 1231(a)(6) provides the Attorney
General with the authority either to detain an alien beyond the
removal period or to release him subject to the terms of super-
vision specified under § 1231(a)(3). We have specifically
construed § 1231(a)(6) to permit release on bond. See Doan
v. INS, 311 F.3d 1160, 1162 (9th Cir. 2002). The regulations
that implement the statute also expressly permit bond as a
condition of release. See 8 C.F.R. § 214.5(b). Therefore, we
13216                  DIOUF v. MUKASEY
reject the Government’s suggestion that Diouf was statutorily
ineligible for release on bond.

   It does not necessarily follow, however, that the district
court was correct in ordering the Attorney General to conduct
a bond hearing, or that the Government was required to
release Diouf on bond unless the Government could prove by
clear and convincing evidence that Diouf was a danger to the
community or a flight risk. Section 1231(a)(6) creates no
express limit on the duration of post-removal period deten-
tion; nor does it specify that aliens are entitled to release
unless they receive a bond hearing such as the one ordered by
the district court. The statute states simply that the Attorney
General “may” detain certain classes of aliens beyond the
removal period.

   [9] We decline to decide in the first instance whether aliens
such as Diouf, who are detained under § 1231(a)(6), are enti-
tled to receive bond hearings and to obtain release on bond
unless the Government proves that they are a danger or a
flight risk. The district court granted such relief under the
erroneous conclusion that Diouf was detained under
§ 1226(a), and therefore did not reach the question of what
process must be provided to aliens detained under
§ 1231(a)(6). We note, however, that we considered a some-
what similar question in Casas-Castrillon. There, the issue
was whether § 1226(a) authorizes the Attorney General to
subject lawful permanent residents to prolonged detention
pending judicial review of a final order of removal without
affording an opportunity for an individualized determination
on the necessity of the detention before a neutral decision
maker. 2008 WL 2902026, at *6. Because prolonged deten-
tion of a lawful permanent resident in such circumstances
would be “constitutionally doubtful,” we construed § 1226(a)
as “requiring the Attorney General to provide the alien with
. . . a [bond] hearing.” Id. at *7 (emphasis in original).
                            DIOUF v. MUKASEY                           13217
   [10] Given the limited holding of Casas-Castrillon, it
remains unclear whether due process concerns would require
a similar construction of § 1231(a)(6) in a case involving an
alien, such as Diouf, who is not a legal permanent resident
and who, unlike the alien in Casas-Castrillon, has been
ordered removed by the BIA, has exhausted his opportunities
to challenge that final order of removal directly, and has pre-
viously been granted release on bond and had the bond can-
celled for failure to timely depart. The district court did not
address the question of whether the post-order custody review
process that Diouf received satisfies the requirements of
§ 1231(a)(6) or the Due Process Clause, and neither does the
briefing provided by the parties. Because we do not believe
it prudent to decide the question under these circumstances,
we vacate the preliminary injunction and remand so that the
district court can decide in the first instance, with possible
additional fact-finding and more focused briefing from the
parties, whether Diouf is entitled to an individualized determi-
nation, before a neutral decision maker, of the necessity of his
detention under § 1231(a)(6).7

                            CONCLUSION

  For the foregoing reasons, the grant of the writ of habeas
corpus is REVERSED, and the preliminary injunction is
VACATED and REMANDED for further proceedings consis-
   7
     We note that the district court failed to support its original preliminary
injunction with findings of fact and conclusions of law, as it was required
to do. See Fed. R. Civ. P. 52(a) (providing that a district court that grants
a preliminary injunction “must find the facts specifically and state its con-
clusions of law separately”); see also Fed. R. Civ. P. 65(d). Findings of
fact and conclusions of law are important to help the parties understand
the reasons for the decision and to facilitate meaningful appellate review.
Hoechst Diafoil Co. v. Nan Ya Plastics Corp., 174 F.3d 411, 423 (4th Cir.
1999); see also Mayo v. Lakeland Highlands Canning Co., 309 U.S. 310,
316 (1940) (“It is of the highest importance to a proper review of the
action of a court in granting or refusing a preliminary injunction that there
should be fair compliance with Rule 52(a).”).
13218                 DIOUF v. MUKASEY
tent with this opinion.

  REVERSED in part; VACATED and REMANDED in part.
