
396 P.2d 423 (1964)
74 N.M. 593
Charles A. FRENCH, Petitioner,
v.
Harold A. COX, Warden, New Mexico State Penitentiary, Respondent.
No. 7753.
Supreme Court of New Mexico.
October 30, 1964.
*424 Edward T. Johnson, Santa Fe, for petitioner.
Earl E. Hartley, Atty. Gen., L.D. Harris, Sp. Asst. Atty. Gen., Santa Fe, for respondent.
PER CURIAM.
Petitioner seeks his discharge from the custody of the warden of the New Mexico State Penitentiary, contending that he is held under a void commitment.
Charged in Luna County, New Mexico, by two separate informations, in causes numbered 2543 and 2544, with the second degree murder of two persons, petitioner entered a plea of guilty in each case. He asserts a denial of Due Process because of the failure to appoint counsel to represent and advise with him prior to the preliminary examination. Counsel was appointed and the record shows did advise with petitioner extensively before his arraignment in the district court. We find nothing indicating that the failure to assign counsel prior to his preliminary examination prejudiced petitioner's position in any manner in the district court, and such failure therefore does not require vacating the plea of guilty entered in the district *425 court to each information. Sanders v. Cox, 74 N.M. ___, 395 P.2d 353; Latham v. Crouse (CCA 10) 320 F.2d 120; Application of De Toro, D.C., 222 F. Supp. 621.
The record, stipulated in evidence in this proceeding, discloses that not only was petitioner fully advised by appointed counsel, but at the time of his arraignment to the two informations charging second degree murder, the trial court carefully explained petitioner's rights and accepted pleas of guilty in each case after petitioner intelligently, competently and understandingly entered such guilty pleas.
Following the pleas of guilty, petitioner was charged by information in cause numbered 2545 with having been convicted of five felonies and was therefore subject to increased penalties under the Habitual Criminal Act. Under detailed questioning by the court, after consultation with his attorney, petitioner admitted to being the person convicted of the five felonies charged in the habitual criminal information. The court thereupon, in the cause charging violation of the habitual criminal laws, numbered 2545, sentenced him as an habitual criminal to imprisonment in the New Mexico State Penitentiary for the term of his natural life. The commitment under which he is detained was issued in cause numbered 2545, Luna County.
The Habitual Criminal Act, §§ 41-16-1 to 4, N.M.S.A. 1953, does not make the conviction of prior felonies the subject of punishment, as such, as a separate offense. It only provides that proof of the conviction of prior felonies increases the penalty to be imposed upon conviction of a subsequent felony in New Mexico. The amount by which such penalty is required to be increased depends upon the number of prior convictions. The record before us discloses that no judgment or sentence was imposed or entered in either of the murder cases to which petitioner pled guilty (causes numbered 2543 and 2544). It is clear that the sentence imposed upon petitioner in cause numbered 2545, Luna County, and the commitment issued in said cause under which he is being detained by the respondent warden are void.
It does not follow, however, that petitioner must be unconditionally discharged. Acting with the advice of experienced and competent counsel, he entered pleas of guilty to murder in the second degree in cause numbered 2543 and in cause numbered 2544, Luna County. By his pleas of guilty, he has been legally convicted of felonies in each of those cases supra for which no legal judgment has been rendered. Where there has been a legal conviction and the illegality of the restraint consists solely in the invalidity of the sentence, the petitioner may be directly remanded to the proper court or its officers for a valid sentence. Jordan v. Swope, 36 N.M. 84, 8 P.2d 788; State v. Lucero, 48 N.M. 294, 150 P.2d 119.
Petitioner asserts that the first count of the information charging him with being an habitual criminal alleged conviction of the federal offense of transporting a stolen automobile across a state line. We agree that it does not charge conviction of a crime which is a felony under the laws of New Mexico. The conviction of that offense will not support an increased penalty for the murder convictions in New Mexico.
Petitioner's admission that he had been twice convicted of felonies prior to commission of the two murders in New Mexico is insufficient to require an added penalty to be imposed in either of the Luna County cases. The pertinent portion of the Habitual Criminal Act providing for an increased penalty for a third conviction, § 41-16-2, N.M.S.A. 1953, reads:
"A person, who, after having been two [2] times convicted * * * of felonies * * * commits a felony within this state, shall be punishable upon conviction of such third offense as follows:
"If the subsequent felony is such that, upon a first conviction, the offender would be punishable by imprisonment for any term less than his natural life, then such person must be sentenced *426 to imprisonment for a term not less than the longest term, nor more than three [3] times the longest term, prescribed upon a first conviction."
Second degree murder is punishable by imprisonment for a term of not less than three years nor more than life. State v. Maestas, 63 N.M. 67, 313 P.2d 337.
This court held in Owens v. Swope, 60 N.M. 71, 287 P.2d 605, that under the indeterminate sentence law, the prisoner can only claim his debt to the state as being satisfied, as of right, upon expiration of the maximum period fixed by his sentence, less such good conduct time as may be provided by statute. The minimum sentence, less good time, merely fixes a date when, as a matter of grace and not of right, the prisoner may be permitted to serve the balance of his sentence outside the penitentiary, under such circumstances and conditions as the parole authorities may provide. See § 41-17-24, N.M.S.A. 1953, and Leach v. Cox, 74 N.M. 143, 391 P.2d 649. An indeterminate sentence, for second degree murder, is one for the maximum term or life imprisonment. Since § 41-16-2, supra, may only be invoked to increase the punishment for the principal offense where the penalty therefor is imprisonment for a term of less than life, it is clear that no enhanced sentence can be imposed in cause number 2543, supra.
Furthermore, conviction in cause number 2543, supra, does not constitute such a prior conviction as is required to support an increased punishment in cause number 2544, supra. The language of § 41-16-3 N.M.S.A. 1953, that:
"A person who, after having been three [3] times convicted * * * commits a felony within this state * * *."
requires a construction that each of the prior convictions precede the commission of the principal offense in this state in order to enhance the punishment under the habitual criminal statutes. The overwhelming weight of the decisions of other jurisdictions have so construed similar phraseology in such acts. Anno. 24 A.L.R.2d 1249.
The petitioner should be remanded to the custody of the sheriff of Luna County, to be by him held to await the further action of the district court of Luna County, which shall proceed in a manner not inconsistent with this opinion.
It is so ordered.
