
142 S.E.2d 374 (1965)
STATE ex rel. Ronceford LOVEJOY
v.
Otto C. BOLES, Warden, West Virginia Penitentiary.
No. 12445.
Supreme Court of Appeals of West Virginia.
Submitted May 18, 1965.
Decided June 1, 1965.
*375 Dan D. Dahill, Logan, for relator.
C. Donald Robertson, Atty. Gen., George H. Mitchell, Asst. Atty. Gen., Charleston, for respondent.
HAYMOND, Judge:
This is an original habeas corpus proceeding instituted in this Court on March 22, 1965, in which the petitioner, Ronceford Lovejoy, seeks a writ to require the defendant, Otto C. Boles, Warden of the West Virginia Penitentiary, to release him from the penitentiary where he is presently confined under a sentence of life imprisonment, imposed by the Circuit Court of Logan County, West Virginia, on June 12, 1953.
Upon the filing of the petition in this proceeding this Court issued a writ returnable May 18, 1965 and appointed counsel to represent the petitioner. Upon the return day of the writ this proceeding was submitted for decision upon the petition and its exhibits, the answer of the defendant and its exhibits, the written brief in behalf of the petitioner and the oral arguments in behalf of the respective parties. No written brief was filed in behalf of the defendant, who produced the body of the petitioner as commanded by the writ and also filed an answer. The answer alleged that the petitioner was indicted by the grand jury of the Circuit Court of Logan County on May 16, 1934; that the indictment contained two counts, one of which charged the petitioner and another person with breaking and entering a certain store house and the other of which charged the petitioner and another person with entering without breaking a certain store house; that on May 18, 1934, the petitioner was arraigned in court in the custody of the sheriff and entered a plea of guilty to the foregoing indictment and by final judgment rendered on that date the petitioner was sentenced to imprisonment in the penitentiary of this State for a period of three years; that petitioner was again indicted by the grand jury of the Circuit Court of Logan County, West Virginia, on September 14, 1937; that the indictment contained two counts, one of which charged the petitioner and certain other persons with breaking and entering a certain store house and the other of which charged the petitioner and certain other persons with entering without breaking a certain store house; that on September 20, 1937, the petitioner was arraigned in court in the custody of the sheriff and entered a plea of guilty to the foregoing indictment and on October 21, 1937, by final judgment rendered on that date, the petitioner was sentenced to confinement in the penitentiary of this State for a period of five years; that the petitioner was for a third time indicted by the grand jury of the Circuit Court of Logan County on January 12, 1953, for the crime of grand larceny, which indictment charged that the petitioner and another person did steal, take and carry away a certain quantity of copper wire of the value of $75.00 of the goods and chattels of West Virginia *376 Coal and Coke Corporation; that on May 20, 1953, the petitioner was arraigned in court in the custody of the sheriff and entered his plea of not guilty to the offense charged against him in the indictment; that upon the trial of the indictment the petitioner was found guilty as charged; that on June 12, 1953, the prosecuting attorney of Logan County filed an information alleging the two former convictions of the petitioner and by final judgment rendered on that day the petitioner was sentenced to confinement in the penitentiary of this State for the remainder of his natural life and he was credited with a period of 121 days during which he had been confined in the county jail before the imposition of the foregoing sentence. There is no denial of the foregoing facts and they are fully established by the record in each of the various criminal proceedings. Each of the orders entered in the first two criminal proceedings is silent as to the appointment or the presence of counsel for the petitioner. The record in the proceeding in which the petitioner was tried for the principal offense of grand larceny shows that he was represented in that proceeding by court appointed counsel for whom a fee was allowed and fixed by the trial court.
The petitioner contends that the sentence of life imprisonment is unconstitutional, null and void for the reason that the petitioner, an indigent person who was not financially able to employ counsel, was denied the assistance of counsel to defend him against the first two offenses of which he was convicted, in violation of the Sixth Amendment and the Due Process Clause of the Fourteenth Amendment to the Constitution of the United States and that, though he had the assistance of counsel upon the trial of the principal offense in May 1953, he was not duly cautioned concerning the information filed against him which charged him with the two prior convictions of offenses punishable by confinement in the penitentiary of this State and that for that additional reason the sentence of life imprisonment is unconstitutional, null and void.
It does not appear from the record that the petitioner had the assistance of counsel or that he in any wise waived that right in the first two criminal proceedings in the Circuit Court of Logan County, West Virginia.
The decision in this proceeding with respect to the two convictions and sentences prior to the conviction and sentence for the principal offense is governed and controlled by the recent decision of this Court in State ex rel. Whytsell v. Boles, W. Va., 141 S.E.2d 70. In the Whytsell case this Court held in point 1 of the syllabus that "The denial of the fundamental right of the defendant to the assistance of counsel in a criminal proceeding applies to and invalidates any prior conviction of an offense within the meaning of a recidivist statute, and such conviction and any sentence of imprisonment imposed upon it, being null and void because of such denial, can not justify or support the imposition of any additional punishment under such statute."; and in point 2 of the syllabus that "To justify the imposition, under the recidivist statute of this State, of a sentence in excess of the sentence provided for the principal offense, the previous conviction and sentence must be a valid conviction and sentence; and if such previous conviction and sentence are void they will not constitute the basis for the imposition of the punishment provided by such statute and, in that situation, such statute will be deemed to be wholly inapplicable."
As the conviction and sentence for each of the two prior felonies punishable by confinement in the penitentiary are null and void for the reason that the petitioner was denied the assistance of counsel in each of those proceedings and for the additional reason that the petitioner was not duly cautioned by the circuit court with respect to his acknowledgment that he was the same person who had been twice previously convicted and sentenced to the penitentiary of this State, the circuit court was without jurisdiction to impose the sentence *377 of life imprisonment under the recidivist statute of this State, Sections 18 and 19, Article 11, Chapter 61, Code 1931, as amended, and the enforcement of such sentence will be prevented in this habeas corpus proceeding. "A judgment which is wholly void, or is void in part, is subject to collateral attack and the enforcement of such judgment will be prevented in a habeas corpus proceeding." Point 5, syllabus, State ex rel. Beckett v. Boles, W.Va., 138 S.E.2d 851.
The petitioner also contends that inasmuch as the two prior convictions and sentences are void and inasmuch as he has served the valid portion of the sentence imposed upon his conviction of the principal offense he is entitled to release from his present confinement.
At his trial upon the indictment for the principal offense of grand larceny the petitioner was afforded the assistance of counsel. He had a fair trial, no right of the petitioner was violated or denied, and the circuit court had jurisdiction of that proceeding. The conviction of the principal offense for which the petitioner was tried in the Circuit Court of Logan County in May 1953 was regular and valid in all respects and subjected the petitioner to imprisonment in the penitentiary of this State for an indeterminate term of one year to ten years; and if such sentence had been imposed by the circuit court, instead of the invalid sentence of life imprisonment, it would have required his confinement in the penitentiary for the indeterminate term provided by law. It appears from the record, however, that the maximum period of such confinement terminated and did not in any event extend beyond June 12, 1963 and that the petitioner, who is still confined in the penitentiary, has fully served the maximum period of the sentence provided by law.
A person imprisoned under the valid portion of a sentence imposed upon his conviction of a principal offense who has fully served the maximum sentence provided by law for such offense will be released from custody by a writ of habeas corpus. State ex rel. Whytsell v. Boles, W. Va., 141 S.E.2d 70.
As the petitioner has fully served the valid portion of the sentence imposed by the Circuit Court of Logan County, he is entitled to be released from his present confinement and the defendant is directed to release him forthwith from the confinement imposed by the judgment of that court.
Prisoner discharged.
