                 FOR PUBLICATION
 UNITED STATES COURT OF APPEALS
      FOR THE NINTH CIRCUIT

LUIS FELIPE CASAS-CASTRILLON,         
              Petitioner-Appellant,
                                            No. 07-56261
                v.
DEPARTMENT OF HOMELAND                       D.C. No.
                                          CV-05-01552-BEN
SECURITY; BILL LOCKYER, Attorney
                                             OPINION
General; US ATTORNEY GENERAL,
            Respondents-Appellees.
                                      
       Appeal from the United States District Court
          for the Southern District of California
        Roger T. Benitez, District Judge, Presiding

                  Argued and Submitted
          January 7, 2008—Pasadena, California

                    Filed July 25, 2008

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

                 Opinion by Judge Fisher




                           9771
           CASAS-CASTRILLON v. HOMELAND SECURITY       9775


                        COUNSEL

James Fife, Federal Defenders of San Diego, Inc., San Diego,
California, for the petitioner-appellant.
9776       CASAS-CASTRILLON v. HOMELAND SECURITY
Karen P. Hewitt, United States Attorney; Thomas Stahl and
Samuel W. Bettwy, Assistant United States Attorneys, and
Thomas Dupree (argued), United States Department of Jus-
tice, Washington, D.C., for the respondents-appellees.

Judy Rabinovitz, ACLU Foundation, New York, New York;
Cecillia D. Wang, ACLU Foundation, San Francisco, Califor-
nia; Ahilan T. Arulanantham and Ranjana Natarajan, ACLU
Foundation of Southern California, Los Angeles, California;
Jayashri Srikantiah, Stanford Law School Immigrants’ Rights
Clinic, Stanford, California; for the amicus curiae ACLU
Foundation and ACLU Foundation of Southern California.

Rachael Keast, Florence Immigrant and Refugee Rights Proj-
ect, Florence, Arizona; Nancy Morawetz, Washington Square
Legal Services, Inc., New York, New York; for the amicus
curiae the Florence Immigrant and Refugee Rights Project,
the American-Arab Anti-Discrimination Committee, the
American Immigration Lawyers Association, the Asian Law
Caucus, the Center for Constitutional Rights, the Center for
Gender and Refugee Studies, the Cornell Asylum and Con-
vention Against Torture Appellate Law Clinic, Hate Free
Zone, Human Rights Watch, the International Detention
Coalition, the Northwest Immigrant Rights Project, Minnesota
Advocates for Human Rights, the National Immigrant Justice
Center, the National Immigration Project of the National
Lawyers Guild, the New York State Defenders Association
Immigrant Defense Project and the U.C. Davis Immigration
Law Clinic.


                         OPINION

FISHER, Circuit Judge:

  This appeal concerns whether the government may detain
an alien who is a legal permanent resident of the United States
              CASAS-CASTRILLON v. HOMELAND SECURITY                   9777
for seven years without providing him with an adequate
opportunity to contest the necessity of his detention before a
neutral decision maker. We conclude that a prolonged deten-
tion must be accompanied by appropriate procedural safe-
guards, including a hearing to establish whether releasing the
alien would pose a danger to the community or a flight risk.

   Luis Felipe Casas-Castrillon (“Casas”) is a native and citi-
zen of Colombia and has been a legal permanent resident of
the United States since 1990. He was served with a notice to
appear and detained by the Immigration and Naturalization
Service in August 2001, following his release from a state
prison for a conviction on an auto burglary charge.1 An immi-
gration judge (“IJ”) found that Casas was a removable alien
because he had been convicted of two crimes involving moral
turpitude. See 8 U.S.C. § 1227(a)(2)(A)(ii) (providing that
“[a]ny alien who . . . is convicted of two or more crimes
involving moral turpitude . . . is deportable”).2 Casas appealed
this determination to the Board of Immigration Appeals
(“BIA”), which affirmed the removal order in July 2002.

   From that time until the present, Casas has remained in the
