; and (B) by adding at the end the following: (f) Length of detention (1) In general An alien may be detained under this section, without limitation, until the alien is subject to an administratively final order of removal. (2) Effect on detention under section 241 The length of detention under this section shall not affect the validity of any detention under section 241. . (d) Attorney general’s discretion in determining countries of removal Section 241(b) of the Immigration and Nationality Act ( 8 U.S.C. 1231(b) ) is amended— (1) in paragraph (1)(C)(iv), by striking the period at the end and inserting , or the Attorney General decides that removing the alien to the country is prejudicial to the interests of the United States. ; (2) in paragraph (2)(E)(vii), by inserting or the Attorney General decides that removing the alien to one or more of such countries is prejudicial to the interests of the United States, after this subparagraph, . (e) Effective dates and application (1) Amendments made by subsection (b) The amendments made by subsection (b) shall take effect on the date of the enactment of this Act, and section 241 of the Immigration and Nationality Act, as amended by subsection (b), shall apply to— (A) all aliens subject to a final administrative removal, deportation, or exclusion order that was issued before, on, or after the date of the enactment of this Act