This appeal involves a constitutional challenge to a provision of the New York Family Court Act1 authorizing preventive detention of accused juvenile delinquents. It was brought in the District Court as a habeas corpus class action against the defendant Paul Strasburg, Commissioner of the New York City Department of Juvenile Justice, under 28 U.S.C. § 2254, Robert Abrams, Attorney General of the State of New York, intervening as a defendant. Judge Carter certified the class as “all juveniles who are now being held or will be held before these proceedings are concluded, in pretrial detention . . .,” under the challenged statute. A trial resulted in a record of documentary and testimonial evidence about the actual practice of the Family Court in utilizing preventive detention, including expert testimony by a Family Court Judge, statistical studies and a collection of representative case studies.
Judge Carter held the statute unconstitutional. 513 F.Supp. 691 (S.D.N.Y. 1981). He issued a judgment granting the writ to all juveniles detained under the challenged provisions at any time before conclusion of this action. Defendants appealed. We affirm on the grounds that the statutory scheme and practice under it violate the Due Process Clause of the Fourteenth Amendment in that the period of pre-trial detention is utilized principally to impose punishment before adjudication of the alleged criminal acts.
THE STATUTORY SCHEME SUMMARIZED
Since our decision rests on a belief that the Family Court Act does not accord procedural due process, it is important to understand the procedural structure of New York delinquency adjudications. Although these juvenile proceedings are somewhat *367different from adult criminal proceedings in both ends and means, their major procedural stages have analogues in the adult criminal justice process. A juvenile proceeding is initiated by a petition for delinquency,2 a step analogous to an indictment. The case then goes to fact-finding before a Family Court Judge, at which time the juvenile is either adjudicated a delinquent or the petition is dismissed.3 The analogue in the criminal law is, of course, the trial and verdict. The final stage is a determination of the disposition by a Family Court Judge,4 analogous in the criminal law to adult sentencing. We set out these analogues, not to argue that the constitutional limitations on juvenile courts are identical to those imposed on adult criminal tribunals, but solely to facilitate an understanding of the result we reach.
The statutory scheme can be summarized as follows. The challenged provision is Section 739(a)(ii). It authorizes detention of a juvenile after filing of a petition, but before fact-finding, when a Family Court Judge determines “there is a serious risk that [the juvenile] may before the return date do an act which if committed by an adult would constitute a crime.” Juveniles detained under 739(a)(ii) are entitled to a probable cause hearing within three to six days and an expedited fact-finding hearing.5 If delinquency is adjudicated at fact-finding, a probation investigation and, in the case of “designated felony acts,”6 a *368diagnostic assessment7 precede the dispositional hearing. The Family Court Judge can choose among several alternative dispositions, including suspension of judgment,8 probation,9 placement at home or with other individuals,10 placement in a facility or school where treatment is available11 or restrictive placement (incarceration).12 The statutory criteria for determining the appropriate disposition emphasize the needs and best interests of the juvenile, the information provided by the probation investigation and diagnostic assessment, the character of the offense and the need for protection of the community.13 Some alternatives, however, are foreclosed or available only on a limited basis. The Family Court Judge has no option to transfer the juvenile to an adult criminal tribunal. In addition, placement in a treatment facility turns upon the availability of space and the consent of the particular facility.14 Even though a Family Court Judge may determine that placement for treatment is the appropriate disposition, therefore, the actual options in a particular case may be limited to probation or incarceration.
The statutory scheme thus contains facial incongruities. Preventive detention is authorized solely upon a finding that a juvenile may do an act in the interim between the petition and fact-finding which would be a crime if done by an adult. The potential crimes are not limited to felonies or violent crimes but include every act which constitutes a crime under the New York Penal Law.15 The statute itself offers no procedural safeguards and does not set out substantive criteria, other than the conclusory “serious risk” test, such as prior court contacts or lack of family supervision, to limit which accused juveniles may be detained.16 At disposition, on the other hand, elaborate statutory provision is made for collecting diagnostic and other information, and specific criteria are established to guide the Family Court Judge.17
THE STATUTORY SCHEME IN PRACTICE
The incongruities of the statutory scheme yield a paradoxical result in practice. The *369parties have waged a battle of statistics regarding the actual disposition of cases involving juveniles detained under 739(a)(ii).18 However, one critical fact has been established — the vast majority of juveniles detained under 739(a)(ii) either have their petitions dismissed before an adjudication of delinquency or are released after adjudication. Of the representative case studies submitted as evidence, for example, the defendants’ version of events indicates that well over two-thirds of the juveniles held under 739(a)(ii) were released at or before the dispositional hearing.19
The result in practice is that the vast majority of juveniles considered sufficiently dangerous by the Family Court to justify pre-trial incarceration under 739(a)(ii) are in fact released by prosecutors or by the Family Court within days or weeks. Defendants attribute this peculiar result to the statutory incongruities described above. Detention decisions under 739(a)(ii) emphasize crime prevention and are made on the basis of limited information presented in summary fashion. Dispositional determinations, on the other hand, take the juvenile’s welfare and potential for treatment into account and are based on more detailed and extensive information.
The defendants offered expert testimony by a Family Court Judge concerning the actual practice under the statutory scheme.20 He testified that the detention hearing under 739(a)(ii) usually involves only the Family Court Judge, a prosecutor, a Court Liaison Officer, the juvenile, his or her attorney, and the parents or their representative.21 It takes place soon after the arrest and a stenographic record is kept. In the typical case, the evidence before the *370Judge is limited to: (a) the petition for delinquency and an affidavit by a witness stating the petition is accurate; (b) a recommendation by the Court Liaison Officer to detain or release the juvenile based on inquiries and recommendations made by a probation officer who is usually not present; (c) statements by the juvenile or his or her attorney and by the parents or other persons accompanying the juvenile.22
The Family Court Judge testified that the criteria utilized in practice under 739(a)(ii) emphasize matters going solely to the protection of the community. These include prior record, recent court contacts, seriousness of the charge, and adequacy of supervision.23 He emphasized that the criteria do not include the interests of the child and often result in confinement under circumstances harmful to the juvenile.24 The same witness testified that the factors taken into account at the dispositional hearing differ substantially from those utilized at the 739(a)(ii) hearing. At disposition, the best interests of the child are the principal concern and further detention is regarded as a “harsh solution.”25 Moreover, considerably more information about the child is before the Family Court Judge at the dispositional hearing than is available at the 739(a)(ii) hearing. Not only is the information more complete and up-to-date, but psychological assessments are also provided.26
Two other facts influence the lenient disposition of adjudicated delinquents. First, as the evidence of the defendants demonstrated27 and as they emphasized at oral *371argument,28 the time served, including the preventive detention period, is frequently considered sufficient punishment by the Family Court. Juveniles detained under 739(a)(ii) may be held in a secure facility and exposed to assault and criminal subcultures.29 Family Court Judges who consider detention “harsh” in the first place and not in the juvenile’s interests, will understandably give great weight to prior confinement.
Second, as already noted, placement in a treatment facility, an intermediate disposition between probation and incarceration, is feasible only when a treatment facility has space and agrees to accept the child. In some cases, therefore, the Family Court Judge may face a choice between a disposition regarded as too lenient and another regarded as too harsh. The former may then be chosen as more likely to further the best interests of the child. The practical inability to provide placement in a treatment facility for criminally inclined juveniles has led to public expressions of frustration by Family Court Judges in response to criticisms of lenient dispositions.30
Prosecutors take into account judicial attitudes in the juvenile analogue to plea bargaining, and the dismissal rate is accelerated in the anticipation that particular juveniles will be released even if adjudicated delinquent. The record indicates that a large percentage of juveniles detained under 739(a)(ii) in fact have their petition dismissed before fact-finding. Of the case studies, the defendants’ version indicates that over one-third were released under such circumstances.31
The net result of this combination of statutory language and conscious judicial practice thus is that by far the greater number of juveniles incarcerated under 739(a)(ii) *372will never be confined as a consequence of a disposition imposed after an adjudication of delinquency, the usual course of events being either a dismissal before adjudication or release upon a post-adjudication dispositional hearing.32
DISCUSSION
The presumption of innocence and the requirement that guilt be proven beyond a reasonable doubt are important elements of Due Process itself, In re Winship, 397 U.S. 358, 90 S.Ct. 1068, 25 L.Ed.2d 368 (1970), which would be gravely diminished in the protection they afford if individuals can be routinely incarcerated pending trial. Even the most persuasive demonstration of innocence cannot prevent the deprivation of liberty if incarceration precedes, rather than follows, the adjudication of criminal liability.
The only exceptions presently recognized to this general rule appear to be brief detentions pending bail hearings, detention for failure to post bail subject to the Eighth Amendment’s prohibition on “excessive” bail, or in limited classes of cases, denial or revocation of bail. See generally C. White-bread, Criminal Procedure §§ 17.01-17.03 (1980).
The extent to which exceptions other than those relating to bail may be carved out is not clear. We believe all would agree, however, that any exception to the general rule that incarceration follow, rather than precede, adjudications of guilt can be justified, if at all, by a compelling governmental interest. Cf. Gerstein v. Pugh, 420 U.S. 103, 95 S.Ct. 854, 43 L.Ed.2d 54 (1975). The defendants argue, in the case of 739(a)(ii), that crime prevention is such an interest. That statute ostensibly responds to calls for preventive detention to protect the community from criminally inclined individuals. As conceived by its proponents, preventive detention is a method of confining inherently dangerous individuals accused of crimes pending trial and sentence of confinement. See Note, Preventive Detention Before Trial, 79 Harv. L. Rev. 1489, 1496-98 (1966). The underlying theory is not that propensity alone justifies confinement but that the expectation of an adjudication of guilt and subsequent sentence of confinement, along with a finding of propensity, justifies protecting the community from the individual in the interim period. Hruska, Preventive Detention: The Constitution and the Congress, 3 Creighton L. Rev. 36, 46 (1969). Such a scheme raises serious constitutional questions which the parties have asked us to address. We decline, however, to reach those issues because 739(a)(ii) is utilized principally, not for preventive purposes, but to impose punishment for unadjudicated criminal acts.
Crime prevention simply does not provide a justification for the detention of the vast majority of juveniles actually held under 739(a)(ii). Family Court Judges, we are told, release large numbers of detainees at disposition because much more information pertaining to the particular juvenile is available there than at the detention stage and because the Judges tend to find that the time already served is punishment enough. While the record is silent as to explanations for the similarly large number of prosecutorial dismissals before adjudication, it can be inferred that such cases as a class involve facts even less compelling as to guilt or appropriateness of further incarceration.
Accepting the defendants’ view, the vast majority, in all likelihood over two-thirds, of the 739(a)(ii) detainees fall into one or more of the following categories: (1) those against whom the evidence of guilt is weak or insufficient; (2) those who are not so dangerous that they cannot be released after a short period of detention; and (3) those who are regarded as having served enough time in confinement. Crime pre*373vention is not a sufficiently compelling governmental interest as to any of these detainees to justify shortcutting the fundamental procedural requirement that imprisonment follow, rather than precede, adjudication. Category (1) involves detainees ultimately released by prosecutorial dismissal or on a judicial finding of insufficient evidence. As to them, incarceration is imposed but guilt is never adjudicated. Category (2) involves detainees about whom a mistaken judgment was made in the course of the summary hearing held under 739(a)(ii). As to them, no constitutional purpose justifies their detention. Category (3) involves adjudicated delinquents considered to have been punished enough by the time served. No compelling governmental interest justifies the imposition of sanctions on members of this group before, rather than after, adjudication. As to them, detention serves the purpose of punishment rather than crime prevention, since early release — within days or at most a few weeks — by a Family Court Judge contradicts any asserted need for pre-trial confinement to protect the community.33
In practice, therefore, the vast majority of the pre-trial detentions involve either mistakes in judgment fostered by 739(a)(ii)’s procedurally and substantively unlimited terms or the imposition of incarceration solely as punishment for unadjudicated crimes. To the degree that the goal of crime prevention is implicated at all in the actual operation of 739(a)(ii), it is only as to the minority, perhaps less than one-third, of the juveniles actually detained under its provisions. As to this group, moreover, only the risk that some might commit crimes is eliminated.
In re Winship, supra, directly ruled that an adjudication of delinquency which entails the possibility of institutional confinement must rest on proof beyond a reasonable doubt, because such confinement is constitutionally analogous to punishment for criminal acts. The provision invalidated in Winship under the Due Process Clause was in fact a provision of the New York Family Court Act which applied a preponderance of the evidence test in delinquency adjudications. The practice under 739(a)(ii) is, if anything, more offensive since confinement is imposed initially only upon a verified petition and later at best upon a finding of probable cause.34 The Family Court Judge ordering detention is well aware that most detainees will either not go to fact-finding or, if they do, will be released on probation. Section 739(a)(ii) thus incarcerates — punishes — large numbers of persons upon a standard of proof which is constitutionally invalid and which cannot be justified in the name of crime prevention.
Section 739(a)(ii) thus has an unconstitutional impact as to the vast majority of the juveniles detained under it. We must now determine whether the statute is invalid as to all juveniles or whether individual detainees must litigate the particular circumstances of their confinement.
We hold 739(a)(ii) unconstitutional as to all juveniles. The preponderant number of persons affected by its terms suffer punishment without adjudication of guilt beyond a reasonable doubt and absent a compelling governmental interest. Individual litigation, however, is a practical impossibility because the periods of detention are so short that the litigation is mooted before the merits are determined. Moreover, the record clearly demonstrates that the unconstitutional impact of the statute results directly from its substantively and proeedurally unlimited terms which cause Family Court Judges to incarcerate juveniles they know will be released before or at disposition. Whether we view the statutory scheme as commanding the results it in fact *374attains or as simply failing “to provide sufficiently clear guidance for police, prosecutors and the courts to enforce [it] in a manner . . . consistent with [the Due Process Clause],” United States ex rel. Newsome v. Malcolm, 492 F.2d 1166 (2d Cir. 1974) aff’d sub nom. Lefkowitz v. Newsome, 420 U.S. 283, 95 S.Ct. 886, 43 L.Ed.2d 196 (1975), matters not, for under either view it violates constitutional guarantees.35
Our decision is strictly limited to the precise issue before us. We hold only that pre-trial detention may not be imposed for anti-crime purposes pursuant to a substantively and procedurally unlimited statutory authority when, in all likelihood, most detainees will either not be adjudicated guilty or will not be sentenced to confinement after an adjudication of guilt. In such circumstances, the detention period serves as punishment imposed without proof of guilt established according to the requisite constitutional standard. We intimate no view as to the constitutionality of preventive detention in other circumstances.
The sole remaining issue is the scope of the relief granted. Judge Carter allowed this habeas corpus action to proceed as a class action, certifying the class as “all juveniles who are now being held or will be held before these proceedings are concluded, in pretrial detention under § 739(a)(ii) . .. . ” Appellants do not challenge this certification. His order, entered on June 1, 1981, provided that the writ be granted as to all members of that class, i.e., those detained under 739(a)(ii) at any time before this action is concluded. Appellants challenge the order on the grounds that it grants in futuro release to individuals whose incarceration begins only after entry of judgment in the District Court. Class actions are permissible in habeas corpus proceedings, United States ex rel. Sero v. Preiser, 506 F.2d 1115 (2d Cir. 1974), cert. denied 421 U.S. 921, 95 S.Ct. 1587, 43 L.Ed.2d 789 (1975), and the writ is available to attack future confinement, Peyton v. Rowe, 391 U.S. 54, 88 S.Ct. 1549, 20 L.Ed.2d 426 (1968). It is also clear, however, that the remedy of habeas corpus is directed to the unlawful custody of individuals, while prospective relief against enforcement of an invalid statute must be obtained in an action for an injunction under 42 U.S.C. § 1983. See Preiser v. Rodriguez, 411 U.S. 475, 93 S.Ct. 1827, 36 L.Ed.2d 439 (1973). The prospective effect of Judge Carter’s order affects only those detained in custody while this action continues, not those who may be detained thereafter. We believe that the “in custody” language of 28 U.S.C. § 2254 does not require institution of repeated individual actions for each new detainee while an appeal from a judgment in a class action is being actively considered. The fact of potential custody is clearly present during the period of litigation, and the defendants are always free to seek a stay of any such order from the appellate court. The order below thus does not significantly expand use of the writ.36
Affirmed.
. The New York Family Court Act has been codified at Book 29A, Part I, Judiciary — Court Acts (McKinney 1975 Supp. 1981). References to the Family Court Act will be cited as “FCA §__” The preventive detention statute challenged in this action is FCA § 739(a), which provides:
§ 739. Release or detention after filing of petition and prior to order of disposition. (a) After the filing of a petition under section seven hundred thirty-one or seven hundred thirty-two, the court in its discretion may release the respondent or direct his detention. In exercising its discretion under this section, tlie court shall not direct detention unless it finds and states the facts and reasons for so finding that unless the respondent is detained:
(i) there is a substantial probability that he will not appear in court on the return date; or
(ii) there is a serious risk that he may before the return date do an act which if committed by an adult would constitute a crime.
. FCA § 731 prescribes the function and content of a delinquency petition:
1. A proceeding to adjudicate a person a juvenile delinquent is originated by the filing of a petition, alleging:
(a) the respondent did any act which, if done by an adult, would constitute a crime and specifying the act and the time and place of its commission;
(b) the respondent was a person under sixteen years of age at the time of the alleged act; and
(c) the respondent requires supervision, treatment, or confinement.
. See FCA §§ 744, 752.
. See FCA § 753.
. FCA § 747 mandates that, if the respondent is in detention, a fact-finding hearing shall commence, unless adjourned, not more than three days after the filing of the petition against the respondent unless the respondent is charged with an act which if committed by an adult would constitute a Class A, B or C felony, in which case the fact-finding hearing shall commence within fourteen days. FCA § 739(b) provides that the respondent may not be detained more than three days, barring waiver or adjournment, unless the court finds probable cause. However, under “special circumstances,” a juvenile may be detained for as long as six days without a probable cause determination having been made.
. A “designated felony act” is defined in FCA § 712(h) to include the following offenses:
(h) “Designated felony act”. An act which, if done by an adult, would be a crime (i) defined in section 125.27 (murder in the first degree); 125.25 (murder in the second degree); 135.25 (kidnapping in the first degree); or 150.20 (arson in the first degree) of the penal law committed by a person thirteen, fourteen or fifteen years of age; (ii) defined in section 120.10 (assault in the first degree); 125.20 (manslaughter in the first degree); 130.35 (rape in the first degree); 130.50 (sodomy in the first degree); 130.70 (aggravated sexual abuse); 135.20 (kidnapping in the second degree), but only where the abduction involved the use or threat of use of deadly physical force; 150.15 (arson in the second degree); or 160.15 (robbery in the first degree) of the penal law committed by a person thirteen, fourteen, or fifteen years of age; (iii) defined in the penal law as an attempt to commit murder in the first or second degree or kidnapping in the first degree committed by a person thirteen, fourteen or fifteen years of age; (iv) defined in section 140.30 (burglary in the first degree); subdivision one of section 140.25 (burglary in the second degree); or subdivision two of section 160.10 (robbery in the second degree) of the penal law committed by a person fourteen or fifteen years of age; (v) defined in section 120.-05 (assault in the second degree) or 160.10 (robbery in the second degree) of the penal law committed by a person fourteen or fifteen years of age but only where there has been a prior finding by a court that such person has previously committed an act which, if committed by an adult, would be the crime of assault in the second degree, robbery in the second degree or any designated felony act specified in clause (i), (ii) or (iii) of this subdivision regardless of the age of such person at the time of the commission of the prior act; or (vi) other than a misdemeanor, committed by a person at least seven but less than sixteen years of age, but only where there has [sic] been two prior findings by the court that such person has committed a prior act which, if committed by an adult would be a felony.
. See FCA § 750(3).
. FCA § 755.
. FCA § 757.
. FCA § 756(a)(i).
. FCA § 756(a)(ii), (iii).
. FCA § 753-a.
. See generally FCA §§ 711, 753-a(2).
. See note 30, infra; Cf. P. Prescott, The Child Savers, 197 (1981).
. The term “crime” is defined in New York Penal Law § 10.00(6) as any felony or misdemeanor. Thus, offenses such as playing three-card monte can, and, as the record reveals, sometimes do trigger the sanction of 739(a)(ii). This is in contrast to the District of Columbia pretrial detention statute, D.C. Code 1973, § 23-1322, upheld in United States v. Edwards, 430 A.2d 1321 (D.C. App. 1981), under which a suspect may be detained for up to 60 days pending trial only if that suspect has been charged with the commission of a “dangerous crime” (i.e., taking or attempting to take property from another by force or threat of force, unlawfully entering or attempting to enter any premises adapted for overnight accommodation of persons or for carrying on business with the intent to commit an offense therein, arson or attempted arson of any premises adaptable for overnight accommodation of persons or for carrying on business, forcible rape, or unlawful sale or distribution of narcotics) or a “crime of violence” (i.e., murder, forcible rape, carnal knowledge of a female under the age of 16, taking or attempting to take immoral, improper or indecent liberties with a child under the age of 16, mayhem, kidnapping, robbery, burglary, voluntary manslaughter, extortion or blackmail accompanied by threats of violence, arson, assault with intent to commit any offense, assault with a dangerous weapon, or an attempt or conspiracy to commit any of the foregoing offenses as defined by any Act of Congress or any State law, if the offense is punishable by imprisonment for more than one year). Moreover, the judicial officer ordering preventive detention must find a substantial probability that the suspect committed that offense prior to the imposition of pre-trial detention. Id. § 23-1322(b)(2)(C).
. The case histories in the record reveal instances of detention under 739(a)(ii) of first offenders.
. See note 7, supra.
. The record contains statistical compilations utilized by the parties to dispute the number of 739(a)(ii) detainees released at or before disposition. These include a monograph prepared by the Vera Institute of Justice and Court Administration Reports for the years 1977 and 1979. None of the data, apart from the representative case histories, allow a precise comparison of detained juveniles,' restrictively placed and released at disposition. The Vera Study, based on New York City juveniles, lumps detentions under 739(a)(ii) with detentions under 739(a)(i), while the Court Administration Reports, based on statewide data, suffer from that same imprecision but also do not indicate how many restrictively placed juveniles were ever detained. The Vera Study, relied upon by petitioners, indicates that of the detained juveniles, 49% have their cases dismissed before trial, 21% are dismissed or released after trial, and only 30% are restrictively placed. The Vera Study also demonstrates that, although one-third of the delinquency petitions filed results in pre-trial detention, only 11 % of all petitions results in restrictive placements. Since the detainees include those held under (i) as well as (ii), it is not conclusive for our purposes. The defendants, on the other hand, apply a factor derived from the Vera Study’s sample of placed juveniles who were not detainees to data reflecting total restrictive placements contained in the Court Administration Reports. From that, they estimate that slightly less than 50% of the juveniles detained under 739(a)(ii) are not placed at disposition. Neither position can be relied upon for total accuracy. The defendants’ position, however, is the least reliable. It not only suffers from the overinclusiveness of both studies but also attempts to combine selected data from a study based on New York City with selected data from statewide statistics.
We find that the case studies and the Vera Study establish that the great majority of detainees under 739(a)(ii) are released before or at disposition. Although the defendants have superior access to generalized statistics and at least an equal opportunity to present a counter-sample of case studies, they choose to rely solely upon the most vulnerable data in the record. Even that data, however, indicates that close to half of all (ii) detainees are quickly released.
. The representativeness of the thirty-four case histories in the record is not challenged by the defendants. Adopting the defendants’ version of these histories, final dispositions are known for thirty-two of the juveniles. The petition of delinquency and results of fact-finding of one juvenile were not offered for admission into evidence and the record of another juvenile reflects only that he was paroled pending receipt of certain investigation materials. The vast majority of that sample, twenty-three of the juveniles, or 70%, were released at or before disposition stage. Twelve of these cases resulted either in a dismissal, withdrawal or adjournment in contemplation of dismissal before fact-finding; the remaining eleven resulted in either probation or a suspended sentence.
. Testimony of Judge Cesar Quinones, Transcript of Trial Proceedings, pp. 435-513; Joint App. at 521-99.
. Id at 477; Joint App. at 533.
. Id, at 463; Joint App. at 549.
. Id. at 465-68; Joint App. at 551-54.
. Judge Quinones testified about the purpose of 739(a)(ii) detention and emphasized that such detention may be harmful to the juvenile:
Q. [by Ms. Gordon] Judge, what is your opinion of the purpose of the detention that Section 739(a)(2) [sic] authorizes?
‡ ^ ‡ H* ‡ ‡
A. [by Judge Quinones] I believe that the purpose of 739(a) is really the protection of the community. 1 believe that’s the basic purpose for that provision.
Q. If that statute serves the interest of the child at all, in what sense does it serve the child’s interest, if you have an opinion?
A. If it serves the child’s interest at all, it would be the minimal benefit that while he is in detention, he is not committing another crime; if that can be called a benefit to the youngster, but I don’t believe that detention is actually for the benefit of the youngster, not under this statute.
I certainly would not remand anybody for benefit. Perhaps you might find a rare case where somebody might be so favorably or so shockingly effected by a short stay in juvenile center that that might turn him around, but I don’t believe that is the purpose he is put there, no. You don’t put them in for their own good, I’m sorry.
Q. Are there any disadvantages or bad effects from the detention or the pre-trial detention of a juvenile in your opinion?
A. Yes.
Q. What are they?
A. In my opinion, all defenses [sic: detentions], juvenile or adult, can have bad effects. For one thing, we are talking about youngsters of tender age. You are taking them away from their family. I mean, that’s bound to have a psychological . .. detrimental effect on them.
Id. at 479-80; Joint App. at 565-66.
. Judge Quinones testified about the standards in dispensing punishment at disposition, as follows;
Q. [by Mr. Guggenheim] How can you account, Judge, for the fact in a case where the initial reaction of the court is to detain a child based on a prediction that he will commit another crime or crimes if not detained with an ultimate disposition in the case of probation?
A. [by Judge Quinones] Probation indicates that there has been a finding in the case. You have to have a fact-finding otherwise probation wouldn’t be discussed.
Now, when it comes to the dispositional hearing, the main purpose of the dispositional hearing or the main thrust would be the best interest of the child. In a dispositional hearing you are supposed to keep the child’s best interest at heart and I think that — well, speaking for myself, I think that any kind of detention at a dispositional hearing is a very harsh 'solution to the problem and you will look for the least harmful or to the most beneficial disposition at dispositional hearing keeping the best interest of the child in mind and many times that is probation.
Id. at 505-06; Joint App. at 591-92.
. Id. at 506-07; Joint App. at 592-93.
. On redirect examination, Judge Quinones added:
Q. [by Ms. Gordon] At the dispositional hearing, Judge Quinones, do you take *371account of the fact that a child who has been previously remanded has already spent some time in a restrictive environment in coming to your disposition?
A. [by Judge Quinones] Yes, that is taken into consideration also.
Id. at 507; Joint App. at 593.
. At oral argument before this Court on January 12, 1982, counsel for the defendants argued:
One of those decisions commonly made by a judge is that if a person has been detained, even in lieu of bail, that the person has done sufficient jail time, to use that term loosely. Accordingly, to say that a Family Court Judge who issues a disposition three months, six months later to a child who has been detained, may simply be a statement that the child has already done enough time.
Verbatim Transcript of Oral Argument, January 12, 1982, p. 21.
. Judge Quinones noted in his discussion of the harmful effects of pre-trial detention the detriment accompanying detention in a secure facility:
A. [by Judge Quinones] Then again, juvenile center, as much as we might try, is not the most pleasant place in the world. If you put them in detention, you are liable to be exposing these youngsters to all sorts of things. They are liable to be exposed to assault, they are liable to be exposed to sexual assaults. You are taking the risk of putting them together with a youngster that might be much worse than they possibly might be and it might have a bad effect in that respect. Transcript of Trial Proceedings at 480; Joint App. at 566.
. Judge Edward J. McLaughlin, the Chairman of the Association of New York State Family Court Judges, stated recently:
In adjudicating issues involving alleged delinquents, the Legislature provided that there be two trials. The first, known as a fact-finding hearing, would be conducted essentially under the due process rules of a criminal proceeding. If the facts were proven beyond a reasonable doubt, the court was obliged to conduct a second trial to determine whether the delinquent was in need of treatment and, further, whether treatment was available. It is the requirement regarding the availability of treatment that exposes the court to its greatest public criticism. The Legislature did not permit the judge to punish the delinquent. Neither is the judge allowed to compel any institution to accept the delinquent for treatment: the treatment facility determines whether help is available.
This mandate led to the most glaring dissatisfaction with the court, since it is the delinquent most in need of help — the sickest, if you will — who is the least likely to be found eligible for treatment by any existing facility. The situation thus created resembles the case of a terminally ill patient who is not accepted into a hospital, not because he doesn’t need treatment but because no treatment is available.
N.Y. Times, March 15, 1982, p. A16, col. 3.
. See note 20, supra.
. Part of the detention period for some of these juveniles is between fact-finding and disposition and thus occurs after an adjudication of the alleged criminal acts. The testimony was that in the usual course of events, those juveniles detained under 739(a)(ii) will continue to be held once adjudicated while those not held in the pre-trial period will continue to be free pending disposition.
. The state defendants have not contended, and the record contains no evidence, that the period between arrest and disposition entails a greater risk of criminal acts by juveniles than the post-disposition period.
. Although in practice the Family Court requires a verified petition in 739(a)(ii) proceedings, the statute itself does not make likelihood of guilt a condition precedent to detention. A probable cause hearing, analogous in all relevant respects to an arraignment, is held within three to six days after a decision to detain.
. Our view conflicts with that of New York’s Court of Appeals, which has upheld 739(a)(ii) against constitutional attack. People ex rel. Wayburn v. Schupf, 39 N.Y.2d 682, 385 N.Y.S.2d 518, 350 N.E.2d 906 (1976). Although the burden of the Court’s opinion was directed to a claim that differential treatment of juveniles and adults violated the Equal Protection Clause, it recognized that preventive detention under 739(a)(ii) is imposed upon large numbers of juveniles who are in fact released after the dispositional hearing. This was attributed to the superior information available at that stage to inform the Family Court Judge as to the proper disposition. The Court held this constitutionally insignificant. We disagree for the reasons stated.
. This issue is apparently contested only because the state defendants believe that however unconstitutional 739(a)(ii) may be, injunctive relief is unavailable because the only feasible defendants are Family Court Judges who are immune from suit under § 1983. Brief of Intervenor-Appellant, p. 85, note, p. 86, note. Relief from 739(a)(ii) is, in their view, available only through successive individual habeas corpus actions. However, we fail to see why a custodial official holding a juvenile under the authority of 739(a)(ii) is not subject to a Section 1983 action.