continuous custody of the federal government while he has
pursued various avenues of relief from removal in the federal
district court and the court of appeals, some successful and
some not. While he has sought judicial review, his removal
has been stayed by court orders for much of the period from
2002 to the present. As of the time that this opinion is filed,
Casas is now back before the BIA after this court granted his
petition for review of his final order of removal. During this
nearly seven-year period of detention, it is unclear what, if
  1
    On March 1, 2003, the INS was dissolved as an independent agency
within the Department of Justice and its functions were transferred to the
Department of Homeland Security. Homeland Security Act of 2002, Pub.
L. No. 107-296, § 471, 116 Stat. 2135, 2205.
  2
    Hereinafter, all citations are to Title 8 of the U.S. Code unless other-
wise noted.
9778       CASAS-CASTRILLON v. HOMELAND SECURITY
any, opportunity Casas has had to argue to a neutral decision
maker that his detention is unnecessary because he does not
pose a danger to the community or a flight risk.

   Casas filed the instant petition for habeas corpus under 28
U.S.C. § 2241 on August 4, 2005. At that time, his adminis-
trative proceedings had been complete for approximately
three years, but he was awaiting our court’s review of his
timely filed petition for review of his final removal order. In
his pro se habeas petition to the district court, Casas argued
that his detention had become indefinite and was therefore not
authorized by any statute, and that his prolonged detention
without a meaningful opportunity to contest the necessity of
continued detention violated his right to procedural due pro-
cess. The district court denied Casas’ petition on August 15,
2007, and we granted expedited review. We have jurisdiction
under 28 U.S.C. §§ 1291 and 2253(a), and we reverse.

                              I.

   As we explained in Prieto-Romero v. Clark, No. 07-35458,
slip op. at 9292 (9th Cir. July 25, 2008), Casas’ entitlement
to relief turns in part on locating him within the statutory
framework of detention authority provided by Sections 236
and 241 of the Immigration and Naturalization Act, codified
at 8 U.S.C. §§ 1226 and 1231. This is because “[w]here an
alien falls within this statutory scheme can affect whether his
detention is mandatory or discretionary, as well as the kind of
review process available to him if he wishes to contest the
necessity of his detention.” Id. Casas and the government vig-
orously dispute which statutory provision governs his deten-
tion. We conclude that Congress has provided the Attorney
General with authority to detain Casas under § 1226(a), which
gives the Attorney General a broad grant of discretionary
authority to detain an alien “pending a decision on whether
the alien is to be removed from the United States.”
           CASAS-CASTRILLON v. HOMELAND SECURITY          9779
                              A.

   The statutory scheme governing the detention of aliens in
removal proceedings is not static; rather, the Attorney Gener-
al’s authority over an alien’s detention shifts as the alien
moves through different phases of administrative and judicial
review. This makes the task of determining where an alien
falls within this scheme particularly difficult for a reviewing
court, because the Attorney General’s authority over the alien
can present a moving target. The Attorney General’s authority
over the alien at the time his habeas corpus petition is filed
may differ from the authority at the time we hear oral argu-
ment on appeal, which may differ in turn from the authority
at the time our opinion is filed. Casas’ own case presents this
problem, because we have considered, granted and remanded
Casas’ petition for review of his removal order during the
same period that we have been considering on appeal his
habeas corpus challenge, actions that arguably affect the
Attorney General’s statutory authority over his detention.

   [1] To determine by what authority the Attorney General
currently may detain Casas, it is helpful to begin with the
Attorney General’s authority to detain Casas initially —
detention authority Casas does not dispute. Casas was charged
with being removable for having committed two crimes
involving moral turpitude, and Congress has mandated that
such aliens must be taken into custody at the time they are
charged. See § 1226(c)(1)(B) (“The Attorney General shall
take into custody any alien who . . . is deportable by reason
of having committed any offense covered in section
1227(a)(2)(A)(ii) . . . .”) (emphasis added). The Attorney
General may release an alien detained under § 1226(c) only
for narrow reasons not implicated here. See § 1226(c)(2).
Unlike noncriminal aliens, who are detained under § 1226(a),
aliens detained under § 1226(c) are not given a bond hearing
before an IJ. Thus these aliens do not have the opportunity to
show — as noncriminal aliens would — that their detention
9780       CASAS-CASTRILLON v. HOMELAND SECURITY
is unnecessary because they do not pose a danger to the com-
munity or a flight risk.

   [2] Although the Attorney General’s initial statutory
