I. INTRODUCTION
This is a class action challenging an INS policy that requires governmental detention of children during the pendency of deportation proceedings. That policy is now codified at 8 C.F.R. § 242.24 (1988). Detention is required unless there is an adult relative or legal guardian available to assume custody, even where there is another responsible adult willing and able to care for the child and able to ensure the child’s attendance at a deportation hearing. The INS acknowledges that the regulation is not necessary to ensure such attendance. It does not contend that the release of children so detained would create a threat of harm to the children or to anyone else.
The district court held that a blanket detention policy in such circumstances is unlawful. It entered an order that required, where feasible, release to a responsible party of children who would otherwise have been released if a parent or other relative had come forward. The order further required an administrative hearing for each child to determine whether, and under what conditions, the child should be released.
The INS and Attorney General appealed and a divided panel reversed the district court’s holding that the detention policy was unlawful. The panel remanded for the district court to determine what procedural protections would be appropriate under Mathews v. Eldridge, 424 U.S. 319, 96 S.Ct. 893, 47 L.Ed.2d 18 (1976), to determine whether there was sufficient cause to detain a juvenile pending further proceedings. A majority of active judges voted to rehear the case en banc because of the importance of the issues involved and the impact of the policy on large numbers of children arrested as illegal aliens in the Western United States. We now affirm the district court’s order.
II. BACKGROUND
This case concerns the treatment of children who are arrested on suspicion of being illegal aliens but who have not yet been determined to be deportable. Because the children are persons present in the United States they must be afforded procedural protections in conjunction with any deprivation of liberty. Mathews v. Diaz, 426 U.S. *135567, 77, 96 S.Ct. 1883, 1890, 48 L.Ed.2d 478 (1976).
Plenary authority to determine what categories of aliens may lawfully reside in the United States and what categories must be deported resides in the Congress. Fiallo v. Bell, 430 U.S. 787, 792, 97 S.Ct. 1473, 1477, 52 L.Ed.2d 50 (1977). Congress has delegated the duties of the administration of the immigration laws to the Attorney General, who oversees the work of the Immigration and Naturalization Service. 8 U.S.C. § 1103(a) (granting the Attorney General authority to “establish such regulations ... as he deems necessary” to administer and enforce the immigration laws).
Only one relevant statutory provision addresses the release or detention of aliens between the time of their arrest and the determination of deportability or non-de-portability. That statute is 8 U.S.C. § 1252(a)(1), which in all material respects has remained the same for the last four decades. It presently provides:
Pending a determination of deportability ... [an] alien may, upon warrant of the Attorney General, be arrested and taken into custody_ [A]ny such alien ... may, in the discretion of the Attorney General and pending such final determination of deportability, (A) be continued in custody; or (B) be released under bond ... containing such conditions as the Attorney General may prescribe; or (C) be released on conditional parole.
To implement this statute, the Attorney General promulgated regulations in 1963, which are still in effect, providing that aliens arrested on the suspicion of deporta-bility could be released until further proceedings upon a determination that such release was appropriate, and under conditions determined by the INS. 8 C.F.R. § 242.2(c)(2). Upon request, an alien is entitled to a hearing before a disinterested officer, an immigration judge, to determine eligibility for release. 8 C.F.R. § 242.2(d).
In 1984, the Western Region of the INS adopted a separate policy for minors. That policy provided that minors would be released only to a parent or lawful guardian. In his memorandum implementing this policy, former Western Region Commissioner Harold Ezell stated that the limits on release were “necessary to assure that the minor’s welfare and safety is maintained and that the agency is protected against possible legal liability.” The policy also provided for release to another responsible adult “in unusual and extraordinary cases, at the discretion of a District Director or Chief Patrol Agent.” The Regional Commissioner did not refer to any problems that had arisen under existing regulations. He did not cite any instances of harm which had befallen children released to unrelated adults, nor did he make any reference to suits that had been filed against the INS arising out of allegedly improper releases. It has remained undisputed throughout this proceeding that the blanket detention policy is not necessary to ensure the attendance of children at deportation hearings.
Implementation of this policy sparked concern in a number of quarters because the policy resulted in the governmental detention of a large number of children who posed no apparent risk to the community and whose presence at their respective hearings could be ensured by responsible individuals. Various individuals and groups, including many appearing as amici in this rehearing en banc, were among those who reacted adversely to the new policy. These included church groups, Amnesty International, Lawyers’ Committee for Human Rights, International Human Rights Law Group and Defense for Children International.
During the course of this litigation, the INS codified the regional policy into the nationally applicable regulation now at issue. In promulgating that regulation, the INS did not refer to any particular problem that had arisen in the course of administering the immigration laws as they affected children. Rather, it simply cited the “dramatic increase in the number of juvenile aliens” found unaccompanied by a parent, guardian or a adult relative. 53 Fed.Reg. 17,449 (May 17, 1988). The regulation allows release to a somewhat broader class of people than did the Western Region *1356policy, i.e., a variety of adult relatives as opposed to just parents and legal guardians, but it prohibits release in cases where other responsible adults are available to take custody of the minor. It permits release to unrelated adults only in “unusual and compelling circumstances.” 8 C.F.R. § 242.24.1
In promulgating the regulation, the INS recognized that the principal factor bearing on release or detention is the likelihood of appearance at future proceedings. It also recognized that the policy of preventing release to responsible adults was not related to the issue of flight risk or the administration of any provision of the immigration laws. Its principal justification for the detention rule was the theory that unless the INS were able to do a comprehensive “home study” of the proposed custodian, the child’s own interests would be better served by detention. The INS stated:
As with adults, the decision of whether to detain or release a juvenile depends on the likelihood that the alien will appear for all future proceedings. However, with respect to juveniles a determination must also be made as to whose custody the juvenile should be released. On the one hand, the concern for the welfare of the juvenile will not permit release to
Detention and release of juveniles.
(a) Juveniles. A juvenile is defined as an alien under the age of eighteen (18) years.
(b) Release. Juveniles for whom bond has been posted, for whom parole has been authorized, or who have been ordered released on recognizance, shall be released pursuant to the following guidelines:
(1) Juveniles shall be released, in order of preference, to: (i) A parent; (ii) legal guardian; or (iii) adult relative (brother, sister, aunt, uncle, grandparent) who are not presently in INS detention, unless a determination is made that the detention of such juvenile is required to secure his timely appearance before the Service or the immigration court or to ensure the juvenile’s safety or that of others.
In cases where the parent, legal guardian or adult relative resides at a location distant from where the juvenile is detained, he or she may secure release at an INS office located near the parent, legal guardian, or adult relative.
(2) If an individual specified in paragraph (b)(1) of this section cannot be located to accept custody of a juvenile, and the juvenile has identified a parent, legal guardian, or adult relative in INS detention, simultaneous release of the juvenile and the parent, legal guardian, or adult relative shall be evaluated on a discretionary case-by-case basis.
(3) In cases where the parent or legal guardian is in INS detention or outside the United States, the juvenile may be released to such person as designated by the parent or legal guardian in a sworn affidavit, executed before an immigration officer or consular officer, as capable and willing to care for the juvenile’s well-being. Such person must execute an agreement to care for the juvenile and to ensure the juvenile’s presence at all future proceedings before the Service or an immigration judge.
(4) In unusual and compelling circumstances and in the discretion of the district director or chief patrol agent, a juvenile may be released to an adult, other than those identified in paragraph (b)(1) of this section, who executes an agreement to care for the juvenile’s well-being and to ensure the juvenile’s presence at all future proceedings before the INS or an immigration judge.
****** just any adult. On the other hand, the Service has neither the expertise nor the resources to conduct home studies for placement of each juvenile released.
53 Fed.Reg. at 17,449.
In response to comments suggesting that release to responsible adults should be permitted on a regular basis, the INS stated that it did not have the resources or expertise necessary to make a determination, in each case, whether release to the adult in question would be in the child’s best interests. 53 Fed.Reg. at 17,449. The INS did not state any basis for its assumption that home studies would have to be conducted. Nor did the INS indicate that it had conducted such studies before releasing children to unrelated adults prior to the promulgation of this policy. Commenters also complained that the regulation’s provision that release to unrelated adults could occur in “unusual and compelling circumstances” was too vague to provide meaningful guidance. The INS responded that such vagueness was deliberate, designed to provide “the broadest possible discretion” to INS officials. Id. Finally, commenters suggested that the INS should permit individuals or organizations to act as intermediaries between the INS and the parent or *1357guardian of an alien child, to allow for release where that parent or guardian is afraid to come forward personally because of his or her own illegal alien status. After pointing out that “[t]his proposal raises some of the same concerns that release to any reliable adult raises, for example, the inability of the Service to perform home studies,” the INS concluded that it would “continue to consider the proposal,” but would promulgate the regulation without such a provision at this time. Id. at 17,450. The final regulation was approved on May 17, 1988.
The named plaintiffs, including named plaintiff Jenny Flores, filed the action on July 11, 1985, challenging the Western Region’s policy then in effect. These named plaintiffs represented a class of minors who do not pose a risk of flight or harm to the community, and have responsible third parties available to receive them, and are thus being detained only because no adult relative or legal guardian is available to take custody of them. Their complaint contained a number of claims. In the panel majority opinion, Judge Wallace described them as follows:
The first claim alleged that the Western Region’s bond release condition violated the Immigration & Nationality Act (INA), 8 U.S.C. § 1101 et seq., the Administrative Procedure Act (APA), 5 U.S.C. § 552 et seq., the fifth amendment’s due process clause and equal protection guarantee, and international law. Flores’s second claim challenged the INS’s failure to provide (1) “prompt written notice” to the detainee that the bond release condition had been imposed, and (2) “prompt, mandatory, neutral and detached” review following arrest of (a) whether probable cause to arrest existed, (b) whether imposition of the bond condition was necessary to ensure future appearance, and (c) whether any available adult was suitable to ensure the detained juvenile’s well-being and appearance at future proceedings. The second claim alleged that these failures violated due process and international law. Plaintiffs’ last five claims, which challenged various conditions of the minors’ confinement, ... were resolved by settlement or motion....
Flores v. Meese, 934 F.2d 991, 995 (9th Cir.1990) (as amended). After the policy originally in question was codified as a regulation, this litigation was maintained as a challenge to that regulation.
Between the time that the complaint was filed and the promulgation of the national regulation implementing the Western Region policy, the district court disposed of several motions. With respect to the limitation on release to parents or legal guardians, the court ruled the provision violated equal protection. It agreed with Flores that the INS’ practice of permitting alien minors in exclusion proceedings to be released to a broader class of adults than those in deportation proceedings was not supported by a rational justification. See 8 C.F.R. § 212.5(a)(2)(h) (1987) (alien minors in exclusion proceedings could be released to adult relatives or to non-relatives). When the INS promulgated the regulation here at issue, it amended the regulation regarding release of children in exclusion proceedings to incorporate by reference the same restrictions as those operative in the deportation context, thus mooting the district court’s ruling on this issue. See 8 C.F.R. § 212.5(a)(2)(h) (1988). The court still had under advisement various motions relating to the procedural implementation of the INS’ policy when the INS promulgated the official regulation.
Upon promulgation of the regulation, the district court asked for supplemental briefs and then entered an order granting summary judgment to the plaintiff class. The order invalidated the blanket detention of minors where a responsible adult could ensure attendance at the deportation hearing, and it required a hearing before a neutral and detached official in each case to determine whether release was appropriate and the conditions of release. The order provided:
1. Defendants ... shall release any minor otherwise eligible for release on bond or recognizance to his parents, guardian, custodian, conservator, or other responsible adult party. Prior to any such re*1358lease, the defendants may require from such persons a written promise to bring such minor before the appropriate officer or court when requested by the INS.
2. Whenever a minor is released as aforesaid, the minor shall be promptly advised in writing in a language he understands of any restrictions imposed upon his release.
3. Any minor taken into custody shall be forthwith afforded an administrative hearing to determine probable cause for his arrest and the need for any restrictions placed upon his release. Such hearing shall be held with or without a request by or on behalf of the minor.
The Attorney General and INS appealed. The majority of the panel for our court vacated the first paragraph of the district court’s order, holding that the detention policy did not implicate any of the plaintiffs’ fundamental rights, and that due deference to the INS’ choices in implementing congressional immigration policy required approval of the INS detention policy restricting release. The majority characterized the right claimed by the class as a substantive due process right “to be released to an unrelated adult.” Slip op. at 10788. Finding that the Constitution does not guarantee such a right, the majority applied a highly deferential standard of review to what it saw as an exercise of the INS’ unique expertise and authority.
In considering the procedural aspects of the district court’s order as embodied in paragraph three, the panel majority remanded. It rejected the appellees’ contention that the fourth amendment requirement of review by a neutral and detached magistrate of probable cause for arrest, as the Supreme Court has enunciated in Gerstein v. Pugh, 420 U.S. 103, 95 S.Ct. 854, 43 L.Ed.2d 54 (1975), was applicable in the context of civil deportation proceedings. Rather, it chose as the appropriate model for procedural due process evaluation the balancing test outlined in Mathews v. Eldridge, 424 U.S. 319, 96 S.Ct. 893, 47 L.Ed.2d 18 (1976). That test would involve a balancing of the children’s interest in release to a responsible adult, which the majority viewed as not constitutionally protected, against the governmental interests, which it viewed as entitled to substantial deference.
Judge Fletcher, in dissent, described the case as “among the most disturbing I have confronted in my years on the court.” 934 F.2d at 1013. She characterized the district court’s order as a “simple, sensible, minimally intrusive direction,” id. at 1014, to protect the fundamental liberty interests of the plaintiffs who, in her view, should not be denied liberty when their “only possible offense is their alienage.” Id. at 1013.
In their petition for rehearing en banc, plaintiffs contend, inter alia, that the panel majority erred in failing to recognize their fundamental interest in liberty. It also erred, they argue, in holding that, under either Gerstein v. Pugh or Mathews v. Eldridge, any procedure other than an individual hearing before an independent officer could provide adequate protections for the right at stake.
Before us for decision are three principal sets of issues. The first involves the detention policy itself and whether it affects any constitutionally protected liberty interests of the plaintiffs. The second involves the nature of the federal governmental interest furthered by such a policy, the justifications set forth by the agency for such a policy and the extent to which we must defer to the agency in the promulgation of such policies. The third is whether, after examination of these issues, the appropriate procedural model for the determinations at issue is the criminal model of Ger-stein v. Pugh or the civil model of Mathews v. Eldridge, or indeed whether, in the context of this case, it makes any difference whether a criminal or civil model is chosen. Our discussion focuses on each of these areas in turn.
III. DISCUSSION
Defendants maintain that the plaintiffs’ liberty interests are limited because of their status as aliens and children. We therefore examine in some detail the manner in which courts and Congress deal with *1359the questions of rights of aliens and children.
A. Plaintiffs’ Interests as Aliens
The Constitution protects the rights of aliens to due process and equal protection. Yick Wo v. Hopkins, 118 U.S. 356, 6 S.Ct. 1064, 30 L.Ed. 220 (1886). Even illegal aliens enjoy the due process protections of the fifth amendment. Mathews v. Diaz, 426 U.S. 67, 77, 96 S.Ct. 1883, 1890, 48 L.Ed.2d 478 (1976). It is now well established that under these cases any person present in the United States is entitled to equal justice before the law, including procedural protections in conjunction with any deprivation of liberty, and freedom from invidious discrimination. See C. Antieau, 1 Modern Constitutional Law §§ 9:25—9:27 (1969 & Supp.1991).
A crucial component of the right to personal liberty is the ability to test the legality of any direct restraint that the government seeks to place on that liberty. This ability is guaranteed through the availability of the writ of habeas corpus to challenge the lawfulness of one’s imprisonment. The right to seek such a writ has its roots in English law that predates the formation of this nation. See Habeas Corpus Act of 1679, 31 Car. II Ch. 2. It was incorporated among the first rights guaranteed by the United States Constitution. U.S. Const, art. I, § 9. There thus can be no question that this right is a key part of the American legal system.
In any discussion of the constitutional guarantee of liberty, the importance of ha-beas corpus must not be understated. As one commentator has described it:
Over the centuries habeas corpus has been the common-law world’s “freedom writ” by whose process the courts may require the production of all prisoners and inquire into the legality of their incarceration, failing which they have been set free. Of the writ of habeas corpus, the United States Supreme Court has appropriately noted: “There is no higher duty than to maintain it unimpaired.”
1 Modern Constitutional Law § 5:148 at 436 (quoting Bowen v. Johnston, 306 U.S. 19, 26, 59 S.Ct. 442, 446, 83 L.Ed. 455 (1939)). For this reason, to assess the nature of an alien’s liberty interest, it is appropriate to look to the extent courts have historically recognized such an interest through habeas corpus proceedings.
It has long been accepted that alien-age does not prevent a person from testing the legality of confinement through habeas corpus. See Wong Wing v. United States, 163 U.S. 228, 16 S.Ct. 977, 41 L.Ed. 140 (1896). Indeed, even a would-be immigrant who is prevented from landing in the United States and is, in that way, deprived of liberty “is doubtless entitled to a writ of habeas corpus to ascertain whether the restraint is lawful.” Nishimura Ekiu v. United States, 142 U.S. 651, 660, 12 S.Ct. 336, 338, 35 L.Ed. 1146 (1892). Thus, the status of the plaintiff class in this case as aliens whose presence in this country might be illegal does not affect their right to put the government to its proof concerning the legality of their detention.
That the detention at issue here is a civil detention imposed in the course of administering the immigration laws does not alter the relevance of the principles of habeas corpus. Still the leading case involving a test of the legality of detention under immigration laws is Carlson v. London, 342 U.S. 524, 72 S.Ct. 525, 96 L.Ed. 547 (1952). In that case, the Supreme Court dealt with a petition for habeas corpus by aliens detained prior to deportation under the Internal Security Act of 1950, because of their membership in the Communist Party of the United States. Noting that “[djeportation is not a criminal proceeding” and thus the detention at issue was administrative, not punitive, 342 U.S. at 538, 72 S.Ct. at 533, the Court nevertheless employed habeas corpus review as the appropriate means for the individual aliens to challenge their detention.
The petitioners in Carlson challenged their pre-deportation detention on the ground that there had been no sufficient showing that they presented an actual risk of flight or harm to the community if released pending further proceedings. Rather, they were denied release on a finding *1360that each was an active member of the Communist party. This finding, they argued, was not sufficient to support detention. See 342 U.S. at 533-34, 72 S.Ct. at 530-31.
The Court rejected this argument on the ground that the decision to detain them based on their active membership in the Communist party was made through an exercise of the discretion delegated to the Attorney General under the immigration laws. The delegated discretion was to determine which aliens pose a threat of harm to the community. The Court held that detention based on Communist party membership and activity was not an abuse of that discretion. The Court noted that the evidence went “beyond unexplained membership and show[ed] a degree ... of participation in Communist activities.” 342 U.S. at 541, 72 S.Ct. at 534. Because the Court also agreed with the INS that “the doctrines and practices of Communism clearly enough teach the use of force to achieve political control,” id. at 535-36, 72 S.Ct. at 532, it found that the detention of the petitioners was proper since they posed “a menace to the public interest.” Id. at 541, 72 S.Ct. at 535.
The Court was careful to observe, however, that the discretion of the Attorney General was not without bounds. The INS policy in Carlson did not amount to blanket detention. The Court pointed out that there was “no evidence or contention that all persons arrested as deportable ... for Communist membership are denied bail.” Id. at 541-42, 72 S.Ct. at 535. It went on to note that the evidence before it indeed illustrated that release pending further proceedings was granted “in the large majority of cases.” Id. at 542, 72 S.Ct. at 535.
The most recent comprehensive Supreme Court discussion of an individual’s interest in liberty is set in the context of adults held in pretrial detention without regard to citizenship. United States v. Salerno, 481 U.S. 739, 107 S.Ct. 2095, 95 L.Ed.2d 697 (1987). The Court there recognized “the individual’s strong interest in liberty,” which it characterized as a “fundamental” right with which Congress could interfere only with a “careful delineation of the circumstances under which detention will be permitted....” 481 U.S. at 750-51, 107 S.Ct. at 2103. Detention was justified only by clear and convincing evidence that the arrestee presented “an identified and artic-ulable threat to an individual or the com-munity_” Id. at 751, 107 S.Ct. at 2103. Significantly, the Court drew a parallel between the detention at issue in Carlson and that challenged in Salerno by noting that the Carlson petitioners were permissibly detained during the pendency of deportation proceedings because they were “potentially dangerous.” 481 U.S. at 748, 107 S.Ct. at 2102. It did not in any way suggest that aliens’ liberty interests were any less fundamental than those of citizens.
History may have passed Carlson by in some respects, particularly in its assessment of the danger attending political activity, but the case, in significant respects relevant to this case, provides guidance. Carlson holds that under our Constitution and an Immigration Act materially the same as the current one, the INS cannot detain individuals without a particularized exercise of discretion through which it determines that detention of an individual would prevent harm to the community or further some other important governmental interest Congress has delegated to the INS. See also C. Gordon and S. Mailman, 1 Immigration Law and Procedure § 1.03[7][d] (1988) (“the alien in deportation proceedings may be detained or required to post bond only upon a finding that he is a threat to the national security or likely to abscond.”).
Thus, we must hold that aliens have a fundamental right to be free from governmental detention unless there is a determination that such detention furthers a significant governmental interest. That right is secured by the Constitution in its enumerated guarantee of habeas corpus to all individuals, including aliens, to test the validity of their detention through judicial scrutiny of the basis for confinement at the hands of the government. See Salerno, 481 U.S. 739, 107 S.Ct. 2095; Carlson, 342 *1361U.S. 524, 72 S.Ct. 525; Wong Wing, 163 U.S. 228, 16 S.Ct. 977.
B. Plaintiffs’ Interests as Children
The plaintiffs are not only aliens; they are also minors. The INS contends that this factor materially changes the nature of their liberty interest, thereby rendering the detention policy reasonable and appropriate. We therefore turn to the question of what effect the juvenile status of these plaintiffs may have on the analysis of their liberty interests and the protections that must be given to those interests.
The Constitution protects the rights of children to due process of law in conjunction with any deprivation of liberty. In re Gault, 387 U.S. 1, 87 S.Ct. 1428, 18 L.Ed.2d 527 (1967). While a child accused of an offense may be subject to pretrial detention based on a determination that release is not safe for the child, such a determination has been held to meet the mandates of due process only where made by a neutral and detached official, with the justifications for detention clearly stated. Schall v. Martin, 467 U.S. 253, 104 S.Ct. 2403, 81 L.Ed.2d 207 (1984). This holding is in keeping with the general rule that freedom from institutional confinement should be the norm, from which any deviation must be supported with specific reasons. As one set of commentators has observed, a child’s “right to be treated in the manner least restrictive to the child’s liberty ... has its roots in the well-settled concept that, while constitutional rights may be restricted by the state for legitimate purposes, the restriction must be no greater than necessary to achieve these purposes.” R. Horowitz and H. Davidson, Legal Rights of Children § 10.10 at 431 (1984). This proposition flows from the Supreme Court’s general pronouncement that “even though the governmental purpose be legitimate and substantial, that purpose cannot be pursued by means that broadly stifle fundamental personal liberties when the end can be more narrowly achieved. The breadth of legislative abridgment must be viewed in the light of less drastic means for achieving the same basic purpose.” Shelton v. Tucker, 364 U.S. 479, 488, 81 S.Ct. 247, 252, 5 L.Ed.2d 231 (1960) (footnotes omitted). Under these principles, governmental confinement of a child to an institution should be a last resort.
Policies constructed to deal with the confinement of children at both the state and federal levels have recognized the practical need to avoid institutional detention where less restrictive means are available. It is the states, rather than the federal government, which are primarily responsible for child welfare issues. State courts have articulated the view that institutional confinement should be used only when another type of placement such as foster care is not possible. See, e.g., R.P. v. State, 718 P.2d 168 (Alaska App.1986) (state must prove by a preponderance of the evidence that less restrictive alternatives are not possible); In re John H., 48 A.D.2d 879, 369 N.Y.S.2d 196 (1975) (other options must first be fully explored). In addition to protecting any constitutional interests of the children, this avoidance of institutionalization is seen to serve their best interests. See generally S. Davis, Rights of Juveniles § 6.3 (1990) (discussing states’ attempts to ensure that a child benefits in some way from whatever type of placement is ultimately chosen).
Congressional policy, where relevant, also favors avoidance of the institutionalization of juveniles. The federal government does have the occasion to process juvenile offenders when, for example, they violate federal laws or commit crimes on Indian reservations. In such situations, the Federal Juvenile Delinquency Act, 18 U.S.C. §§ 5031 et seq., governs the treatment of the offenders. That Act’s provisions regarding detention specify that it should occur in “a foster home or community based facility” instead of an institution, if possible. 18 U.S.C. § 5035 (regarding pre-disposition detention); 18 U.S.C. § 5039 (regarding detention after disposition). These provisions evidence an understanding that the juvenile’s liberty should be curtailed only by the least restrictive means necessary to achieve the purpose at hand, and that the interests of juveniles and of society are best served by keeping *1362such offenders in homes rather than in institutions whenever practicable.
The foregoing analysis compels the conclusion that, just as the plaintiffs’ entitlement to liberty absent a valid, particularized basis for confinement does not diminish due to their alienage, their minority does not materially change the nature of that entitlement. The INS is therefore incorrect when it asserts that plaintiffs have no fundamental liberty interest at stake. The INS is also incorrect in asserting that to prevail, the plaintiffs must be able to find in the Constitution itself, or law interpreting the Constitution, an express recognition of a “substantive due process right to be released to an unrelated adult.” Such release is not the constitutional interest being secured. It is the remedy the district court imposed after ruling that the defendant’s policy unconstitutionally interfered with plaintiffs’ interest in freedom from unjustified governmental detention.
Whether the imposition of such a remedy was appropriate depends upon whether the detention serves a significant federal governmental purpose. It is to that issue that we now turn.
C. Government Purposes Involved
This case is unprecedented in that it involves post-arrest detention of persons who have not been convicted of any crime, do not pose a risk of flight, and who have not been determined to present any threat of harm to themselves or to the community. Whatever purposes detention serves, they do not relate to punishment, to the need for attendance at further proceedings, or to avoidance of an identifiable risk of harm. Contrast Salerno, 481 U.S. 739, 107 S.Ct. 2095; Schall, 467 U.S. 253, 104 S.Ct. 2403; Carlson, 342 U.S. 524, 72 S.Ct. 525.
The INS articulates two reasons for the detention. First, the INS suggests that the child’s interests would be better served by detention than by release to a responsible adult whose living environment the INS does not have the means to investigate. Second, it asserts that the policy is necessary to protect it from potential liability in the event some harm should befall the child after release.
The INS does not articulate any legal basis for its position that these are valid INS concerns. The first flies in the face of the Supreme Court’s ruling in Gault that children should be treated in a manner least restrictive of liberty. It also expresses a view contrary to the Supreme Court’s decision in Schall, which required a foreseeable risk of harm to justify detention. While the Supreme Court in Schall recognized that a child, because of a lack of maturity, should have some adult custody and care, 467 U.S. at 265, 104 S.Ct. at 2410, it did not remotely suggest that there may be a presumption in favor of governmental detention as serving the best interests of the child.
The INS in essence maintains, however, that we should not look behind their articulation of concerns because we must defer to any such articulation. Agencies are, of course, entitled to some deference when they make determinations that relate to an area of their special expertise. See United States v. Shimer, 367 U.S. 374, 383, 81 S.Ct. 1554, 1560, 6 L.Ed.2d 908 (1961). In the immigration field, then, courts owe deference to decisions of the INS where its special experience and authority in the area of alienage are called into play. See Carlson, 342 U.S. at 540-41, 72 S.Ct. at 534-35.
The justifications asserted here, however, relate to child welfare and the potential liability of child welfare agencies. Child welfare is not an area of INS. expertise and its decisions in this area are not entitled to any deference. See Hampton v. Mow Sun Wong, 426 U.S. 88, 114-15, 96 S.Ct. 1895, 1910-11, 48 L.Ed.2d 495 (1976) (court does not defer to agency determination in area outside of agency’s expertise). Nor does this policy carry out any express congressional directive. Rather, the policy is contrary to Congress’ determination that institutional detention of juveniles is disfavored. See 18 U.S.C. §§ 5035; 5039. One of the very reasons the INS gives for detaining the plaintiffs is that it does not have the expertise, and Congress has not given it the resources, to do the kind of *1363evaluation of foster care facilities that state child welfare agencies do on a routine basis. The INS reasons that since it is unable to do such an evaluation, the best interests of the child must lie in detention rather than in release. The Constitution requires the opposite conclusion. See Gault, 387 U.S. 1, 87 S.Ct. 1428. We therefore hold that the INS may not determine that detention serves the best interests of members of the plaintiff class in the absence of affirmative evidence that release would place the particular child in danger of some harm.
Our conclusion that the INS cannot maintain a blanket policy of detention thus does not absolve the INS from the responsibility of making individualized decisions concerning the fate of children it has arrested. Due process requires a particularized exercise of discretion in conjunction with the decision to grant or deny release to any alien. See Carlson, 342 U.S. at 542, 72 S.Ct. at 535. It is, of course, within the purview of the INS to determine whether or not the person available to assume custody will ensure the child’s attendance at future proceedings. It is also within the purview of the INS to determine on the basis of the particular case whether release of the child poses a danger to the community or could result in harm to the child. The blanket refusal to make individualized determinations in the guise of administrative expediency, however, cannot pass constitutional muster. See, e.g., Reed v. Reed, 404 U.S. 71, 76-77, 92 S.Ct. 251, 254, 30 L.Ed.2d 225 (1971) (administrative convenience does not justify a policy that otherwise runs afoul of the Constitution).
The INS’ secondary justification for its detention policy is that if it released a child to an unrelated adult based on a determination short of a detailed “home study,” it could be subject to liability in the event that some harm befell the child. The INS does not specify the source of such liability.
We find little indication that the INS would be subject to liability for releasing a minor to an unrelated adult without a “home study.” Such a “study” is con-cededly beyond the expertise of the Service. The Supreme Court’s holding in Bivens v. Six Unknown Named Agents of the Fed. Bureau of Narcotics, 403 U.S. 388, 91 S.Ct. 1999, 29 L.Ed.2d 619 (1971), would give an individual a cause of action against the INS for a violation of constitutional rights, an action analogous to the cause of action available through 42 U.S.C. § 1983 against those who violate federal rights under color of state law. The Supreme Court has recently held, however, that a state agency, with far more expertise in child welfare than the INS, could not be held liable under section 1983 for allowing a child to remain in the custody of an adult despite clear evidence that such custody placed the child in danger. DeShaney v. Winnebago County Dept. of Social Services, 489 U.S. 189, 109 S.Ct. 998, 103 L.Ed.2d 249 (1989). The Court concluded that the actions of a private citizen could not form a basis for liability of the Department under section 1983. It did not matter, the Court held, that the child had formerly been in state custody, because “the State does not become the permanent guarantor of an individual’s safety by having once offered him shelter.” Id. at 201, 109 S.Ct. at 1006.2
Decisions before and since DeShaney, as well as DeShaney itself, compel the conclusion that governmental agencies face far greater exposure to liability by maintaining a special custodial relationship than by releasing children from the constraints of governmental custody. See DeShaney, 489 U.S. at 200-201, 109 S.Ct. at 1005-06 (emphasizing that absence of duty on the part of the state to ensure child’s safety arose from the fact that the plaintiff was not in the state’s custody at the time of the injury); Youngberg v. Romeo, 457 U.S. *1364307, 316-17, 102 S.Ct. 2452, 2458-59, 73 L.Ed.2d 28 (1982) (when individual is in state custody, state may acquire constitutional duty to ensure individual's safe care); Lashawn A. v. Dixon, 762 F.Supp. 959, 996 (D.D.C.1991) (under DeShaney and Young-berg, state agency may be liable for constitutional tort where it fails to provide adequately for the safety and well being of children in its custody). We reject the INS’ claim that it must detain these children to avoid lawsuits. In so doing, we follow the lead of the Supreme Court, which has recently refused to uphold an argument that possible tort liability justified a policy that violated the rights of individuals, where such liability was “remote at best.” International Union, UAW v. Johnson Controls, Inc., — U.S. -, 111 S.Ct. 1196, 1208, 113 L.Ed.2d 158 (1991).
We therefore conclude that the first paragraph of the district court’s order is an appropriate means to prevent incarceration of juveniles where such incarceration serves no legitimate purpose of the INS. It provides that release to a responsible adult shall occur only if the child would have otherwise been eligible for release to a relative under the challenged policy. It takes into account the need to secure attendance at immigration proceedings, and does not foreclose the ability of the INS to order detention if there are other, valid reasons for detention. In addition, by specifying that where there is no relative or legal guardian available release may be made to a “responsible” party, it allows room for the INS to make the necessary determination of whether a party who is willing to assume custody of the child is fit to do so.
D. Procedural Due Process and Part Three of the District Court’s Order
From the beginning of this litigation the parties have disputed whether the determination of what process is due in conjunction with the decision to detain members of the plaintiff class should be made pursuant to Gerstein, 420 U.S. 103, 95 S.Ct. 854, or Mathews, 424 U.S. 319, 96 S.Ct. 893. In Gerstein, the Court determined that a “timely judicial determination” was a mandatory prerequisite to pretrial detention in the criminal context. 420 U.S. at 126, 95 S.Ct. at 869. In Mathews, the Court articulated a three-factor analysis designed to be applicable generally to questions of due process in conjunction with administrative actions. A reviewing court must consider first the private interest that the action affects, second the risk that the procedures currently utilized will result in an erroneous deprivation of that interest and the extent to which that risk could be lessened by the addition of more safeguards, and third the government’s interest in maintaining the current procedures. 424 U.S. at 335, 96 S.Ct. at 903. The plaintiffs have urged that Gerstein be followed, while the INS has argued that Mathews provides the proper mode of analysis.
Because we have held that the plaintiffs’ interest in freedom from detention requires that the decision to detain be made only in conjunction with a neutral and detached determination of necessity, we must affirm Part Three of the district court’s order regardless of whether we apply Mathews or Gerstein. In so doing, we note that under current regulations, the INS is already required to maintain the mechanisms for providing review by an Immigration Judge of any decision to detain an alien or of conditions imposed on the release of such alien, if the alien requests such a hearing. See 8 C.F.R. § 242.2(d). The only new requirements that Part Three of the district court’s order places on the INS are that, if the alien is a child, such a hearing must be held regardless of whether the alien requests it, and the determination at the hearing must include an inquiry into whether any non-relative who offers to take custody represents a danger to the child’s well being. The first of these additional requirements is reasonable because the members of the plaintiff class, as children, are less capable than others of understanding what they are waiving by failing to request a hearing. The second is reasonable in light of the private interest at stake. We therefore conclude that Part *1365Three of the district court’s order provides the appropriate procedural safeguards for the deprivation here at issue, and accordingly uphold it.
IY. CONCLUSION
The district court correctly held that the blanket detention policy is unlawful. The district court’s order appropriately requires children to be released to a responsible adult where no relative or legal guardian is available, and mandates a hearing before an immigration judge for the determination of the terms and conditions of release.
The majority panel opinion is VACATED and the order of Judge Kelleher is AFFIRMED in all respects.
. The regulation provides in full as follows:
. A state would of course face a somewhat greater threat of liability after releasing a child to the custody of a responsible third party as opposed to the custody of a parent as in DeSha-ney. This is because the state would have acted affirmatively to place the child in a home from which the child had not originally come, as opposed to returning the child to the same home and assuring placement in “no worse position than that in which he would have been had [the state] not acted at all.” Id. at 201, 109 S.Ct. at 1006.