
357 So.2d 714 (1978)
James M. GAMMILL, Petitioner,
v.
Louie L. WAINWRIGHT, Director, Division of Corrections, Respondent.
No. 50774.
Supreme Court of Florida.
April 5, 1978.
Michael J. Minerva, Public Defender, for petitioner.
Robert L. Shevin, Atty. Gen., and Wallace E. Allbritton, Asst. Atty. Gen., for respondent.
ADKINS, Justice.
This case is here on a writ of habeas corpus to decide whether James Gammill was invalidly sentenced because he was declared a mentally disordered sex offender in accordance with Chapter 917, Florida Statutes (1975) immediately before sentence was imposed. We have jurisdiction. Article V, Section 3(b)(6), Florida Constitution.
Gammill plead guilty to two charges of kidnapping while in the possession of a firearm. A competency hearing was held at which Gammill's attorney stipulated to a physician's finding that Gammill was competent.
After the trial judge accepted Gammill's guilty plea, Gammill asked and was granted *715 permission by the court to be examined by psychiatrists to determine whether he would qualify for treatment as a mentally disordered sex offender. At a subsequent hearing, the trial judge, after considering two psychiatrists' reports, found Gammill to be a mentally disordered sex offender as defined in Section 917.13, Florida Statutes (1975). Immediately after this determination, the trial judge asked counsel present whether there was any legal reason why he should not pass sentence that day, to which Gammill's attorney replied, "No, sir, your Honor". Thereafter, the trial judge sentenced Gammill to a 35 year prison term for each of the kidnapping offenses, the sentences to run concurrently (with credit given for all time served in the state hospital). Gammill was transferred by the trial court to the Division of Mental Health for treatment at the state hospital in Chattahoochee, Florida, where he is presently institutionalized. The First District Court of Appeal affirmed Gammill's conviction.
No record has been presented to this Court that Gammill contested the legality of his sentence in his appeal to the District Court of Appeal. This Court granted a writ of habeas corpus based on Gammill's pro se application alleging he was being illegally detained because he was sentenced to a 35 year prison term immediately after being declared a mentally disordered sex offender and before his treatment was completed. Petitioner does not contest his commitment to the state hospital, but instead argues that the prison sentence to begin upon his release from treatment is invalid. It is settled law in this State that a defendant may contest at any time any future sentence to be served. State v. Reynolds, 238 So.2d 598 (Fla. 1970).
Under Section 917.13, Florida Statutes (1975)[1], a mentally disordered sex offender is "a person who is not insane but who has a mental disorder and is considered dangerous to others because of a propensity to commit sex offenses." The statute provides that a court "[may] suspend the sentence and certify a defendant for a hearing and examination" to determine whether he is a mentally disordered sex offender if (1) the person is convicted of a felony or misdemeanor currently being prosecuted, whether or not the crime is a sex offense; (2) there is probable cause to believe that the person is a mentally disordered sex offender; and (3) if the mental disorder has existed for at least the preceding four months. Section 917.14, Florida Statutes (1975). If a court determines that a defendant is a mentally disordered sex offender, it "shall commit the defendant" for care, treatments and rehabilitation. Section 917.19, Florida Statutes (1975). Provisions for periodic examinations are outlined in the statute, and, upon a court determination that a person has recovered to the degree that he will not be a menace to others, the court shall discharge the defendant from the institution. If criminal proceedings are still pending, they shall recommence at the time of the discharge. Section 917.20, Florida Statutes (1975).
Gammill contends that he is being sentenced for what is essentially a mental disorder. Our State Constitution, Article I, Section 17, Florida Constitution, and the Eighth Amendment to the United States Constitution ban the imposition of criminal sanctions against an individual because it would be cruel and unusual punishment when his "crime" is that of having an illness. Cf. Robinson v. California, 370 U.S. 660, 82 S.Ct. 1417, 8 L.Ed.2d 758 (1962). Under the facts of this case, however, Gammill's argument is without merit. He did not raise his mental disorder as a defense in the trial court, and sentence was imposed for acts to which he plead guilty, not for his mental disorder.
The purpose of the mentally disordered sex offender statute is clearly treatment and rehabilitation. If all sections of Chapter 917, Florida Statutes (1975) are read together only one interpretation seems appropriate. Section 917.14 says the court "may suspend the sentence" and certify the defendant for a hearing and examination to *716 determine whether he is a mentally disordered sex offender. Section 917.20 says that when a person is recovered to the point he will no longer be a menace to others, he shall be discharged and if criminal proceedings are still pending against him, "they shall recommence at the time of the discharge order." If a court suspends a sentence, this normally implies that a defendant is excused from serving the sentence and is placed on probation or conditionally released. Therefore, applying the usual interpretation of suspended sentence to Section 917.14 would mean that there might not be a criminal proceeding to recommence on discharge from treatment, thus when a defendant qualified for treatment under this statute, he might automatically be relieved from serving any prison term imposed by the court. We do not read the statute to require such an irrational result.
We believe that what was intended by the language "may suspend the sentence" is that the imposition of sentence is suspended until the end of treatment. By deferring the sentencing until a defendant has completed treatment, the court can consider any rehabilitative effect the treatment may have had on the defendant, giving effect to the treatment purpose of the statute without preventing the trial court from requiring a prison term where circumstances indicate that a prison term should be served. There is no problem with suspending the imposition of sentence in this situation. As we stated in Helton v. State, 106 So.2d 79 (Fla. 1958), quoting from Bateh v. State, 101 So.2d 869 (Fla. 1st DCA 1958):
"This is not to say that the trial judge may not withhold temporarily, or even from term to term, the imposition of sentence `for the purpose of determining motions and other matters arising between verdict and judgment, such as gaining information necessary to the imposition of a just sentence or during the pendency of other charges, or for other good and valid reasons.' Bateh v. State, supra [101 So.2d 876]." Helton v. State, supra, at 80.
Since the trial court failed to follow the correct procedure in this case and that failure served to frustrate the purpose of the statute and to prejudice the rights of the defendant, we vacate the sentence and remand to the trial court for disposition in accordance with this opinion.
It is so ordered.
OVERTON, C.J., and ENGLAND, HATCHETT and KARL, JJ., concur.
NOTES
[1]  In 1977, Chapter 917 was substantially reworded. See Chapter 77-312, Laws of Florida.