authority to detain Casas is undisputed, both parties agree that
§ 1226(c) at some point no longer governed Casas’ detention.
As Casas’ case ably demonstrates, aliens challenging an order
of removal may languish in the system for years. Even after
the BIA has entered a final order of removal, an alien may
petition for review of that removal order with the court of
appeals in the judicial circuit in which his immigration pro-
ceedings occurred. See § 1252(b). Before Congress enacted
the REAL ID Act (“RIDA”) in May 2005, Pub. L. No. 109-
13, Div. B, 199 Stat. § 231 (2005), certain aliens could also
obtain judicial review of constitutional questions or questions
of law raised by their final orders of removal through a peti-
tion for habeas corpus brought in the district court. See
Flores-Miramontes v. INS, 212 F.3d 1133 (9th Cir. 2000).
Even post-RIDA, aliens may continue to bring collateral legal
challenges to the Attorney General’s detention authority —
such as in this case — through a petition for habeas corpus.
See Nadarajah v. Gonzales, 443 F.3d 1069, 1075 (9th Cir.
2006) (holding that “the jurisdiction-stripping provision [of
RIDA] does not apply to federal habeas corpus petitions that
do not involve final orders of removal”). The courts of
appeals have the authority to enter judicial stays of removal
for aliens who have petitions for review or habeas corpus peti-
tions pending. See § 1252(b)(3)(B). This means that many
aliens may continue to be detained for months, if not years,
after their removal order is finalized by the agency, while they
seek review of the legal or factual basis for their removal.

  Casas has himself explored all of these possible avenues of
review and relief. After the BIA affirmed his order of
removal, Casas — acting pro se and apparently unfamiliar
with the proper avenue for seeking review of his removal
order — first filed with the district court in October 2002 a
petition for habeas corpus, which was transferred to this court
            CASAS-CASTRILLON v. HOMELAND SECURITY            9781
as a petition for review and subsequently dismissed for lack
of jurisdiction in April 2004. Casas petitioned the Supreme
Court for a writ of certiorari, which the Court denied in March
2005. See 544 U.S. 910 (2005). Having failed in his attempt
to achieve direct review of his removal order, Casas then filed
a number of additional petitions for habeas corpus with the
district court. Some challenged his final order of removal and
others collaterally attacked the state criminal convictions that
had formed the basis of the charge of removal. Many of
Casas’ petitions to the district court were dismissed for lack
of jurisdiction.

   Casas finally succeeded in obtaining review of his removal
order, however, because he had a petition for habeas corpus
challenging his final removal order pending before the district
court on May 11, 2005, the date that Congress enacted RIDA.
RIDA eliminated habeas corpus as an avenue for challenging
a final order of removal, but specified that any habeas corpus
petition pending before a district court on May 11, 2005
“shall” be transferred to the court of appeals, which “shall
treat the transferred case as if it has been timely filed pursuant
to a petition for review.” See RIDA § 106(c); see also
Alvarez-Barajas v. Gonzales, 418 F.3d 1050, 1052-53 (9th
Cir. 2005). Pursuant to this act of Congress, the district court
transferred Casas’ habeas petition to our court, which, in
accordance with Congress’ instructions, treated it as a timely
filed petition for review. In June 2006, we entered a stay of
removal pending our disposition of his petition. We eventu-
ally granted Casas’ petition for review in January 2008 and
remanded to the BIA. See Casas-Castrillon v. Mukasey, No.
05-72553, 2008 WL 268949 (9th Cir. Jan. 31, 2008). Our
mandate in that case issued in March 2008.

                               B.

   [3] Although Casas’ road to judicial review of his removal
