Minors should, as a rule, not be detained. They should be placed in suitable accommodation with special provisions for minors, including where appropriate in non-custodial, community-based placements. Given the negative impact of detention on minors, such detention should only be used, in accordance with Union law, exclusively in exceptional circumstances, where strictly necessary, as a measure of last resort and for the shortest possible period of time, after it has been established that other less coercive alternative measures cannot be applied effectively, and after detention is assessed to be in their best interests. Minors should never be detained in prison or another facility used for law enforcement purposes. Minors should not be separated from their parents or care-givers, and the principle of family unity should generally lead to the use of adequate alternatives to detention for families with minors, in accommodation suitable for them. Moreover, everything possible should be done to ensure that a viable range of adequate alternatives to the detention of minors is available and accessible. In this context, Member States are to take into account the New York Declaration for Refugees and Migrants of 19 September 2016, relevant authoritative guidance by the United Nations’ treaty body on the 1989 United Nations Convention on the Rights of the Child and relevant case-law.