; and (ii) by striking subparagraph (C); (C) by redesignating paragraph (3) as paragraph (5); and (D) by inserting after paragraph (2) the following: (3) Return to foreign territory contiguous to the United States (A) In general The Secretary of Homeland Security may return to a foreign territory contiguous to the United States any alien arriving on land from that territory (whether or not at a designated port of entry) pending a proceeding under section 240 or review of a determination under subsection (b)(1)(B)(iii)(III). (B) Mandatory return If at any time the Secretary of Homeland Security cannot— (i) comply with its obligations to detain an alien as required under clause (ii) and (iii)(IV) of subsection (b)(1)(B) and subsection (b)(2)(A); or (ii) remove an alien to a country described in section 208(a)(2)(A), the Secretary of Homeland Security shall, without exception, including pursuant to parole or release pursuant to section 236(a) but excluding as expressly authorized pursuant to section 212(d)(5), return to a foreign territory contiguous to the United States any alien arriving on land from that territory (whether or not at a designated port of entry) pending a proceeding under section 240 or review of a determination under subsection (b)(1)(B)(iii)(III). (4) Enforcement by state attorneys general The attorney general of a State, or other authorized State officer, alleging a violation of the detention, return, or removal requirements under paragraph (1), (2), or (3) that affects such State or its residents, may bring an action against the Secretary of Homeland Security on behalf of the residents of the State in an appropriate United States district court to obtain appropriate injunctive relief.