order was surely unusual, the government concedes that at the
time Casas filed his present petition for habeas corpus, he was
9782       CASAS-CASTRILLON v. HOMELAND SECURITY
properly understood to be an alien who was detained while
awaiting review of a timely filed petition for review, and
whose deportation was prevented by the entry of our judicial
stay. The government argues that aliens awaiting judicial
review of their petitions for review become subject to contin-
ued detention under the Attorney General’s grant of authority
in § 1231(a), which provides for detention “during” and “be-
yond” the “removal period.” As we explained in Prieto-
Romero, we disagree. If an alien has filed a petition for
review with this court and received a judicial stay of removal,
the “removal period” under § 1231(a) does not begin until this
court “denies the petition and withdraws the stay of removal.”
Prieto-Romero, slip op. at 9295. Therefore, Casas was not
subject to detention under § 1231(a) at the time he filed his
petition for habeas corpus while his petition for review was
pending in this court.

   [4] Because § 1231(a) does not govern Casas’ detention,
we must determine which statute does. The statutory scheme
presents two possible options: either Casas has remained in
detention throughout this seven-year period under § 1226(c),
which requires mandatory detention of criminal aliens, or at
some point the detention authority shifted to § 1226(a), which
gives the Attorney General general discretionary authority to
detain an alien “pending a decision on whether the alien is to
be removed from the United States.” We reject the govern-
ment’s suggestion that § 1226(c) mandates Casas’ detention
for the duration of his now seven-year confinement. As we
explained in Tijani v. Willis, 430 F.3d 1241, 1242 (9th Cir.
2005), § 1226(c)’s mandatory detention provision applies
only to “expedited removal of criminal aliens.” The Supreme
Court similarly recognized in Demore v. Kim, 538 U.S. 510
(2003), that § 1226(c) was intended only to “govern[ ] deten-
tion of deportable criminal aliens pending their removal pro-
ceedings,” which the Court emphasized typically “lasts
roughly a month and a half in the vast majority of cases in
which it is invoked, and about five months in the minority of
cases in which the alien chooses to appeal” his removal order
           CASAS-CASTRILLON v. HOMELAND SECURITY           9783
to the BIA. Id. at 527-28, 530 (emphasis in original). The
Department of Homeland Security (“DHS”) has similarly
interpreted § 1226(c) to apply only “during removal proceed-
ings.” See 8 C.F.R. § 236.1(c)(1)(i). The “conclusion of pro-
ceedings” occurs upon the dismissal of the alien’s appeal by
the BIA. See id. § 1241.1(a).

   [5] Because neither § 1231(a) nor § 1226(c) governs the
prolonged detention of aliens awaiting judicial review of their
removal orders, we conclude that Casas’ detention was autho-
rized during this period under the Attorney General’s general,
discretionary detention authority under § 1226(a). Section
1226(a) authorizes the Attorney General to detain an alien
“pending a decision on whether the alien is to be removed
from the United States.” Again, as we explained in Prieto-
Romero, “[i]t is reasonable to consider the judicial review of
a removal order as part of the process of making an ultimate
‘decision’ as to whether an alien ‘is to be removed.’ ” Slip op.
at 9300. Once Casas’ proceedings before the BIA were com-
plete, the Attorney General’s authority to detain him under
§ 1226(c) ended and that authority shifted instead to
§ 1226(a).

   [6] We lastly reject the government’s suggestion that, even
if Casas was not subject to detention under § 1226(c) while
his petition for review was pending on appeal, he became sub-
ject to such custody again after we granted his petition for
review and remanded his case to the BIA. An alien whose
case is being adjudicated before the agency for a second time
— after having fought his case in this court and won, a pro-
cess which often takes more than a year — has not received
expeditious process. See Tijani, 430 F.3d at 1242. We there-
fore conclude that the mandatory, bureaucratic detention of
aliens under § 1226(c) was intended to apply for only a lim-
ited time and ended in this case when the BIA affirmed
Casas’ order of removal in July 2002. Thereafter, the Attor-
ney General’s detention authority rests with § 1226(a) until
the alien enters his “removal period,” which occurs only after
9784       CASAS-CASTRILLON v. HOMELAND SECURITY
we have rejected his final petition for review or his time to
seek such review expires. See Prieto-Romero, slip op. at
9295.

                              II.

   Having determined that the government’s authority to
detain Casas falls under § 1226(a), we now turn to the ques-
tion of whether Casas is entitled to any habeas corpus relief.

                              A.

   [7] Casas first argues that he is entitled to release from
