
165 S.E.2d 102 (1968)
STATE ex rel. Willie RENDER, Jr.
v.
Honorable George W. WOOD, Judge of the Intermediate Court of Kanawha County.
No. 12768.
Supreme Court of Appeals of West Virginia.
Submitted October 29, 1968.
Decided December 10, 1968.
*103 Ernest H. Gilbert, Charleston, for relator.
C. Donald Robertson, Atty. Gen., of W. Va., Leo Catsonis, Asst. Atty. Gen., Charleston, for respondent.
CALHOUN, Judge.
In this prohibition proceeding instituted in this Court, Willie Render, Jr., who in this opinion may be referred to as the relator or as the prisoner, seeks to prohibit the respondent, Honorable George W. Wood, Judge of the Intermediate Court of Kanawha County, from resentencing the relator upon a plea of guilty entered by the relator to an indictment charging a felony.
The basic contention made in behalf of the relator is that the intermediate court now has no jurisdiction or authority to impose a sentence upon the plea of guilty previously entered by the relator in that court on October 25, 1961. It is essential to state in some detail the background facts in order to place in proper focus the precise basis of the contention that the trial court now lacks jurisdiction or authority to resentence the relator under the circumstances of this case.
In September, 1961, the relator, then seventeen years of age, was indicted by a grand jury in the Intermediate Court of Kanawha County upon a charge commonly referred to as "unarmed robbery". On October 25, 1961, the relator appeared in open court in person and by counsel and entered a plea of guilty to the charge contained in the indictment.
Further proceedings in the case were deferred in order that an investigation might be made to enable the court to determine whether the prisoner should be placed on probation. On January 10, 1962, the prisoner appeared in court in person, but without counsel; and thereupon the court, on its own motion, suspended imposition of sentence pursuant to the plea of guilty previously entered and placed the prisoner on probation for a period of three years. We deem it pertinent to note at this point that Code, 1931, 62-12-11, as amended, contains the following language: "The period *104 of probation together with any extension thereof shall not exceed five years. * *." There is no contention that the period of the three-year probation was ever extended.
On July 7, 1964, the relator was served with a notice requiring his appearance in the intermediate court for a hearing upon an alleged violation of the terms of his probation. In that connection he was notified that he was entitled to present witnesses in his behalf and to be represented by counsel at the hearing, but that the court "is not authorized to appoint counsel for you." The relator, being without funds with which to employ counsel, appeared at the hearing in person but without counsel. At the conclusion of testimony in favor of and against the prisoner at the hearing, the court forthwith revoked the probation previously granted and sentenced the prisoner to confinement in the state penitentiary for an indeterminate period of five to eighteen years.
It will be noted that the hearing was held well within the three-year period of probation. The issue arising at this point involves the fact that the prisoner was not represented by counsel when the probation was revoked and when the penitentiary sentence was imposed. After the probation was revoked and the sentence imposed, the prisoner was remanded to the Kanawha County jail and shortly thereafter he was taken to the state penitentiary to commence the serving of the indeterminate sentence of five to eighteen years.
About three and one-half years later, in January, 1968, and after the expiration of the five-year maximum period of probation permitted by statute, the prisoner commenced a habeas corpus proceeding in the trial court by which he had been sentenced. In a petition obviously prepared by a layman, the prisoner asserted that he was illegally detained in the state penitentiary because (1) he had not been represented by counsel at the time imposition of sentence was suspended and he was released on probation and because (2) he was not represented by counsel at the hearing which resulted in the revocation of probation and sentence to the state penitentiary.
In connection with the habeas corpus proceeding instituted by the prisoner in the trial court in January, 1968, he was represented by able counsel who was perhaps assigned by the court to represent the prisoner in that proceeding. Counsel for the prisoner, upon proper motion, was granted permission by the court to amend the habeas corpus petition so as to delete the allegation of prejudice from his failure to be represented by counsel when imposition of sentence was suspended and the prisoner was placed on probation; and, in lieu thereof, to permit the prisoner expressly to waive and abandon any claim of right or prejudice which may have resulted from his failure to be represented by counsel at the time he was placed on probation.
At the habeas corpus hearing, testimony of one witness was taken, over objection of counsel for the prisoner, to prove that the prisoner had violated the terms of his probation. Thereupon the trial court concluded as a matter of law that the order of January 10, 1962, by which the prisoner was placed on probation, and also the order of July 17, 1964, by which probation was revoked and sentence imposed, were both void because the prisoner was not represented by counsel in connection with the proceedings reflected by such two orders. The court thereupon ordered the defendant to appear in court on October 16, 1968, to be resentenced upon his plea of guilty entered on October 25, 1961.
In this prohibition proceeding, the prisoner, by counsel, asserts that the trial court had no jurisdiction or authority to void the probation in September, 1968; that the trial court has no jurisdiction or authority now to resentence the prisoner upon the conviction consequent upon his plea of guilty; and that, therefore, the writ prayed for should be awarded.
The trial court and counsel for the respondent apparently took the position that the prisoner had an absolute right to be *105 represented by counsel in court on January 10, 1962, when imposition of sentence was suspended and he was placed on probation for three years; and that inasmuch as the prisoner was not represented by counsel at that time, the suspension of imposition of sentence and the release on probation are void and a nullity. We consider that position to be legally unsound and untenable.
The prisoner was properly represented by counsel on October 25, 1961, when he was arraigned and when he entered his plea of guilty to the charge contained in the indictment. The probation was not a matter of right in the prisoner but rather a mere matter of grace on the part of the court. We are of the opinion that the probation order is valid despite the fact that the prisoner was not represented by counsel when he was released on probation; that it continued to be valid during the three-year period; and that, since the expiration of that period, the court lacks jurisdiction to revoke the probation and to impose a sentence of imprisonment pursuant to the plea of guilty.
We are of the opinion that the trial court order of July 17, 1964, by which the court undertook to revoke the probation and to impose a sentence of five to eighteen years, is void and a nullity because the prisoner was not then represented by counsel. The prisoner, not having been legally sentenced within the three-year period of probation, the trial court now lacks jurisdiction to impose a sentence upon the plea of guilty and that if such a sentence were hereafter imposed, it would be void and unenforceable.
It is clear, under the law of this state, that a writ of prohibition directed by this Court against a trial court within this state shall lie as a matter of right in any case in which the trial court lacks jurisdiction of the subject matter in controversy, or, having such jurisdiction, exceeds its legitimate power. Code, 1921, 53-1-1; Code, 1931, 53-1-2, as amended; State Road Commission of West Virginia v. Hereford, 151 W.Va. 526, pt. 2 syl., 153 S.E.2d 501.
The present case and the habeas corpus case of State ex rel. Strickland v. Melton, Sheriff of Kanawha County, W.Va., 165 S.E.2d 90, involve similar legal questions for decision and, therefore, by agreement of counsel, the two cases were argued and submitted for decision together. The Court's opinion in the Strickland case and the opinion in the present case are handed down simultaneously. Pertinent authorities have been thoroughly referred to and ably discussed in the opinion in the Strickland case and, therefore, reference is here made to that opinion in further substantiation of the legal principles decided in the present case.
For reasons stated in this opinion, the writ of prohibition herein prayed for is awarded.
Writ awarded.
