The opinion of the court was delivered by
Burch, J.:Steve Albert Davis is confined in the Kansas State Penitentiary at- Leavenworth and has filed a petition in this court for writ of habeas corpus. The principal contention of the petitioner is that he was entitled to the assistance of counsel and that he did not waive his right to counsel by stating in writing that he did not want counsel to represent him as required by G. S. 1943 Supp. 62-1304.
In the district court of Johnson county, Kansas, on May 31, 1944, the petitioner entered his plea of guilty to an offense allegedly committed on May 28, 1944. He had been charged with unlawfully, feloniously and burglariously breaking into and entering a certain building. Prior to entering his plea of guilty the petitioner was asked by the district court if he had an attorney; he responded in the negative and when asked if he desired an attorney, his answer was to the effect that he did not. The record does not disclose that the district court advised the petitioner of his right to have counsel; neither does it develop that the petitioner waived in writing his *355right to have counsel appointed for him and the record further fails to show that the court made a finding to the effect that the appointment of counsel over the objection of the accused would not be to his advantage. The record does disclose that the court asked the accused if he had any reason why sentence of the court should not be imposed, to which question the accused answered “no,” and that thereafter the court sentenced the accused to be confined at hard labor in the state penitentiary for a period of not less than five nor more than ten years.
Long prior to the date of the sentence, the legislature in 1941 passed the present section 62-1304 of G. S. 1943 Supp. It took effect and became in full force from and after its publication in the official state paper on April 12, 1941, and has thereafter continued in full force and effect. Such statute reads in part as follows:
“If any person about to be arraigned upon an indictment or information for any offense against the laws of this state be without counsel to conduct his defense, it shall be the duty of the court to inform him that he is entitled to counsel, and to give him an opportunity to employ counsel of his own choosing, if he states that he is able and willing to do so. If he does ask to consult counsel of his own choosing, the court shall permit him to do so, if such counsel is within the territorial jurisdiction of the court. If he is not able and willing to employ counsel, and does not ask to consult counsel of his own choosing, the court shall appoint counsel to represent him unless he states in uniting that he does not want counsel to represent him and the court shall find that the appointment of counsel over his objection will not be to his advantage. A record of such proceeding shall be made by the court reporter, which shall be transcribed and reduced to writing by the reporter, who shall certify to the correctness of such transcript, and such transcript shall be filed and made a part of the files in the cause. The substance of the proceedings provided for herein shall be entered of record in the journal and shall be incorporated in the journal entry of trial and judgment. . . .” (Emphasis supplied.)
The record in the present case wholly fails to show that the district court complied with the mandatory enactment of the legislature. The brief in behalf of the state, filed by the attorney general, admits with commendable candor that the prisoner was not lawfully sentenced because of the failure to comply with the cited statute and that his present confinement in the penitentiary is improper. Counsel for the state also, in oral argument, stated that they desire to have the imposition upon the rights of the prisoner corrected. Counsel for the petitioner, appointed by this court, con*356tends that our cases such as Jones v. Amrine, 154 Kan. 630, 121 P. 2d 263; Engels v. Amrine, 155 Kan. 385, 125 P. 2d 379; Garrison v. Amrine, 155 Kan. 509, 126 P. 2d 228; and Bradley v. Amrine, 157 Kan. 451, 141 P. 2d 380, which hold, in substance, that an accused may understandingly and voluntarily waive his right to counsel by entering a plea of guilty, no longer apply because of the enactment of the statute herein set forth. We agree with the petitioner’s counsel. In those cases the pleas were entered and sentences imposed before the applicable statute required that the court should appoint counsel unless the -accused stated;in.writing that he did not want counsel to represent him. Since counsel for the respective parties and this court all agree that. -the ■ district court erred in sentencing the petitioner without complying with the applicable statute, the only ..question which remains, for decision is the proper procedure for the disposition of the petitioner.
From the foregoing it must.follow that the prisoner is now being held under a judgment and. sentence which'were in fact nullities because the proceedings before the trial'-court never reached the point wherein such court had jurisdiction-to entertain the petitioner’s plea of guilty and to pronounce sentence. One of the leading cases upon the general subject is Johnson v. Zerbst, 304 U. S. 458, 82 L. Ed. 1461. From the cited case the following is quoted:
“If the accused, however, is not represented by Counsel and has not competently and intelligently waived his constitutional right, the Sixth Amendment stands as a jurisdictional bar to a valid conviction and sentence depriving him of his life or his liberty. • A court’s jurisdiction at the beginning of a trial may be lost ‘in the course of the -proceedings’ due to failure to complete the court — as the Sixth Amendment, requires — by providing Counsel for an accused who is unable to obtain Counsel, who has not intelligently waived this constitutional guaranty, and whose' life or liberty is at stake. If this requirement of the Sixth Amendment is not- complied with, ■ the court no longer has jurisdiction to proceed. The judgment of conviction pronounced by a court without jurisdiction is void, and one imprisoned thereunder may obtain release by habeas corpus.” (p. 468.)
Unquestionably the petitioner. is entitled to be discharged from the particular restraint under which he is held but it does not follow necessarily that he should be given absolute freedom. Not all of the proceedings in the district court were void. Such court had general jurisdiction of the subject matter by reason of the information having been filed therein. According to the allegations of the information reasons exist for the proper detention of the prisoner and the peace and dignity of the state demand that he be dealt with *357according to law (see 25 Am. Jur. 249, § 153, and 39 C. J. S. 688, § 102.)
From the case of State v. Tyree, 70 Kan. 203, 78 Pac. 525, the second paragraph of the syllabus is quoted as follows:
“Upon the reversal of a judgment of sentence in a criminal case this court is authorized by section 5729, General Statutes of 1901, to remand the cause with instructions to the court below to set aside the erroneous sentence and resentence the appellant.”
From the opinion the following is quoted:
“It appears from the language used in this section that the power to remand the cause with proper instructions is as explicit as the power to reverse, affirm or modify, and it is equally plain that in all cases where the judgment is either reversed, or modified, except as provided in section 292, the cause must be remanded to the court below with proper instructions. The only authority this court has for discharging an appellant upon the reversal of a judgment is found in section 292, supra, and under the provisions of that section it is only when the judgment is reversed and it appears that no offense whatever has been committed. In all other cases the cause must be remanded to the court below with instructions.” (p. 211.)
Section 5729 of the General Statutes of 1901, referred to in the syllabus of the cited case, is the same as the present G. S. 1935, 62-1716, and section 292, referred to in the opinion, is the same as the present G. S. 1935, 62-1717. See, also, State v. Warner, 93 Kan. 378, 144 Pac. 220; State v. Woodbury, 132 Kan. 22, 294 Pac. 928; and State v. Perkins, 156 Kan. 323, 133 P. 2d 160.
The authority of this court to remand the petitioner for further proceedings in the district court is not limited to appeals. The same order can be made properly in habeas corpus proceedings. (See McCleary v. Hudspeth, 124 F. 2d 445; Levine v. Hudspeth, 127 F. 2d 982; and Edwards v. Hudspeth, 159 Kan. 37, 151 P. 2d 698.) Since the petitioner is not entitled to his absolute freedom, the petition for the writ will be denied but it is ordered that he shall be discharged from his confinement under the illegal sentence and judgment and that he be placed in the custody of the sheriff of Johnson county, Kansas, in order that appropriate preceedings against him may be taken in the district court of such county. This court is intentionally refraining from commenting upon other points raised in connection with the petition for the writ so that no prejudice may result to either the state or the petitioner from our decision in connection with further proceedings held in compliance therewith.