detention because his detention has become prolonged and is
potentially indefinite and Congress has not statutorily autho-
rized such detention. Although Casas’ nearly seven-year
detention certainly qualifies as prolonged by any measure, we
hold that the government retains authority to detain him under
§ 1226(a) because Casas faces a significant likelihood of
removal to Colombia once his judicial and administrative
review process is complete.

   [8] In Prieto-Romero, we concluded that an alien whose
removal had been delayed “while he pursues judicial review
of his administratively final order of removal” had failed to
show that his detention was unauthorized by statute, where
there was “nothing, such as a lack of a repatriation agreement
with his home country or a finding that he merit[ed] manda-
tory relief from removal, that would prevent [his] removal . . .
if he is ultimately unsuccessful in his petition for review.”
Slip op. at 9305. Here, Casas was found removable by both
the immigration judge and the BIA, but he repeatedly sought
judicial relief from that determination and stays of removal,
which delayed his deportation. After we granted his petition
for review, the government, on remand, is again seeking to
establish that Casas is removable as charged. Should the gov-
ernment succeed, there is nothing, such as a lack of a repatria-
tion agreement with his home country or a finding that he
           CASAS-CASTRILLON v. HOMELAND SECURITY           9785
merits mandatory relief from removal, that prevents Casas’
removal to Colombia if he ultimately fails in fighting the gov-
ernment’s charge of removability. Accordingly, we hold that
the government retains an interest in “assuring [Casas’] pres-
ence at removal,” and his continued detention remains autho-
rized by Congress. See Zadvydas v. Davis, 533 U.S. 678, 699
(2001); Prieto-Romero, slip op. at 9305.

                              B.

   Although we agree with the government that Casas’ deten-
tion is authorized under § 1226(a) because he remains capable
of being removed, Casas raises a second challenge to the
legality of his detention — whether the government may
detain him for such a prolonged period without providing an
individualized determination as to the necessity of his deten-
tion. Even though Casas’ detention is permitted by statute
because keeping him in custody could serve a legitimate
immigration purpose, Casas may nonetheless have the right to
contest before a neutral decision maker whether the govern-
ment’s purported interest is actually served by detention in his
case. There is a difference between detention being autho-
rized and being necessary as to any particular person. We
hold that the government may not detain a legal permanent
resident such as Casas for a prolonged period without provid-
ing him a neutral forum in which to contest the necessity of
his continued detention.

   In Demore, the Supreme Court considered a constitutional
challenge to the mandatory detention provision of § 1226(c).
The primary question before the Court was not whether deten-
tion under § 1226(c) violated substantive due process because
the alien’s detention was indefinite, but rather whether proce-
dural due process required the government to make an indi-
vidualized finding that detention was justified by a legitimate
government interest, such as protecting the community or
ensuring the alien’s appearance at removal proceedings. See
Demore, 538 U.S. at 524 (explaining that the aliens were
9786        CASAS-CASTRILLON v. HOMELAND SECURITY
“challeng[ing] their detention on the grounds that there had
been no finding that they were unlikely to appear for their
deportation proceedings when ordered to do so”). As the
Court recognized, there is little question that the civil deten-
tion of deportable aliens during removal proceedings can
serve the legitimate government purpose of “preventing
deportable . . . aliens from fleeing prior to or during their
removal proceedings, thus increasing the chance that, if
ordered removed, the aliens will be successfully removed.”
Id. at 528. However, it was not clear that Congress could
authorize the detention of criminal aliens as a class, without
providing the individual alien with an opportunity to show
that his detention is not necessary to secure his presence at the
time of removal.

    The Supreme Court upheld § 1226(c)’s mandatory deten-
