delivered the opinion of the Court.
Edward McNeil was convicted of two assaults in 1966, and sentenced to five years’ imprisonment. Instead of committing him to prison, the sentencing court referred him to the Patuxent Institution for examination, to determine whether he should be committed Jo that institution for an indeterminate term under.Maryland’s Defective Delinquency Law. Md. Ann. Code, Art, 31B (1971). No such determination has yet been made, his sentence has expired, and his confinement continues. The State contends that he has refused to cooperate with the examining psychiatrists,: that they have been unable to make •any valid assessment of his condition, and that consequently he may be confined indefinitely until he cooperates and the institution has succeeded in making its evaluation. . He claims that when his sentence expired, the State lost its power to hold him, and that his continued detention violates his rights under the Fourteenth Amendment. We agree.
I
The Maryland Defective Delinquency Law provides that a person convicted of any felony; or certain misdemeanors, may be committed to the Patuxent Institution for an indeterminate period, if it is judicially determined that he is a “defective delinquent.” A defective delinquent is defined as
“an individual who, by the demonstration of persistent aggravated antisocial or criminal behavior," evidences a propensity toward criminal activity, and who is found to have either such intellectual deficiency or emotional unbalance, or both, as to clearly *247demonstrate an actual. danger to society so as to require such confinement and treatment, when appropriate, as may make it reasonably safe for society . to terminate the confinement and treatment.” Md. Ann. Code, Art. 31B, § 5.
Defective-delinquency proceedings are ordinarily, instituted immediately after conviction and sentencing; they may also be instituted after the defendant has served part of his prison-term. §§ 6 (b),'6 (c).1 In either event, the process begins with a court order committing the prisoner to Patuxent for a psychiatric examination. §§ 6 (b), 6 (d). The institution is required to submit its report to the court within a fixed period of time. § 7 (a).2 If the report recommends commitment, then a hearing must be promptly held, with a jury trial if requested by' the prisoner, to determine whether he should be committed as a defective delinquent. § 8. If he is so committed, then the commitment. operates to suspend the prison sentence previously imposed. § 9 (b).
In Murel v. Baltimore City Criminal Court, post, p. 355, several prisoners who had been committed *248as defective delinquents sought to challenge various aspects of the criteria and procedures that resulted in- their commitment; we granted certiorari in that case together . with this one, in order to consider together these challenges to . the Maryland statutory scheme. For various reasons we decline today to reach those questions, see Mur el, supra. But Edward McNeil presents a much more stark and simple claim. He has never been committed as a defective delinquent, and thus he has no cause to challenge the criteria and procedures that control a defective-delinquency hearing. His confinement rests wholly on the order committing him for examination, in preparation for such a commitment hearing. That order was made, not on the basis of an adversary hearing, but on the basis of an ex parte judicial determination that there was “reasonable cause to believe that the Defendant may' be a Defective Delinquent.” 3 Petitioner does not challenge in this - Court the power of the sentencing court to issue such an order in the first instance, but he contends' that the State’s power to hold him on the basis of that order has expired. He filed a petition for state post-convictión relief on this ground, inter alia, pursuant to Md. Ann. Code, Art. 27, § 645A.-The trial court denied relief,, holding that “[a] person referred to Patuxent -under Section 6, Article 31B for the purpose of determining whether or not he is a defective- delinquent ,may be detained in Patuxent until the procedures for. such determination have been completed regardless of whether or not the criminal sentence *249has expired.” App. 35-36. The Court of Appeals of Maryland denied leave to appeal. App. 37-38. We granted certiorari, 404 U. S. 999 (1971).
II
The State of Maryland asserts the power to confine petitioner indefinitely, without ever obtaining a judicial determination that such confine'ment is warranted. Respondent advances several distinct arguments in support of that claim.
A. First, respondent contends that petitioner has been committed merely for observation,, and that a commitment for observation need not be surrounded by the procedural safeguards (such as an adversary hearing) that are appropriate for a final determination of defective delinquency. Were .the commitment for observation limited in duration to a brief period, the argument might have some force. But petitioner has been committed “for observation” for' six years, and on respondent's theory of his confinement there is no reason to believe it likely that he will ever be released. A confinement that is in fact indeterminate cannot rest on procedures designed to authorize .a brief period of observation.
We recently rejected a similar argument in Jackson v. Indiana, 406 U. S. 715 (1972), when the State sought to confine indefinitely a defendant who was mentally incompetent to stand trial on his criminal charges. The State sought to characterize the commitment as temporary, and on that basis to justify reduced substantive and procedural safeguards. We held that because the commitment was permanent in its practical effect, it required safeguards commensurate with a long-term commitment. Id., at 723-730. The other half, of' the Jackson argument is equally relevant here. If the- commitment is properly regarded as a short-term confinement with a limited purpose, as the respondent suggests, then lesser safeguards *250may be appropriate, büt by the same token, the duration of the confinement must be strictly limited. “[D]ue process'requires .that the nature and duration of commitment bear some reasonable relation to the purpose for which the individual is committed.” Id., at 738. Just as that principle limits the permissible length of a commitment on account of incompetence to stand trial, so it also limits the permissible length of a commitment “for observation.” We need not set a precise time limit here; it is noteworthy, however, that the Maryland statute itself limits the observation period to. a maximum of six months. While the state courts have apparently construed the statute to permit extensions of time, see n. 2, supra, nevertheless the initial legislative judgment provides a useful benchmark. In this case it is sufficient to note that the petitioner has been confined for six years, and there is no basis for anticipating that he will ever be easier to examine than he is today. In these circumstances, it is a denial of due process to continue to hold him on the basis of an ex parte order committing him for observation.
B. A second argument advanced by the respondent relies on the claim that petitioner himself prevented the State from holding a hearing on his condition. Respondent contends that, by refusing to talk to the psychiatrists, petitioner has prevented them from evaluating him, and has made it impossible for the State to go forward with evidence at a hearing. Thus, it is argued, his continued confinement is analogous to civil contempt; he can terminate the confinement and bring about a hearing at any time by talking to the examining psychiatrists, and the State has the power to induce his cooperation by confining him.
Petitioner claims that he has a right under the Fifth Amendment to withhold cooperation, a-claim we need not consider here. But putting that claim to one side, there *251is nevertheless a fatal flaw in the respondent’s argument. For if confinement is to rest on a theory of civil contempt, then due process requires a hearing to determine whether petitioner has in fact behaved in a manner that amounts to. contempt. At such a hearing it could be ascertained whether petitioner’s conduct is- willful, or whether it is a manifestation of mental illness, for which he Cannot fairly be held responsible. Robinson v. California, 370 U. S. 660 (1962). Civil contempt is coercive in nature, and consequently, there is no justification for confining ón a civil contempt theory a person who lacks the present ability to comply. Maggio v. Zeitz, 333 U. S. 56 (1948). Moreover, a hearing would provide the appropriate forum for resolution of petitioner’s Fifth Amendment claim. Finally, if the petitioner’s confinement were explicitly premised on a finding of contempt, then it would be appropriate to consider what limitations the Due Process Clause places on the contempt power. The precise contours of that power need not be traced here. It is enough to note that petitioner has been confined; potentially for life, although he has never been determined to be in contempt by a procedure that comports with due process. The contempt analogy cannot justify the State’s failure to provide a hearing of any kind.
C. Finally, respondent suggests that petitioner is probably a defective delinquent, because' most noneooperators are. Hence, it is argued; his confinement rests not only on the purposes of observation, and of penalizing contempt, but also on the underlying purposes of the Defective Delinquency Law. But that argument proves too much. For if the Patuxent staff members were prepared to conclude, on the basis of petitioner’s silence and their observations of him over the years, that petitioner is a defective delinquent, then it is not true that he has prevented them from evaluating him". On that theory, *252they have long been ready to make their report to the court, and the hearing on defective' delinquency could' have gone forward.
Ill
' Petitioner is presently confined, in Patuxent without ■any lawful authority to support that confinement. His sentence having expired, he is no longer within the class of persons eligible for commitment to thé Institution as a defective delinquent. Accordingly, he is entitled to be released. The judgment below is reversed, ánd the mandate shall issue forthwith.
D , Reversed.
But not after he Has served all of it. The statute has always provided that no examination may be ordered or held if the person has been released from" custody; since 1971 it has also prohibited the examination if the person is within six months of the expiration of sentence, §6 (c), as amended in 1971. The State asserts that about 98% of the referrals to Patuxent are made immediately after conviction. Tr. of Oral Arg. 27; see Respondent’s Brief 82 n. 33.
The statute originally required the report to be submitted within six months, or before expiration of sentence, whichever later occurs. Since 1971, it has required a report within six months, or three months before expiration of sentence, whichever first occurs. § 7 (a), as amended in-1971. The state courts have construed the statute to permit extension of the allowable time, however, in the case of a noncooperative defendant' who resists examination: State v. Musgrove, 241 Md. 521, 217 A. 2d 247 (1966); Mullen v. Director, 6 Md. App. 120, 250 A. 2d 281 (1969).
Brief for Petitioner 6 n. 5; see Art. 31B, § 6 (b): request for examination' is máde to court “on any knowledge or suspicion of the presence of defective delinquency in such person.” It appears that in this case the trial court issued the order sua sponte; prior to sentencing, the court had- ordered a psychiatric ¿valuation by its own medical officer, who in turn recommended referral to Patuxent for further evaluation and treatment.