
28 Wis.2d 188 (1965)
STATE EX REL. COPAS, Petitioner,
v.
BURKE, Warden, Respondent.
Supreme Court of Wisconsin.
September 15, 1965.
*189 For the petitioner there was a brief by William L. McCusker of Madison.
*190 For the respondent there was a brief by Bronson C. La Follette, attorney general, and William A. Platz, assistant attorney general.
HALLOWS, J.
Petitioner was found guilty by a jury in the circuit court for Dane county on February 7, 1963, of violating sec. 944.17 (1) (sexual perversion), sec. 944.11 (2) (indecent liberties with a person under eighteen years of age), and sec. 947.15 (1) (a) (contributing to the delinquency of a child), Stats. Because of his conviction under sec. 944.11, the trial court as required by sec. 959.15 (1) temporarily committed the petitioner to the state department of public welfare for a presentence social, physical, and mental examination. The report of the department recommended the petitioner was in need of specialized treatment for his mental aberrations and the case should be disposed of under sec. 959.15 (6).[1] Upon receiving this report, the trial court appointed two private psychiatrists to examine the petitioner and report to the court. From the reports of these psychiatrists the trial court was satisfied the petitioner was not dangerous to the public and some improvement could be expected if given an opportunity for psychiatric help privately. The court stated it realized crowded conditions existed at the sex deviate center at the state prison and the petitioner might very likely not be helped there under such conditions.
*191 On May 7, 1963, the trial court placed the petitioner on probation on the condition he receive outpatient treatment for his mental and physical aberrations from one of the psychiatrists at his own expense. However, before placing the petitioner on probation and at the insistence of the assistant district attorney the trial court sentenced petitioner to the state prison at Waupun for two concurrent terms of four years each on the two felony counts and to the Dane county jail for one concurrent term of one year on the misdemeanor count and stayed the execution of the sentences.
On October 3, 1963, the petitioner was brought back to court because of an alleged violation of his probation. After a hearing the court found the petitioner violated his probation by lack of co-operation with his psychiatrist and by attempting a sex crime. Probation was revoked and the petitioner was committed to the custody of the state department of public welfare for treatment at its sex deviate treatment facility at the state prison at Waupun pursuant to sec. 959.15 (6), Stats. There is some inconsistency in the facts at this point. At this hearing the court stated it withheld sentencing when it placed the petitioner on probation, and the order of October 3, 1963, so recites. However, the transcript of the hearing of May 7, 1963, clearly shows the petitioner was sentenced to Waupun and to the county jail and the execution stayed.
The petitioner claims that since on May 7th he was sentenced to prison for the two felonies and then placed on probation he could not validly be committed to the state department of public welfare at its sex deviate facility upon revocation of his probation but should have been taken directly to prison to serve his sentence. This argument assumes the sentencing of May 7, 1963, to prison for the conviction of the felonies and then staying the sentences was within the jurisdiction of the court. We believe this is an erroneous assumption. The trial court, upon receiving *192 the state department of public welfare's report of its presentence social, physical, and mental examination recommending specialized treatment for the petitioner, was without power to sentence him to prison on a punitive basis as it would under sec. 959.15 (5), Stats., if no specialized treatment had been recommended.
The sexual-deviate act was created by ch. 542, sec. 2, Laws of 1951, and replaced the unworkable sexual psychopath law of 1947. The purpose of the act is to protect society from dangerous sex crimes and to provide treatment for the dangerous sex offenders. The act does not apply to all persons committing a sex offense. In the case of offenders whose conduct involved use of force or sex practices with children a commitment to the state department for a presentence examination is mandatory. Sec. 959.15, Stats. In other cases involving sex crimes, such examination is discretionary with the court. A conviction of a sex crime is necessary to come within the purview of the act. Wood v. Hansen (1954), 268 Wis. 165, 66 N. W. (2d) 722. For an analysis of the act and its purpose, see note, Criminal LawWisconsin's Sexual Deviate Act, Wisconsin Law Review (1954), 324.
Originally the act provided in sec. 340.485 (6), now sec. 959.15 (6), Stats., that if the state department of public welfare recommended specialized treatment in its presentence report, the court was required either to place the convicted person on probation with a condition he receive outpatient treatment in such manner as the court prescribed or commit him to the department for treatment. In State v. Sutter (1958), 5 Wis. (2d) 192, 92 N. W. (2d) 229, this court pointed out that when the department of public welfare makes its presentence report of its social, physical, and mental examination the court's authority in dealing with the defendant depends upon whether or not the department *193 recommends specialized treatment for him. This provision was held constitutional in State ex rel. Volden v. Haas (1953), 264 Wis. 127, 131, 58 N. W. (2d) 577, wherein the court pointed out that the Wisconsin legislature on enacting the provision recognized that "sex crimes are frequently committed by persons afflicted with mental aberrations, and has established this means of accomplishing the rehabilitation and adjustment of the offender to society for the protection of the public. There can be no question but that this method of rehabilitation is more desirable, from the standpoint of both the individual and society, than the punishment by imprisonment prescribed in sec. 340.47."
The original act made no express provision for supervision and control by the state department during probation. Some confusion in the practice resulted which led to the amendment so that the probation was "under the provisions of ch. 57," thus giving the state department control and supervision of persons on probation receiving outpatient treatment. It was not the intention of the legislature by the use of these words and the language does not import that the probation under the sexual-deviate law administered under ch. 57 would permit or authorize the court to sentence such person as distinguished from placing him on probation or committing him to the department. (See the report of John W. Tramburg, director, to members of the state department of public welfare dated August 8, 1952.)[2] By ch. 169, Laws of 1961, sec. 959.15 (6), Stats., was amended to provide inpatient treatment as an alternative to outpatient treatment as a condition for probation.
A person for whom the presentence report of the department recommends treatment cannot be sentenced to punitive punishment but must be either committed to the department *194 for treatment or placed on probation with treatment. The probation is a means of providing needed treatment privately without imprisonment or confinement. If the terms or conditions of probation, which is now under the supervision and control of the state department, are violated the person should be returned to the court and it may then commit him to the department for treatment at its sex deviate facility, which is presently located at the state prison at Waupun.
It is argued the sentencing the petitioner to prison and then staying the sentence was only an erroneous judgment not an invalid exercise of power. An erroneous judgment, of course, may be modified prior to the execution of the sentence or if the sentence is stayed, as in this case, before the expiration of the term of court in which the sentence was pronounced. However, the term of the circuit court for Dane county expired prior to the violation of the probation and thus even if the sentence was erroneous it could not now be modified by the trial court. The rules governing the modification of erroneous judgments were recently stated in State ex rel. Reynolds v. County Court (1960), 11 Wis. (2d) 512, 105 N. W. (2d) 812, and are of long standing. See In re Graham (1889), 74 Wis. 450, 43 N. W. 148. It is quite plain in this case we are not dealing with an erroneous judgment which a court has the power to make but with a judgment which the court had no power or jurisdiction to make. Because its judgment sentencing the petitioner to prison on May 7, 1963, was void, the court had jurisdiction and the duty on October 3d to commit the petitioner to the department at its sex deviate facility under sec. 959.15 (6), Stats.
By the Court.The writ of habeas corpus is denied.
NOTES
[1]  "(6) Commitment to the department. If it appears from said report that the department recommends specialized treatment for his mental or physical aberrations, the court shall order the proper county authorities to bring him before the court at county expense and shall either place him on probation under ch. 57 with the requirement as a condition of such probation, that he receive outpatient or inpatient treatment in such manner as the court prescribes, or commit him to the department under this section. If he is committed to the department the court shall order him conveyed by proper county authorities, at the expense of the county to the sex deviate facility, established by the department."
[2]  Legislative Reference Bureau (Drafting Records for ch. 85, Laws of 1953).