tion provision in Demore, but did so with the specific under-
standing that § 1226(c) authorized mandatory detention only
for the “limited period of [the alien’s] removal proceedings,”
which the Court estimated “lasts roughly a month and a half
in the vast majority of cases in which it is invoked, and about
five months in the minority of cases in which the alien
chooses to appeal” his removal order to the BIA. Id. at 530.
References to the brevity of mandatory detention under
§ 1226(c) run throughout Demore. See id. at 513 (“Congress
. . . may require that [criminal aliens] be detained for the brief
period necessary for their removal proceedings.”); id. at 523
(noting that the question under consideration was whether
“the Government may . . . detain [criminal aliens] for the brief
period necessary for his removal proceedings”); id. at 526
(noting the “Court’s longstanding view that the Government
may constitutionally detain deportable aliens during the lim-
ited period necessary for their removal proceedings”); id. at
529 n.12 (noting “[t]he very limited time of the detention at
stake”). Casas’ nearly seven-year detention, if unaccompanied
by meaningful, individualized review, would clearly be a far
longer period of detention than the “brief” period of manda-
            CASAS-CASTRILLON v. HOMELAND SECURITY           9787
tory detention during administrative review that the Supreme
Court approved in Demore.

   [9] The question before us, therefore, is whether legal per-
manent residents such as Casas, who have been subjected to
prolonged detention pending judicial review of their final
order of removal or agency reconsideration on remand, may
continue to be detained by the Attorney General without
receiving an individualized determination of the necessity of
detention before a neutral decision maker, such as an immi-
gration judge. We conclude that prolonged detention without
adequate procedural protections would raise serious constitu-
tional concerns. As the Supreme Court has repeatedly reaf-
firmed, “ ‘the Fifth Amendment entitles aliens to due process
of law in deportation proceedings.’ ” Demore, 538 U.S. at 523
(quoting Reno v. Flores, 507 U.S. 292, 306 (1993)). Detention
during judicial review — like the detention during removal
proceedings that Demore considered — may serve the pur-
pose of “preventing deportable . . . aliens from fleeing[,] . . .
thus increasing the chance that, if ordered removed, the alien
will be successfully removed.” Id. at 528. Even where deten-
tion is permissible, however, due process requires “adequate
procedural protections” to ensure that the government’s
asserted justification for physical confinement “outweighs the
individual’s constitutionally protected interest in avoiding
physical restraint.” Zadvydas, 533 U.S. at 690 (internal quota-
tion marks omitted). We are skeptical that Demore’s limited
holding that Congress could permissibly authorize “brief”
detention without procedural protections can be extended to
encompass the nearly seven-year detention at issue here.

   We need not resolve this constitutional question, however,
because we find no evidence that Congress intended to autho-
rize the long-term detention of aliens such as Casas without
providing them access to a bond hearing before an immigra-
tion judge. In Tijani, we held that an alien initially detained
under § 1226(c) could not continue to be detained during his
judicial review process unless he was afforded an individual-
9788       CASAS-CASTRILLON v. HOMELAND SECURITY
ized hearing before an IJ. See 430 F.3d at 1242. Like Casas,
Tijani was a legal permanent resident. See id. at 1250 (Calla-
han, J., dissenting). By the time we issued our decision in his
case, he had been detained for two years and eight months,
with approximately 20 months of his detention occurring dur-
ing his removal proceedings. See id. at 1246 (Tashima, J.,
concurring). Also like Casas, Tijani had filed a petition for
review with our court — which accounted for 10 months of
his 30-month detention — and we noted that Tijani could be
expected to be detained for another “year or more” while we
completed our review of his removal order. Id. at 1242. We
then concluded that Tijani’s mandatory detention throughout
this period was not authorized under § 1226(c), because
§ 1226(c) applies only to “expedited removal of criminal
aliens,” and “[t]wo years and eight months of process is not
expeditious.” Id. Applying the doctrine of constitutional
avoidance, we concluded that Tijani’s prolonged mandatory
detention was not authorized by that statute. We therefore
held that the government must provide Tijani “a hearing . . .
before an Immigration Judge with the power to grant him bail
unless the government establishes that he is a flight risk or
will be a danger to the community.” Id.

   [10] Although its reasoning was sparse, we believe Tijani
