; and (3) has a legal parent-child relationship to an alien who entered the United States with the alien child at or between designated ports of entry and who was detained. 603. Temporary detention policy for families entering this country illegally (a) The Secretary of Homeland Security (Secretary), shall, to the extent permitted by law and subject to the availability of appropriations, maintain custody of alien families during the pendency of any criminal improper entry or immigration proceedings involving their members. (b) The Secretary shall not, however, detain an alien family together when there is a concern that detention of an alien child with the child's alien parent would pose a risk to the child's welfare. (c) The Secretary of Defense shall take all legally available measures to provide to the Secretary, upon request, any existing facilities available for the housing and care of alien families, and shall construct such facilities if necessary and consistent with law. The Secretary, to the extent permitted by law, shall be responsible for reimbursement for the use of these facilities. (d) Heads of executive departments and agencies shall, to the extent consistent with law, make available to the Secretary, for the housing and care of alien families pending court proceedings for improper entry, any facilities that are appropriate for such purposes. The Secretary, to the extent permitted by law, shall be responsible for reimbursement for the use of these facilities. (e) The Attorney General shall promptly file a request with the U.S. District Court for the Central District of California to modify the Settlement Agreement in Flores v. Sessions, CV 85–4544 ( Flores settlement ), in a manner that would permit the Secretary, under present resource constraints, to detain alien families together throughout the pendency of criminal proceedings for improper entry or any removal or other immigration proceedings. 604. Prioritization of immigration pro­ceed­ings involving alien families The Attorney General shall,