
678 F.3d 265 (2012)
Neville Sylvester LESLIE, Appellant
v.
ATTORNEY GENERAL OF the UNITED STATES; Mary Sambol, Warden of York County Prison; Thomas Decker, District Director of Pennsylvania Field Office for Detention; Janet Napolitano, Secretary of the U.S. Department of Homeland Security.
No. 11-2442.
United States Court of Appeals, Third Circuit.
Argued February 6, 2012.
Filed: March 19, 2012.
*266 Neville Leslie, York, PA, Pro Se Appellant.
Tony West, David J. Kline, Victor M. Lawrence, Flor M. Suarez (Argued), Office of Immigration Litigation, United States Department of Justice, Washington, D.C., for Appellee.
Valerie Burch, ACLU Foundation of Pennsylvania, Harrisburg, PA, for Amicus Curiae American Civil Liberties Union Foundation of Pennsylvania.
Judy Rabinovitz (Argued), Michael K.T. Tan, ACLU Foundation Immigrants' Rights Project, New York, NY, for Amicus Curiae American Civil Liberties Union Foundation.
Before: SLOVITER, VANASKIE and GARTH, Circuit Judges.

OPINION OF THE COURT
GARTH, Circuit Judge.
Petitioner Neville Leslie, a Jamaican alien, has been incarcerated since March 28, 2008 without a bond hearing. He now seeks a bond hearing as provided by 8 U.S.C. § 1226, contending that his continued detention by United States Immigration and Customs Enforcement ("ICE") for four years is unconstitutional.[1]
Leslie's appeal from the District Court's denial of his petition for a writ of habeas corpus reveals a mixture of agency and court rulings (detailed below), all of which seek his removal to Jamaica and involve the pre-removal statute (8 U.S.C. § 1226) and the post-removal statute (8 U.S.C. § 1231). We now remand to the District Court and reverse the denial of Leslie's petition for a writ of habeas corpus. We also order that Leslie be afforded a bond hearing no later than ten days from the date this opinion and order are filed.


*267 I.
In 1998, Neville Leslie, a native and citizen of Jamaica and a lawful permanent resident of the United States, was convicted of a felony offense of conspiracy to possess and distribute more than fifty grams of "crack" cocaine in violation of 21 U.S.C. § 846. He was subsequently sentenced to 168 months imprisonment, which he has served. On March 28, 2008, after Leslie's release from prison, ICE issued a warrant for Leslie's arrest and took Leslie into custody. He has been incarcerated under ICE custody since that time.
On April 16, 2008, an Immigration Judge ("IJ") held a hearing and found Leslie, who waived his right to counsel at the hearing, removable to Jamaica for having committed an aggravated felony. Leslie appealed that order to the Board of Immigration Appeals ("BIA"). His appeal was dismissed on July 11, 2008. On July 21, 2008, Leslie petitioned this court for review of the BIA's decision, and he also moved to stay his removal on July 24, 2008. On August 14, 2008, this court granted the stay of removal pending the resolution of his petition for review.[2]
On July 8, 2010, this court, holding that the IJ failed to inform Leslie of the availability of free legal counsel, granted Leslie's petition for review and remanded the case to the BIA for a new hearing. On December 10, 2010, the BIA remanded the case to the IJ, who scheduled a hearing for February 22, 2011.
While still engaged before the immigration authorities and while still awaiting the immigration hearing of February 22, 2011, on February 2, 2011, Leslie filed a petition for a writ of habeas corpus in the District Court for the Middle District of Pennsylvania, challenging his continued immigration detention without hearing.
First, Leslie claimed that his original conviction was not an "aggravated felony," and that he therefore was not subject to criminal detention under 8 U.S.C. § 1226. Section 1226 concerns the arrest, detention, and release of aliens who have not yet been ordered to be removed, and, among other things, authorizes a bond hearing. Leslie also argued that his detention was unconstitutionally lengthy and that his continued detention without a bond hearing violated his procedural due process rights under the Fifth Amendment.
Before Leslie's habeas corpus petition was ruled on by the District Court, the IJ held the scheduled February 22, 2011 hearing, where Leslie requested a continuance of his removal proceedings for "medical reasons." The IJ continued the proceedings until March 30, 2011, at which time another hearing was held. At that hearing, Leslie again challenged the constitutionality of 8 U.S.C. § 1226 and again argued that his prior conviction was not an "aggravated felony." The IJ concluded that the prior conviction was an aggravated felony and did not decide the constitutional question of unreasonable detention. The IJ therefore ordered that Leslie be removed to Jamaica. Leslie appealed this decision to the BIA.
The BIA remanded Leslie's appeal of the IJ's order of removal to the IJ, noting that the audio recording of the March 30, 2011 hearing and the audio recording of the immigration judge's oral decision were missing from the record. The BIA therefore *268 ordered the immigration judge to prepare a complete transcript of the March 30, 2011 proceedings and, if necessary, to hold a new hearing.
Meanwhile, on May 10, 2011, the District Court adopted a magistrate judge's report and recommendation which recommended denying Leslie's petition for a writ of habeas corpus "without prejudice to future requests when, and if, Leslie's continued detention becomes sufficiently prolonged to trigger constitutional concerns." The District Court then held that Leslie had been convicted of an aggravated felony and that his detention was not unreasonable. Leslie timely appealed the denial of his petition to this court, which we address today.
Leslie was ordered removed by the IJ on December 15, 2011. Leslie appealed this order of removal to the BIA on December 22, 2011, and on February 3, 2012, DHS requested that the BIA expedite that appeal. As of this time, Leslie's appeal is still pending before the BIA, and Leslie's detention is continuing without Leslie having been afforded a bond hearing.