was correct that § 1226(c) does not authorize prolonged man-
datory detention after an alien’s administrative proceedings
are complete. Rather, these aliens are detained under the
Attorney General’s broader grant of discretionary authority
under § 1226(a). Further, such prolonged detention of aliens
is permissible only where the Attorney General finds such
detention individually necessary by providing the alien with
an adequate opportunity to contest the necessity of his deten-
tion. Section 1226(a), unlike § 1226(c), provides such author-
ity for the Attorney General to conduct a bond hearing and
release the alien on bond or detain him if necessary to secure
his presence at removal. See § 1226(a)(2). Because the pro-
longed detention of an alien without an individualized deter-
mination of his dangerousness or flight risk would be
             CASAS-CASTRILLON v. HOMELAND SECURITY                   9789
“constitutionally doubtful,” we hold that § 1226(a) must be
construed as requiring the Attorney General to provide the
alien with such a hearing. See Tijani, 430 F.3d at 1242. Thus
an alien is entitled to release on bond unless the “government
establishes that he is a flight risk or will be a danger to the
community.” Id. (citing Cooper v. Oklahoma, 517 U.S. 348,
363 (1996)).

   Unfortunately, we cannot ascertain from the record before
us whether Casas has been afforded an adequate opportunity
to challenge the necessity of his detention. The only evidence
in the record showing that Casas has received any procedural
review relates to a file review he received in November 2005.
At that time, two Immigration and Customs Enforcement
(“ICE”) field officers filled out a “Post-Order Custody
Review Worksheet” and recommended that Casas remain in
custody because he “would be a flight risk,” a determination
that was then approved by an ICE field director. Although
these ICE officials reviewed Casas’ record when making their
determination, they did not interview him personally or by
telephone. It is not clear from the record whether Casas was
even notified of this impending review or whether he was
given an opportunity to contest the facts on which the ICE
officials based their decision.3 There is no indication that he
had a right to an administrative appeal. This review falls far
short of the procedural protections afforded in ordinary bond
hearings, where aliens may contest the necessity of their
detention before an immigration judge and have an opportu-
nity to appeal that determination to the BIA. See 8 C.F.R.
§ 236.1(d); Matter of Guerra, 24 I. & N. Dec. 37, 38-40 (BIA
2006).
  3
    The record contains a “Notice of Alien of File Custody Review,”
which explained that Casas’ detention status would be reviewed in 90 days
and that he would have the opportunity to demonstrate to the satisfaction
of the Attorney General that he was neither a danger to the community nor
a flight risk. This notice is undated but contains the handwritten notation
“10/04,” which may indicate that it was sent more than a year before
Casas’ November 2005 file review.
9790       CASAS-CASTRILLON v. HOMELAND SECURITY
   Although neither party submitted any evidence showing
that Casas has ever received an ordinary bond hearing, we
take judicial notice of Casas’ administrative record, which
shows he received a bond hearing in January 2002 under
unusual circumstances. While Casas’ case was still pending
before the agency in January 2002, this court held that manda-
tory, bureaucratic detention of legal permanent residents
under § 1226(c) was unconstitutional. See Kim v. Ziglar, 276
F.3d 523, 526 (9th Cir. 2002), rev’d by Demore v. Kim, 538
U.S. 510 (2003). Pursuant to our decision in Kim, the agency
provided Casas with a bond hearing, at which he was found
eligible for bond. The amount was set at $25,000, a sum
Casas was unable to pay. Casas appealed the bond determina-
tion to the BIA, but the BIA upheld the amount in April 2002.
Approximately one year later, the Supreme Court overturned
our decision and held that mandatory detention of criminal
aliens for “the limited period of his removal proceedings”
does not violate the Due Process Clause. Demore, 538 U.S. at
531. It is not clear what, if any, continued legal effect this
bond hearing has, given that it was ordered pursuant to a now-
vacated constitutional ruling.

   [11] Because the parties did not develop an adequate record
of the procedural review that Casas has received, we cannot
determine whether the government has afforded him a bond
hearing that complies with the requirements of Tijani. We
therefore reverse the district court and remand with instruc-
tions to grant the writ unless, within 60 days, the government
provides Casas with “a hearing . . . before an Immigration
Judge with the power to grant him bail unless the government
establishes that he is a flight risk or will be a danger to the
community,” or shows that he has already received such a
bond hearing. Tijani, 430 F.3d at 1242.

  REVERSED AND REMANDED.
