Sixteen-year-old Roger Fain was arrested November 12, 1970, in Volusia County, Florida, for breaking into the home of a woman and raping her. Eleven days later Fain was adjudged delinquent by a juvenile court. Nine days after the juvenile proceedings, a grand jury returned an indictment charging Fain with the criminal offense of rape. After the state courts of Florida rejected Fain’s argument that prosecution of him for rape would violate the former jeopardy clause of the Fifth Amendment to the Constitution, Fain obtained a writ of habeas corpus from the United States District Court for the Middle District of Florida. The state now appeals the granting of the writ. We affirm.
Although this case involves complicated constitutional and statutory questions, the facts are simple and undisputed. On November 12, 1970, Roger Fain, then aged sixteen years and nine months, was arrested by Ormond Beach police officers for the alleged rape the day before of Mary Frances Oswald in Volusia County, Florida.1 Five days later, a counselor of the juvenile court system filed a petition in juvenile court alleging that Fain was a delinquent child by reason of having assaulted and raped Mrs. Oswald.2 On November 23, 1970, a hearing was held in the Volusia County Juvenile Court, during which an assistant state attorney appeared and urged the judge to waive jurisdiction and certify the case to the circuit court.3 *221After hearing argument on this question, the judge declined to waive jurisdiction, found Fain delinquent and committed him to the Division of Youth Services for an indeterminate period not to extend beyond his 21st birthday.4 Since November 23, 1970, Fain has remained in the custody of the Division of Youth Services at the Dozier School for Boys.
On December 1, 1970, the state attorney for the Seventh Judicial Circuit urged the juvenile court judge to stay the issuance or execution of its order of commitment; the judge did not do so. The next day, an indictment was returned alleging the same acts on which the delinquency adjudication was based.5 Two weeks later, on December 17, 1970, the state attorney urged the juvenile court to relinquish jurisdiction.6
In the circuit court, Circuit Judge Melton of the Seventh Judicial Circuit dismissed the indictment against Fain on January 7, 1971, on the grounds of former jeopardy. The state appealed to the First District Court of Appeal, which reversed Judge Melton’s ruling on August 17, 1971. State v. R. E. F., 251 So.2d 672 (Fla.App.1971). The Supreme Court of Florida affirmed the court of appeal, but stayed its mandate to allow Fain to pursue any remedies he might have in federal court. R. E. F. v. State, 265 So.2d 701 (Fla.1972). Fain filed a petition for a writ of habeas corpus in the Middle District of Florida, and a hearing was held before the U. S. District Court on November 21, 1972. On January 15, 1973, the district court issued the writ requested by Fain. The state filed a notice of appeal February 7, 1973.
Three questions confront us in this appeal:
1. Did the district court have jurisdiction to entertain Fain’s application for a writ of habeas corpus ?
2. Was the district court correct in determining that the actions of the State of Florida violate the former jeopardy clause of the Fifth Amendment, made applicable to the states by the Fourteenth Amendment ? 7
3. Was the district court correct in determining that the actions of the State of Florida violate the Fourteenth Amendment and notions of fundamental fairness ?
I
As in all eases in federal court, the first question to which we must address ourselves is that of jurisdiction provided by a statute, for if there is no jurisdiction, a determination of the merits of a case is futile. Ex parte McCardle, 74 U.S. (7 Wall.) 506, 19 L.Ed. 264 (1869); Ex parte Bollman, 8 U.S. (4 Cranch) 75, 2 L.Ed. 554 (1807). In this *222case, Fain asserts jurisdiction under 28 U.S.C. § 2241.8 We must therefore determine if that statute permits the district court to grant the writ. The statute iself contains no definition of the term habeas corpus. To ascertain its meaning and the appropriate use of the writ in federal courts, recourse must be had to the common law, from which the term was drawn. McNally v. Hill, 293 U.S. 131, 136 (1934). The traditional use of the Great Writ was to inquire into the detention of a prisoner for the purpose of commanding his release if that detention was contrary to the law. See Developments in the Law — Federal Habeas Corpus, 83 Harv.L.Rev. 1038 (1970) and H. Hart and H. Wechsler, The Federal Courts and the Federal System, 2d Ed. (1973), 1426-29. The purpose of this writ is not to examine the validity of any judgment, but merely to inquire into the legality of a detention. Fay v. Noia, 372 U.S. 391, 430, 83 S.Ct. 822, 9 L.Ed.2d 837 (1963). Thus, an obvious prerequisite to the issuance of a writ is detention, or custody.
Notwithstanding the traditional requirement that the petitioner must be in custody when the writ issues, McNally v. Hill, supra, the law in this country has been considerably broadened in this area. This most significant relaxation of the detention standard occurred in Peyton v. Rowe, 391 U.S. 54, 88 S.Ct. 1549, 20 L.Ed.2d 426 (1968). In Pey-. ton, the Supreme Court permitted a prisoner to attack the second of two consecutive sentences before the first had expired. Although the petitioner had not yet begun to serve the allegedly illegal sentence, the Court held that practical considerations and the history of the writ as a means of prompt adjudication permitted the district court to consider the petition at the time it was presented. Id. at 62-63, 88 S.Ct. 1549.
In this case we have a situation analogous to the consecutive sentence problem of Peyton. Fain is now committed to the custody of the juvenile authorities, where he will remain even after he obtains the writ. But uncontested evidence introduced at the hearing in district court indicated that the conditions of his commitment would be substantially different absent the rape indictment.
Fain is now incarcerated at the Dozier School for Boys in Marianna, Florida. The Division of Youth Services, however, has the authority to release him when it would benefit Fain and society to do so. Mr. Lenox E. Williams, superintendent of the school, testified at the hearing that, “If [Fain] could have left the institution without the threat of being thrown in jail . . . [w]e would have let him go.” The district court found “that the juvenile authorities are of the opinion that petitioner has been rehabilitated and the authorities are prepared to release him but for the probability that his release from the Dozier School for Boys would simply result in his re-arrest by Volusia County authorities on the strength of the judgment of the Florida Supreme Court, [footnote omitted.]”
Thus, Fain’s “custody” is even more apparent than that of Peyton, since the existence of the outstanding indictment not merely threatens him with more incarceration in the future, it has a substantial effect on his present circumstances. In fact, the indictment is the sole cause of his present confinement.
The fact that Fain is in the custody of the juvenile authorities of the State *223of Florida, coupled with the likelihood of his being released in the discretion of those authorities, convinces us that the custody requirement of § 2241 has been amply complied with in this ease. This holding does not in any way involve a “stretching” of the custody requirement of the statute, for Fain’s liberty is restrained in a manner which can and should be basis for issuance of the writ under even the most traditional concepts of custody. Cf. Hensley v. Municipal Court, 411 U.S. 345, 93 S.Ct. 1571, 36 L.Ed.2d 294 (1973).
The state argues that Fain must also demonstrate that his confinement is pursuant to the judgment of a state court.9 But Fain nowhere alleges that his petition falls within § 2254 and, in fact, it is obvious that it does not. Section 2254 was enacted to regulate the use of habeas corpus for collateral attack on state criminal proceedings. It has no relevance to this case. One of the traditional roles of the writ is to prevent lawless denials of liberty, whether perpetrated by the executive, legislative or judicial branches of the government, or the military.10 Traditionally, the writ has had a very wide usage in testing all kinds of lawless government actions. Its use as a post-conviction remedy for wrongs perpetrated during criminal trials is relatively recent. In fact, the statute allowing federal habeas corpus attack on state criminal convic tions was not even in existence prior to 1867.11 In Ex parte Royall, 117 U.S. 241, 65 S.Ct. 734, 29 L.Ed. 868 (1886), Justice Harlan recognized the power of the federal court to release a prisoner who had not undergone a state trial. Although relief was denied because of a failure to exhaust the processes of the state, the case reaffirms the traditional notion that the federal remedy in habeas corpus is available to vindicate constitutional rights of citizens illegally held in custody. The Supreme Court only last term reaffirmed this traditional use of the writ. Braden v. 30th Judicial Circuit Court of Kentucky, 410 U.S. 484, 93 S.Ct. 1123, 35 L.Ed.2d 443 (1973). In Braden the writ was used to enforce Kentucky’s affirmative obligation to provide the petitioner with a speedy trial. Although petitioner was in custody at the time of his petition, the physical custody was that of the State of Alabama, not Kentucky, the state which petitioner alleged was depriving him of his rights. Braden obtained a writ” against Kentucky officials before any trial in that state.12
The state also advances several arguments related to the timing of Fain’s resort to a federal forum. These can be loosely grouped under the term “exhaustion.” The exhaustion of state remedies requirement is based on Ex parte Royall, supra. Although in Royall, the decision to require exhaustion was left in the discretion of the district court, the requirement soon became known as a jurisdictional one. With respect to collateral attack on convictions in state court, the requirement was codified in 28 U.S.C. § 2254(b), but the requirement applies to all habeas corpus actions.
The Court in Braden clearly explained the various foundations and rationales of the exhaustion requirement. *224410 U.S. 484, 93 S.Ct. 1123, 35 L.Ed.2d at 449-451. Briefly stated, the doctrine preserves the respective roles of state and federal governments and avoids unnecessary collisions between sovereign powers. States are allowed to vindicate their interest in prompt and orderly administration of justice, while the federal judiciary upholds its responsibility to prevent the exercise of illegitimate authority. However, federal-state tensions should not be exacerbated by gratuitous federal interference in state criminal proceedings.
In this case, the courts of Florida have had an opportunity to promulgate a final, definitive ruling on the question involved. The Florida Supreme Court has authoritatively stated in the context of this case that in its opinion repros-ecution of the petitioner will not violate his right not to be twice placed in jeopardy. 265 So.2d 701. There is nothing more for the courts of Florida to say on this issue.
It may be objected that resort to a federal forum is unnecessary because a petition for habeas corpus relief could be brought after the trial in state court, thus leaving open the possibility that a finding of not guilty in state court would make resort to federal habeas corpus unnecessary. In addition to the observation that a finding of delinquency by the juvenile court makes this possibility unlikely (though certainly not inconceivable), a more important consideration refutes this position.
Fain is not asserting merely a federal defense to a state prosecution. He is asserting a constitutional right not to be twice put in jeopardy for the same offense. Although double jeopardy (if shown) would certainly be a proper defense to assert at trial and in post-conviction proceedings, the right consists of more than having the second conviction set aside. It consists of being protected from having to undergo the rigors and dangers of a second — illegal — trial. Double jeopardy is not a mere defense to a criminal charge; it is a right to be free from a second prosecution, not merely a second punishment for the same offense (though that is obviously included in the right.) The prohibition of the Double Jeopardy Clause is “not against being twice punished, but against being twice put in jeopardy.” United States v. Ball, 163 U.S. 662, 669, 16 S.Ct. 1192, 41 L.Ed. 300 (1896); Ex parte Lange, 85 U.S. (18 Wall.) 163, 169, 21 L.Ed. 872 (1874); Green v. United States, 355 U.S. 184, 187, 78 S.Ct. 221, 2 L.Ed.2d 199 (1957).
Again, this can be analogized to Brad-en. The writ in Braden issued to enforce petitioner’s right to a speedy trial. Surely, as the Court noted, lack of a speedy trial would have been a defense to be presented at trial, on appeal, or in post-conviction proceedings. Nevertheless, the Court approved the writ to enforce the state’s affirmative obligation to bring Braden to trial. Here, it is not an affirmative obligation Fain seeks to enforce, it is a prohibition. But just as in the case of speedy trial, the right is one which can and should be vindicated without waiting until the state decides to conduct a trial. For Fain, it is the right to be left alone which he seeks to enforce against the State of Fluida.
II
We turn now to the question of whether prosecuting Fain for rape violates his rights under the Constitution. Fain argues that he was not only placed in jeopardy in the juvenile court — he was convicted and punished. His is a plea of autrefois convict. To try him again would not only subject him to the harrassment of an additional judicial proceeding, but also subject him to the risk of being twice punished for the same offense. Therefore, reprosecution of him as an adult violates both conceptions of fundamental fairness and the Constitution’s protection against double jeopardy, made applicable in state proceedings by the Fourteenth Amendment. Benton v. Maryland, 395 U.S. 784, 89 S. Ct. 2056, 23 L.Ed.2d 707 (1969). The State of Florida contends (1) since the *225juvenile proceedings were not criminal in nature, Fain was never put in jeopardy; (2) even if the juvenile proceedings are held to have placed Fain in jeopardy, as a juvenile, he has no right not to be placed in jeopardy again; and (3) the correct standard to apply is fundamental fairness, and it is not fundamentally unfair to prosecute Fain as an adult for the rape.
A. Was Fain placed in jeopardy in the juvenile court proceedings?
It cannot be disputed that a juvenile court judge in Florida may, by finding a juvenile to be delinquent, impose significant restrictions on his liberty. He may “Place a child . . . under the supervision of an authorized agent of the division of youth services Commit the child to a . . . child-caring institution . . . Commit the child to the division of youth services . . . .” F.S.A. § 39.11. Although commitment to the Division of Youth Services may result in the juvenile being allowed to return to his home, it may also result in incarceration until age 21. Fain’s commitment to the division resulted from his having been found delinquent. And his being found delinquent resulted from his having violated a criminal law of the State of Florida. F.S.A. § 39.01(9). Thus, a violation of the criminal law may directly result in incarceration. This is a classic example of “jeopardy.”
The state’s argument that the purpose of the commitment is rehabilitative and not punitive does not change its nature. No authority need be cited for the proposition that a court should look past the labels to the substance of an action. Regardless of the purposes for which the incarceration is imposed, the fact remains that it is incarceration. The rehabilitative goals of the system are admirable, but they do not change the drastic nature of the action taken. Incarceration of adults is also intended to produce rehabilitation. A court proceeding which may result in incarceration places a person, adult or juvenile, in jeopardy. United States v. Dickerson (D.D.C., 1958), 168 F.Supp. 899, rev’d on other grounds (1959), 106 U.S.App. D.C. 221, 271 F.2d 487; M. v. Superior Court of Shasta County, 4 Cal.3d 370, 93 Cal.Rptr. 752, 482 P.2d 664 (1971).
B. Does Fain’s status as a juvenile prevent him from asserting double jeopardy as a defense to the criminal prosecution for rape?
The state argues that in McKeiver v. Pennsylvania, 403 U.S. 528, 91 S.Ct. 1976, 29 L.Ed.2d 647 (1971), the Supreme Court held that juveniles are not protected by all the guarantees of the Bill of Rights, but rather, the applicable standard to use in juvenile cases is one of fundamental fairness. 403 U.S. at 543, 91 S.Ct. 1976. This argument completely misconstrues the holding in Mc-Keiver. The Court there dealt only with the rights of juveniles in juvenile court proceedings. Here we have a juvenile threatened with a criminal prosecution. By indicting him, the state has expressed a desire to treat him in all respects as an adult. Is there any question that since the state now proposes to subject him to the powers of the state as it would an adult, it must now accord him all the procedural rights that an adult has?
Fain’s mere status as a juvenile, although it may subject him to the jurisdiction of an entirely different court system, cannot deprive him of rights that adults enjoy in the criminal justice system. If Florida wants to punish Fain as an adult, it must give him all the rights of an adult. We need not deal at all with Fain’s rights in the juvenile court system, for now he is in the adult court system. And in that system, the Constitution’s command that no person shall be twice placed in jeopardy for the same offense unquestionably applies.
C. Is Fain being placed in jeopardy for “the same offense” by the rape indictment?
In this inquiry we are guided by an earlier decision of this court in a similar case. In Hultin v. Beto, 396 F.2d 216 (5 Cir. 1968), this court held that the State of Texas violated notions of fundamental fairness by punishing a person for a crime after it had already committed him to juvenile authorities because he committed the same acts which the indictment charged. Here, as in Hultin, the indictment charged that the defendant engaged in exactly the same actions which were proved at the hearing in juvenile court, and which the judge consid*226ered in committing the juvenile in the earlier proceedings. In this case it is especially clear that Fain is being prosecuted for “the same offense,” because he was adjudged delinquent by reason of having violated the same criminal law for which he is now being indicted. This is even a clearer case than Waller v. Florida, 397 U.S. 387, 90 S.Ct. 1184, 25 L.Ed.2d 435 (1970), in which the Court held that for a State and a municipality to both prosecute someone for committing the same acts violates the double jeopardy clause. Here, we have not only the same sovereign, we have in addition exactly the same acts being punished and exactly the same elements in each offense. Thus, Fain is now being prose-uted for the “same offense” for which he was adjudged delinquent in the juvenile proceedings.
Ill
Does prosecution of Fain as an adult for the substantive criminal offense of rape violate notions of “fundamental fairness”?
This court’s opinion in Hultin v. Beto, supra, provides definitive guidance in answering this question. We merely follow Hultin in answering in the affirmative. Florida argues that Hultin is distinguishable on the grounds that the Texas statute forbade prosecution of juveniles for substantive offenses, while in Florida concurrent jurisdiction exists. Thus, Texas had to wait until Hultin reached age 17 before prosecuting him. If the timing had been different, Fain could have been prosecuted immediately as an adult, in which case the juvenile court would have lost jurisdiction. over him. F.S.A. § 39.02(6) (c).
We find this distinction unpersuasive. The problem in this case is that Florida failed to indict Fain before the juvenile court judge adjudged him delinquent. That it could deprive the juvenile court of jurisdiction in some other case in which it acted more quickly is of no consequence in a case in which it failed to do so.
Florida also argues that it made every effort to bring Fain to trial as an adult, while in Hultin, the state participated fully in the delinquency proceedings. This argument fails for two reasons. First, in Hultin, as in Fain, the state attorney objected to the juvenile court judge’s action in taking jurisdiction over the juvenile. More importantly, the juvenile court judge acts for the state, just as the state attorney does. It cannot be seriously contended that the state played no role in the delinquency proceedings. Everything about the delinquency proceedings was controlled and authorized by state statutes. The juvenile court judge may have acted without the consent of the state attorney’s office, but under existing Florida law, such an action was proper. The state participated in the delinquency proceedings in this case, just as it did in Hul-tin.
Finally, the state contends that the juvenile court judge abused his discretion in finding Fain delinquent after the state attorney informed the judge of his desire to present the case to a grand jury. Under existing Florida law, however, the decision to take jurisdiction over felonies committed by juveniles is left entirely in the discretion of the juvenile court judge. There is nothing to indicate that the judge need even hear the arguments of the state attorney before making his decision, much less be bound by those arguments. It is true that the juvenile court loses jurisdiction over a juvenile after an indictment is handed down. But in this case an indictment was not handed down until after the juvenile court had invoked jurisdiction and committed Fain to the department of youth services. The court had jurisdiction over Fain when it made that commitment, and we are unconvinced tha.t any improper procedures were engaged in to deprive the state of any interest it may have had in prosecuting Fain as an adult.
The foregoing discussion demonstrates that Fain was placed in jeopardy in the juvenile court proceedings, and that he is now placed in jeopardy again in the Circuit Court for the Seventh Judicial Circuit for the same offense. The Constitution does not permit such an action to occur.
Affirmed.
. F.S.A. § 39.03(1) (b) allows a police officer to arrest a juvenile who is “alleged to have committed a violation of law.”
. F.S.A. § 39.05 specifies procedures for filing petitions “in the interest of” juveniles in juvenile courts.
. F.S.A. § 39.09 prescribes procedures for juvenile court bearings. F.S.A. § 39.02(6) (a) provides that a juvenile court judge may, after a hearing, transfer a child who is 14 years of age or older to the court which would have jurisdiction over the child if he were an
. F.S.A. § 39.01(11) (in effect at the time these events occurred) defined the term “delinquent child” as follows:
“Delinquent child” means a child who commits a violation of law, regardless of where the violation occurred, except a child who commits a juvenile traffic offense and whose case has not been transferred to the juvenile court by the court having jurisdiction.
F.S.A. § 39.11(2) (b) enumerates the powers of juvenile court with respect to juveniles it has adjudged delinquent.
. The juvenile court petition alleged rape and aggravated assault with a dangerous weapon. The indictment charged only forcible rape in violation of F.S.A. § 794.01.
. F.S.A. § 39.02(6) (c) provides:
When an indictment is returned by the grand jury charging a child of any age with a violation of Florida law punishable by death, or punishable by life imprisonment, the juvenile court shall be without jurisdiction, and the charge will be made, and the child shall be handled, in every respect as if he were an adult.
Nevertheless, it is clear that the juvenile court had jurisdiction of the case when it adjudged Fain to be delinquent.
. The Fifth Amendment provides, in part: “ . . . nor shall any person be subject for the same offense to be twice put in jeopardy of life or limb . . . .”
. 28 U.S.C. § 2241 provides in part:
(a) Writs of habeas corpus may be granted by the Supreme Court, any justice thereof, the district courts and any circuit judge within their respective jurisdictions. The order of a circuit judge shall be entered in the records of the district court of the district wherein the restraint complained of is had.
(c) The writ of habeas corpus shall not extend to a prisoner unless .
(3) He is in custody in violation of the Constitution or laws or. treaties of the United States.
. 28 U.S.C. § 2254(a) provides:.
The Supreme Court, a Justice thereof, a circuit judge, or a district court shall entertain an application for a writ of habeas corpus in behalf of a person in custody pursuant to the judgment of a State court only on the ground that he is in custody in violation of the Constitution or laws or treaties of the United States.
. See H. Hart and H. Wechsler, The Federal Courts and the Federal System, 2d Ed. (1973), 1426-29.
. Judiciary Act of February 5, 1867, c. 28, § 1, 14 Stat. 385-386.
. Appellant’s brief may be read to question the authority of the District Court for the Middle District of Florida to adjudicate Fain’s claim and the propriety of including Duff, Volusia County Sheriff, as a defendant. Both Fain and the juvenile authorities who now hold him in custody are in the Northern District. Any questions in this area are answered by Braden, supra.