II.
This appeal requires us to resolve a single issue: whether the District Court properly determined that Leslie's continued detention is reasonable, and that he is therefore not entitled to a bond hearing.[3]
We begin by reviewing the statutory framework under which aliens can be detained during and subsequent to removal proceedings:
Under the pre-removal statute8 U.S.C. § 1226(a)ICE can detain any alien pending a decision in removal proceedings against that alien, and can release on bond any alien not otherwise ineligible for such release. Section 1226 expressly provides for mandatory detention during removal proceedings of aliens who are removable on account of their commission of certain enumerated offenses, including aggravated felonies such as Leslie's. Once removal proceedings terminate in an order *269 of removal, however, the alien's detention is governed by 8 U.S.C. § 1231(a).
Under the post-removal statute8 U.S.C. § 1231ICE must remove the alien within 90 days of a final order of removal, and must detain the alien during that period. Certain removable aliens, including aliens who, like Leslie, are removable under 8 U.S.C. § 1227(a)(2)(A)(iii) for having committed an aggravated felony "may be detained beyond the removal period" pursuant to 8 U.S.C. § 1231(a)(6).
Because detention under § 1231(a) serves to detain for removal an alien who will in fact be subjected to removal, the Supreme Court has held that the extended mandatory detention provided for by § 1231(a)(6) is constitutional only if it is not indefinite and when a "significant likelihood of removal in the reasonably foreseeable future" exists. Zadvydas v. Davis, 533 U.S. 678, 701, 121 S.Ct. 2491, 150 L.Ed.2d 653 (2001). In contrast, the Supreme Court did not expressly place any limits on ICE's authority to detain aliens prior to a final order under § 1226. Demore v. Kim, 538 U.S. 510, 520-21, 123 S.Ct. 1708, 155 L.Ed.2d 724 (2003).
This court, however, in considering Zadvydas, has determined that § 1226 "authorizes detention for a reasonable amount of time, after which the authorities must make an individualized inquiry into whether detention is still necessary to fulfill the statute's purposes of ensuring that an alien attends removal proceedings and that his release will not pose a danger to the community." Diop v. ICE/Homeland Sec., 656 F.3d 221, 231 (3d Cir.2011).[4] The court in Diop further noted that determining the point at which the length of detention is no longer reasonable is "a fact-dependent inquiry that will vary depending on individual circumstances. We decline to establish a universal point at which detention will always be considered unreasonable." Id. at 233. The fact-dependent inquiry must take into account delay caused by errors which necessitated appeals as well as the extent to which continuances or other delays favorable to the alien have lengthened the period of detention. Id. at 233-34.
The Diop court began its "reasonableness" analysis with the observation that "detention under § 1226 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 an alien chooses to appeal." Id. (Internal quotation marks and internal citations omitted). The court then observed that Diop had been detained for 35 months, and concluded that such a period of time, approximately six times longer than the regular period of detention, was unreasonable. Furthermore, as here, the government in Diop argued that the alien was responsible for a significant portion of that delay because he had requested continuances and filed several appeals. The Diop court concluded that as a general principle "the reasonableness determination must take into account a given individual detainee's need for more or less time, as well as the exigencies of a particular case," id. at 234, even though Diop concluded that the government and the courts were primarily responsible for the delay in Diop's case.
In other words, Diop laid out a two step-process: a reviewing court must first determine that a detention has been unreasonably long, and following such a determination, must determine whether the unreasonable detention is necessary to fulfill *270 § 1226's purposes as outlined in Diop, supra.
Because detention under the two statutes is governed by different standards, we must determine which statute has provided the authority for Leslie's detention at a given time. The government argues that the two years for which Leslie was detained while this court stayed his removal were governed under the post-removal statute (§ 1231), and accordingly, that in assessing the reasonableness of Leslie's detention, that time should not be considered. Leslie and the amici contend that his detention during that time was governed by the pre-removal statute, § 1226. We agree with Leslie and amici.[5]
The government's position on Leslie's habeas petition is out of step with other jurisdictions and with the reasoning of Diop. Our review indicates that every circuit to consider the issue has held that § 1226, not § 1231, governs detention during a stay of removal. See Prieto-Romero v. Clark, 534 F.3d 1053 (9th Cir.2008); Wang v. Ashcroft, 320 F.3d 130 (2d Cir. 2003); Bejjani v. INS, 271 F.3d 670 (6th Cir.2001) (abrogated on other grounds by Fernandez-Vargas v. Gonzales, 548 U.S. 30, 126 S.Ct. 2422, 165 L.Ed.2d 323 (2006)). But see also Akinwale v. Ashcroft, 287 F.3d 1050 (11th Cir.2002) (assuming that § 1231 governs detention during a four month judicial stay of removal without analysis or discussion). Furthermore, insofar as the purpose of § 1231 detention is to secure an alien pending the alien's certain removal, § 1231 cannot explain nor authorize detention during a stay of removal pending further judicial review.
Moreover, the express language of § 1231 refers only to detention "during" and "beyond" "the removal period." The removal period refers to the 90 day period between a statutorily specified event that begins the period and the time that the alien must in fact be removed. Section 1231(a)(1)(B)(ii) enumerates the events that can begin a "removal period," a list that includes: "If the removal order is judicially reviewed and if a court orders a stay of the removal of the alien, [the date that begins the removal period is] the date of the court's final order." With this language in place, there can be little doubt that an alien, subject to and within a stay of removal, cannot yet be in the "removal period" for § 1231 purposes.
Leslie is currently detained "pre-removal" pursuant to § 1226. Having determined that Leslie was also detained under § 1226 during the stay of his removal, Leslie has been continually detained pursuant to § 1226 since March 28, 2008, a period of nearly four full years. The Diop framework guides our inquiry into whether detention under that statute is reasonable.
A comparison of Leslie's detention to Diop's makes clear that Leslie's detention is unreasonable. In the present case, Leslie has been detained over a year longer than Diop had been. Although Leslie has requested and received a single continuance during that time, that continuance lasted for approximately five weeks, and cannot credibly be considered as a factor in the length of his detention. To the extent that his detention has exceeded the expected five month period for an appealed removal case, that extra time has been the result of appeals in which Leslie has prevailed; his initial appeal to this court was pending for nearly two years. Following this court's order in that appeal, Leslie's next hearing was not scheduled for almost *271 seven months, and following that hearing, approximately six months passed during the pendency of Leslie's appeal to the BIA, which was delayed and ultimately remanded for further proceedings, due entirely to clerical errors made by the immigration judge. "Although an alien may be responsible for seeking relief, he is not responsible for the amount of time that such determinations may take." Ly v. Hansen, 351 F.3d 263, 272 (6th Cir.2003).
In short, over the course of his nearly four year detention, Leslie is responsible for a five week delay for unspecified medical reasons, and for the delay caused by his pursuit of bona fide legal challenges to his removal. To conclude that Leslie's voluntary pursuit of such challenges renders the corresponding increase in time of detention reasonable, would "effectively punish [Leslie] for pursuing applicable legal remedies," Oyedeji v. Ashcroft, 332 F.Supp.2d 747, 753 (M.D.Pa.2004), and we decline the government's invitation to adopt such a position.
We therefore hold that Leslie's detention is unreasonably long, and he is therefore entitled to "an individualized inquiry into whether detention is still necessary to fulfill the statute's purposes of ensuring that an alien attends removal proceedings and that his release will not pose a danger to the community." Diop, 656 F.3d at 231.[6]

