; (5) in subsection (e), by striking Attorney General’s and inserting Secretary of Homeland Security’s ; and (6) by adding at the end the following: (f) Length of detention (1) Notwithstanding any other provision of this section, an alien may be detained under this section for any period, without limitation, except as provided in subsection (h), until the alien is subject to a final order of removal. (2) The length of detention under this section shall not affect a detention under section 241. (g) Administrative review (1) Limitation The Attorney General’s review of the Secretary’s custody determinations under subsection (a) shall be limited to whether the alien may be detained, released on bond (of at least $1,500 with security approved by the Secretary), or released with no bond. Any review involving an alien described in paragraph (2)(D) shall be limited to a determination of whether the alien is properly included in such category. (2) Classes of aliens The Attorney General shall review the Secretary’s custody determinations for the following classes of aliens: (A) Aliens in exclusion proceedings. (B) Aliens described in sections 212(a)(3) and 237(a)(4). (C) Aliens described in subsection (c). (D) Aliens in deportation proceedings subject to section 242(a)(2) (as in effect between April 24, 1996, and April 1, 1997). (h) Release on bond (1) In general An alien detained under subsection (a) may seek release on bond. No bond may be granted except to an alien who establishes by clear and convincing evidence that the alien is not a flight risk or a risk to another person or the community. (2) Certain aliens ineligible No alien detained under subsection (c) may seek release on bond. . 4. Aliens ordered removed Section 241(a) of the Immigration and Nationality Act ( 8 U.S.C. 1231(a) ) is amended— (1) by striking Attorney General each place it appears, except for the first place it appears in paragraph (4)(B)(i), and inserting Secretary of Homeland Security