By order of the Probate Court for. Greenville. County dated March 25, 1955, respondent was adjudged insane and committed to the custody of appellant, Superintendent of *553the State Hospital. The order was issued pursuant to Section 32-912 of the 1952 Code, 1955 Supplement, upon application by respondent’s wife, and after examination of respondent by two designated physicians. Less than three months thereafter he applied to the Judge of the Richland County Court for a writ of habeas corpus, alleging in his petition therefor that he had been illegally committed and “is presently unlawfully restrained of his liberties”, and “that he is not insane and is confident that he can establish his sanity upon a fair and impartial hearing before this Court”. Appellant made return, contending, inter alia, that the writ should be discharged for the reason that the petitioner had not exhausted the remedy available to him under Section 32-930 of the 1952 Code, 1955 Supplement. The trial judge, overruling this contention, proceeded on June 2, 1955, to take testimony “on the merits”, and on the same day adjudged the petitioner sane and ordered his release. Appellant renews here his contention referred to above.
Respondent has moved to dismiss upon the ground that the State, being in reality the appellant, may not appeal from an order in a habeas corpus proceeding discharging the petitioner from custody. That the State may appeal from such order was recognized in Ex parte Murray and Harris, 112 S. C. 342, 99 S. E. 798, 5 A. L. R. 1152. Cf. Code 1952, Section 17-363. The motion to dismiss is denied.
This Court has not had occasion heretofore to pass upon the question of whether one who has been adjudged insane and committed by an order of court to the State Hospital may, in habeas corpus before another tribunal, attack the factual finding of his insanity at the time of his commitment, or try the issue of his return to sanity. Sims v. McLure, 8 Rich. Eq. 286, 28 S. C. 286, to which respondent refers in his brief, is no authority for his contention that the fact of sanity 'may be re-examined in a habeas corpus proceeding; that case involved only the validity (i. e., the fairness) of *554certain contracts made with a lunatic without notice of the lunacy.
The limitations upon the scope of the writ are well expressed in 25 Am. Jur., Habeas Corpus, Section 13, as follows :
“The inquiry on a writ of habeas corpus is addressed not to errors committed by a court within its jurisdiction but to the question of whether the proceedings or judgment under which the petitioner is restrained are void. Ordinarily, such an inquiry involves no question other than those which pertain to jurisdiction. The function of a writ of habeas corpus in permitting the petitioner to challenge by collateral attack the jurisdiction under which the process or judgment by which he is deprived of his liberty was issued or rendered cannot be distorted by extending the inquiry to mere errors of trial courts acting within their jurisdiction.”
In Ex parte Klugh, 132 S. C. 199, 128 S. E. 882, 885, which concerned a prisoner convicted of crime and confined in the State Penitentiary, Mr. Justice Marion, speaking for the court, said:
“It is fundamental that habeas corpus is a collateral remedy, subject to the limitations common to collateral proceedings, and calls in question only the jurisdiction of the court whose judgment is challenged. * * * It is only when a judgment of conviction or sentence imposed is void, and not merely voidable, that relief may be had by habeas corpus”.
In Medlock v. Spearman, 185 S. C. 296, 194 S. E. 21, it was reaffirmed that in a habeas corpus proceeding for a convicted prisoner’s release from imprisonment the court cannot consider the sufficiency of the evidence to sustain the conviction.
And in Ex parte Boyle, 128 S. C. 535, 123 S. E. 9, which involved the arrest of one who had sold meat that had not been slaughtered and inspected in accordance with a city ordinance, it was declared that an issue of fact could not be *555determined upon a writ of habeas corpus, and the court therefore addressed itself only to the issues of law presented by the petitioner’s contentions: (1) that the city council had no power to pass the ordinance, and (2) that the ordinance was unconstitutional upon its face.
The rule expounded in Medlock v. Spearman, supra, applies with equal logic to respondent’s contention that he can in this proceeding attack the factual finding by the Probate Court that he was insane at the time of his commitment.
As to whether one seeking release from the custody to which he has been committed upon judicial determination of his insanity may litigate the issue of his present sanity in a habeas corpus proceeding, the decisions in other jurisdictions are not uniform. Many of them are collected in the annotations following State ex rel. Colvin v. Superior Court, 1930, 159 Wash. 335, 293 P. 986, 73 A. L. R. 555, and Overholser v. Boddie, 1950, 87 U. S. App. D. C. 186, 184 F. (2d) 240, 21 A. L. R. (2d) 999. In general, those that hold that a person confined in an insane asylum may have his sanity tested in a proceeding in habeas corpus for his release appear to be based upon one or .other of the following propositions:
1. That no other adequate means of such relief has been provided by statute; or
2. That the statute providing such means of relief is, expressly or impliedly, not exclusive.
In our opinion the writ of habeas corpus may not be converted into an inquisition of lunacy if by statute an adequate remedy is provided whereby one who has been adjudged insane may litigate the issue of his return to sanity. Unless contrary legislative intent be clearly apparent, such statutory remedy should be deemed exclusive.
The General Assembly has provided in the Act of March 7, 1952, 1955 Code Supplement, Sections 32-909 through 32-932, a reasonably speedy and, in our opinion, adequate *556procedure whereby a person confined in the State Hospital as insane may litigate the issue of his return to sanity. Section 32-930 reads as follows:
“Any patient confined under the provisions of §§ 32-912 and 32-915, who requests to be discharged or whose discharge is requested in writing by the person who made the application for his admission, by his spouse, adult next of kin, legal guardian or friend shall be discharged within seven days after receipt of the request except that, such request may be denied by the superintendent of the State Hospital if the request be made sooner than thirty days after admission; and except also that, upon application to the probate - court supported by a certification by the superintendent of the hospital that-in his opinion discharge would be unsafe for the patient or for others, such discharge may be postponed for a period not to exceed fifteen days which the court may determine to be necessary for the commencement of proceedings for a judicial determination pursuant to §§ 32-918 to 32-926”.
The proceedings for judicial determination pursuant to Sections 32-918 to 32-926 include:
1. Application to the Probate Court for hospitalization of the proposed patient, such application to be accompanied by .either (a) a certificate of a physician stating that he has examined the proposed patient and is of opinion that he is mentally ill, or (b) a written statement by the applicant that the proposed patient has refused to submit to examination by a physician;
2. Prompt examination of the proposed patient by two court-appointed examiners ;
3. If both examiners report that the proposed patient is mentally ill, a full hearing, to be held not later than fifteen days thereafter, at which the proposed patient shall be represented by counsel and the court shall receive all relevant and material evidence offered on the issue of his sanity; and
4. If upon the hearing the court shall find the proposed patient to be mentally ill and order his hospitalization, the *557right of appeal to the court of common pleas, and to trial there de novo.
Respondent relies upon Section 32-950.13, which declares that: “Any individual detained pursuant to this chapter shall be • entitled to the writ of habeas corpus upon proper petition by himself or a friend to any court generally empowered to issue the writ of habeas corpus in the county in which he is detained”. But this section does not purport, either expressly or by necessary implication, to broaden the scope of habeas corpus. It merely reaffirms that the writ is available, as it always has been, to test not the factual issue of the petitioner’s sanity but the legality of the proceedings or judgment under which he was committed and is being confined.
Reversed.
Stukes, C. J., Oxner, J., and G. Badges. Baker, A. A. J., concur. Taylor, J., dissents.