III.
For the foregoing reasons, the District Court's order denying Leslie's petition for a Writ of Habeas Corpus will be reversed, and Leslie's appeal will be remanded to the District Court with instructions to conduct an individualized bond hearing as required by Diop within ten days of the date when this opinion and order are filed.
NOTES
[1]  With leave of this court, the American Civil Liberties Union Foundation and the American Civil Liberties Union Foundation of Pennsylvania ("ACLU") entered this matter as amici curiae.
[2]  The record reveals that on November 16, 2009, a post order custody review was held by DHS, which the government represents as a "bond hearing." Leslie represents, however, that he was not present, that a hearing was not held, and that he could not pay the $20,000 decreed as bond required. We cannot regard a proceeding at which neither Leslie nor counsel representing Leslie was present as a bond hearing.
[3]  Leslie also argues that the District Court erred in referring his habeas petition to a magistrate judge to prepare a report and recommendation. Leslie claims, inter alia, that the referral to a magistrate judge for a report and recommendation violated his due process rights because he did not consent to it and that the District Court abused its discretion in adopting that report and recommendation. This argument is without merit; Local Rule 73.1(d) for the Middle District of Pennsylvania provides that civil cases "may be referred to a magistrate judge at the time of the filing of the complaint under the rotational assignment plan of the court and, at the same time, will be assigned to a district court judge. The magistrate judge, independent of the parties' consent, is authorized to exercise all the judicial authority that is provided for by law for a magistrate judge." Further, under Local Rule 72.3, after a magistrate judge issues a report and recommendation, the parties have an opportunity to file objections to it. Thereafter, under Local Rule 72.3, the District Court judge to whom the case is assigned must "make a de novo determination of those portions of the report or specified proposed findings or recommendations to which objection is made and may accept, reject, or modify, in whole or in part, the findings or recommendations made by the magistrate judge."

In this case, Leslie's petition was assigned to Judge Conaboy and referred to Magistrate Judge Martin C. Carlson. After Magistrate Judge Carlson issued his report and recommendation, Leslie made objections to it, and Judge Conaboy properly considered de novo those portions of the recommendation to which those objections pertained. All of the procedural requirements for referral to a magistrate judge were properly followed below; no consent from Leslie was required to allow the magistrate judge to prepare his report and recommendation, nor did Judge Conaboy abuse his discretion in adopting Magistrate Judge Carlson's report and recommendation.
[4]  Diop v. ICE/Homeland Sec., 656 F.3d 221, 231 (3d Cir.2011) was not filed until after the District Court judge in this case had rendered his opinion, so that he could not have known about our analysis.
[5]  Judge Sloviter concurs in the result of the majority opinion and states: "I note with concern the failure of the Attorney General to cite 8 U.S.C. § 1252(b)(8) or to discuss its applicability, if any, to the issues before us."
[6]  See footnote 4 of this opinion.
