delivered the opinion of the Court.
This is an appeal from the denial of a writ of habeas corpus.
The appellant, Billy Ray McElroy, was arrested on the night of March 30, 1955, while attempting to break into a lunchroom on West Camden Street in Baltimore City. He pleaded guilty to an indictment in three counts charging in the first count that he “* * * unlawfully, with the malicious intent then and there unlawfully to break the storehouse of Charles E. Bieckert, there situate at Four hundred and eight West Camden Street, in said City, and feloniously to steal, take and carry away the goods and chattels therein found, * * * did endeavor to break open the lock of said closed door of said storehouse and endeavor to open the said closed door of said storehouse, against the peace, government and dignity of the State.” In the second count it was charged that he “* * * unlawfully, with the malicious intent then and there unlawfully to break the storehouse of Charles E. Bieckert, there situate at Four hundred and eight West Camden Street, in said City, and unlawfully to steal, take and carry away. the goods and chattels therein found, * * * did endeavor to break open the lock of said closed door of said storehouse and endeavor to open the said closed door of said storehouse, against the peace, government and dignity of the State.” In the third count he was charged with being “* * * a rogue and vagabond, in *387violation of Article 27, Section 576, of the Annotated Code of Maryland; contrary to the form of the Act of Assembly in such case made and provided, and against the peace, government and dignity of the State.” Judge Niles, in the Criminal Court of Baltimore, on May 5, 1955, sentenced the appellant to not more than one year in the Maryland State Reformatory for Males from March 30, 1955, and ordered that he be taken to Patuxent Institution for observation and treatment.
Code 1951, Article 31B, (Defective Delinquents), Section 6 (a), provides: “(Requests for Examination.) (a) A request may be made that a person be examined for possible defective delinquency if he has been convicted and sentenced in a court of this State for a crime or offense coming under one or more of the following categories: (1) a felony; (2) a misdemeanor punishable by imprisonment in the penitentiary; (3) a crime of violence; (4) a sex crime involving: (a) physical force or violence, (b) disparity of age between an adult and a minor, or (c) a sexual act of an uncontrolled and/or repetitive nature; (5) two or more convictions for any offenses or crimes punishable by imprisonment, in a criminal court of this State.”
As a result of the report of the Director of Patuxent Institution dated December 19, 1955, proceedings were begun against the appellant as a defective delinquent under the provisions of Code, 1951, Article 31B, supra, Section 8. That section provides that when such report states that the person is a defective delinquent, among other things, that person or the State can select a court or jury trial. The court or jury shall find specially by its verdict whether the defendant is a defective delinquent. The defendant shall be represented by counsel of his own choice, or, if he makes no choice, by competent counsel appointed by the court. By Article 3 IB, supra, Section 9 (b), if the defendant is found to be a defective delinquent, the court shall order him committed “or returned to the institution for confinement as a defective delinquent, for an indeterminate period without either maximum or minimum limits. In such event, the sentence for the original criminal conviction, or any unexpired portion thereof, shall be and remain suspended, and the defendant shall not longer be confined for any portion of said original sentence, except as otherwise pro*388vided herein. Instead, the defendant shall thenceforth remain in the custody of the institution for defective delinquents, subject to the provisions of this Article.” By Article 31B, supra, Section 11, from any court order issued under the provisions of Section 9, supra, “* * * there shall be the same right of appeal to the Court of Appeals as after any conviction of felony.”
On December 21, 1955, the appellant was arraigned as a defective delinquent. He asked for appointment of counsel, and counsel was appointed to represent him. The jury was sworn and trial begun on February 8, 1956. The jury on February 10, 1956, made a finding that appellant was a defective delinquent and he was ordered to be committed to Patuxent Institution subject to further order of the court. No appeal was taken to this Court from that order. On February 27, 1956, a petition praying for the issuance of a writ of habeas corpus was mailed by the appellant, acting in proper person, to Chief Judge William R. Horney, of the Circuit Court for Queen Anne’s County. This application was denied without hearing in a memorandum opinion by Judge Horney, dated March 6, 1956, in which he held that appellant’s application stated no basis for relief.
On March 11, 1956, the appellant, in proper person, filed application for leave to appeal to the Court of Appeals from Judge Horney’s order. Leave to appeal was granted by this Court on June 15, 1956, and counsel was appointed to represent him.
Code, 1951, Article 31B, supra, Section 10, provides that any person confined as a defective delinquent under an indeterminate sentence may file a petition in the circuit court requesting that he be brought before. said court for the purpose of having the defective delinquency of such person redetermined. It is also provided that the court shall forthwith proceed to hear and determine the matter. If a jury trial is prayed it shall be given. The party shall have the right to counsel and process to compel the attendance of witnesses. If such person is determined by the court or jury to be a defective delinquent, he is recommitted to the institution from which he immediately came. Otherwise he shall be dis*389charged from such confinement and custody “* * * or in the discretion of the Court committed under his original sentence, less such time as he has already served in the institution for defective delinquents or elsewhere within the custody of the Board of Correction.” After the right to apply for any such petition for review shall have been exercised once, it shall not again be sought under the provisions of that section within less than three years following the prior seeking of a petition for review from confinement under the same commitment. No petition for review has been filed in this case. By Code, 1951, Article 31B, supra, Section 11, from any court order issued under the provisions of Section 10, supra, “* * * there shall be the same right of appeal to the Court of Appeals as after any conviction of felony.” Section 10, supra, also provides under (c) : “The right to review specified in this section shall not be construed to deprive the defendant of his right to petition for habeas corpus as it might otherwise exist.” Until 1945 there was no appeal from a denial of release under a writ of habeas corpus. Bell v. State, 4 Gill 301; Ex parte Coston, 23 Md. 271; Coston v. Coston, 25 Md. 500; State v. Boyle, 25 Md. 509; Annapolis v. Howard, 80 Md. 244, 30 A. 910.
Code, 1951, Article 42, Section 6, Chapter 702, Section 3C, of the Acts of 1945, for the first time in criminal cases granted a right of appeal to this Court in habeas corpus cases. This was narrowed by Chapter 625, Section 3C, of the Acts of 1947, to a right to apply for leave to appeal. Article 42, supra, Section 7, provides that the right of appeal “* * * shall not apply to any case unless the petitioner is detained for or confined as the result of a prosecution for a criminal offense.”
The appellant here contends, in argument and brief prepared by his able counsel appointed by this Court, that the Criminal Court of Baltimore had no jurisdiction to impose an indeterminate sentence on appellant because he had not been first convicted of the crimes specified in Article 31B, Section 6 (a), supra, quoted above, which is necessary before jurisdiction attaches. Even if we assume that the appellant is entitled to an appeal to this Court, which we do not find in *390this case, and assume without deciding that lack of jurisdiction in the Criminal Court of Baltimore can be raised on habeas corpus by a defective delinquent, compare Superintendent v. Calman, 203 Md. 414, 101 A. 2d 207, we must note that appellant was convicted under the indictment, among other things, for being a “rogue and vagabond”, a misdemeanor in violation of Code, 1951, Article 27,' Section 576. That section provides that the sentence shall be “* * * to. the penitentiary for not less than one month nor more than two years, or to imprisonment in jail, at the discretion of the court, for a like term.” Enumerated in Article 3IB, Section 6 (a), supra, above quoted, is “(2) a misdemeanor punishable by imprisonment in the penitentiary.” Therefore, the appellant should not be released under the writ of habeas corpus, if granted.
However, the primary, question before us in this case is whether the appellant is now confined as a result of a prosecution for a criminal offense. If he is so confined, his appeal should be considered here. If not, his appeal should be dismissed.
In Bailey v. Superintendent, 190 Md. 735, 60 A. 2d 188, George A. Bailey had been awaiting trial on the charge of being an Incorrigible Minor. He pleaded guilty and it was recommended that he be confined in Spring Grove State Hospital until he recovered his reason or be discharged by due course of law. Judge Niles, of the Criminal Court of Baltimore, therefore passed an order committing him to Spring Grove. Bailey filed in this Court an application for leave to appeal from the refusal of a writ of habeas corpus. This Court held in that case that Bailey was not “detained for or confined as the result of a prosecution for a criminal offense”. In Miller v. Superintendent, 190 Md. 741, 60 A. 2d 189, George S. Miller was confined in Spring Grove State Hospital as the result of a trial in the Criminal Court of Baltimore where he pleaded “not guilty by reason of insanity”. A judgment was entered that he be committed to Spring Grove until he recovered his reason or be discharged by due process of law. We held in that case that Miller was not “detained for or confined as the result of a prosecution for a criminal offense”, *391and therefore that this Court had no jurisdiction on appeal. The appellant here contends that under Code, 1951, Article 31B, supra, the procedure is in the nature of a prosecution for a criminal offense, because some criminal procedures are followed in the trials of defective delinquents. Under the provisions of Code, 1951, Article 42, Section 7, supra, in order for this appeal to lie, he must have been confined “as the result of a prosecution for a criminal offense”. It is difficult to see here any distinction between this case and Miller v. Superintendent, supra. There, Miller had been arraigned in the Criminal Court of Baltimore for a criminal offense and pleaded not guilty by reason of insanity. As a result he was confined in Spring Grove. Here, the appellant pleaded guilty to criminal offenses, and as a result is confined in Patuxent Institution.
It is, of course, true that where insanity exists, the person confined could be adjudicated insane and committed regardless of whether he had committed a crime. Salinger v. Superintendent, 206 Md. 623, 112 A. 2d 907. However, in Bailey v. Superintendent, supra, and Miller v. Superintendent, supra, where the petitioners were brought before the court in a criminal prosecution and committed to Spring Grove, this Court held that they were not detained for or confined as a result of a prosecution for a criminal offense.
In Eggleston v. State, 209 Md. 504, 513, 121 A. 2d 698, 702, 703, a direct appeal, under Article 31B, Section 11, supra, was taken to this Court from an order finding the appellant to be a defective delinquent, under Article 31B, Sections 8 and 9, supra; suspending his original sentence to the House of Correction; and committing him to Patuxent Institution for an indefinite period, subject to further order of the court. In that case the legislative history of Article 31B, supra, was discussed in detail and the statute held constitutional. Judge Henderson there said: “We think the statute is sufficiently certain and definite and sets up matters that are susceptible of proof. The statutory emphasis is on confinement and treatment of these persons rather than on punishment or deterrence. The statute represents the legislative adoption of concepts that have long been recommended by leading psychiatrists and penologists. See Guttmacher and *392Weihofen, Psychiatry and the Law, pp. 444-446. The new Act was the end result of several years of study by a commission authorized by the Legislature and appointed by the Governor, by a special advisory committee appointed by the Board of Correction, and by a committee appointed by the Legislative Council. Moreover, the Legislature appropriated funds for the construction of a new institution to deal with the problem. The new Act calls for a staff composed of professional psychiatrists, psychologists and sociologists. In character the Act is not unlike statutes providing for a civil inquiry into the sanity of a person. This character is not altered by the fact that it deals only with persons who have demonstrated criminal tendencies resulting in criminal convictions, nor by the fact that it utilizes some of the traditional methods of adjudication and review that have been developed in the criminal law.”
In contending that he is confined as the result' of a prosecution for a criminal offense, the appellant relies on cases from other jurisdictions. However, as the case before us depends solely upon the interpretation of the Maryland statutes, those cases are not helpful here. The appellant here is not detained by reason of a criminal offense. The sentence for the criminal offense was to the Reformatory for Males. He is presently confined in Patuxent Institution because he is a defective delinquent.
If the Legislature desires that a right of appeal to this Court should be given in habeas corpus cases for persons detained under Article 31B, supra, a legislative and not a judicial problem, it can do so by appropriate legislation at its next session which meets within the next six weeks, and clarify the issue. We do not interpret the statutes now in effect to provide for such an appeal. The appeal will therefore be dismissed.
Appeal dismissed, with costs.