; and (B) (i) apprehended at or near the international border of the United States; or (ii) seeking admission to the United States at a port of entry. (2) Family unit residential centers (A) In general Except as provided in subparagraph (B), the Secretary of Homeland Security shall temporarily house an alien child under the age of 18 years described in paragraph (1) together with the parent of the child in a family residential center maintained by the Secretary of Homeland Security during the pendency of civil or criminal proceedings. (B) Exception The Secretary of Home­land Security shall not temporarily house an alien child described in subparagraph (A) in the manner described in that subparagraph if the Secretary of Homeland Security— (i) is unable to verify that an individual accompanying the alien child is the parent of the alien child; (ii) determines that the accompanying parent of the alien child— (I) has a violent criminal history; or (II) has committed or been convicted of— (aa) an aggravated felony under section 101(a)(43); (bb) a crime involving the attempted use of physical force or threatened use of a deadly weapon; (cc) an assault resulting in bodily injury (as defined in section 2266 of title 18, United States Code); or (dd) an offense described in section 212(a)(2) or 237(a)(2); (iii) determines that the alien child is or has been a victim of domestic abuse or sexual abuse; or (iv) the alien child is— (I) a victim of trafficking; (II) at risk of becoming a victim of trafficking; (III) in danger of abuse or neglect at the hands of the accompanying parent of the alien child; or (IV) a danger to himself or herself or to others. (C) Conditions for custody The Secretary of Homeland Security shall ensure that each— (i) family residential facility is secure and safe; and (ii) alien child and accompanying parent at a family residential facility has— (I) suitable living accommodations; (II) access to drinking water and food; (III) medical assistance in case of emergencies