
397 P.2d 308 (1964)
74 N.M. 659
Gene SNEED, Petitioner,
v.
Harold A. COX, Warden of the New Mexico State Penitentiary, Respondent.
No. 7747.
Supreme Court of New Mexico.
December 7, 1964.
Rehearing Denied December 7, 1964.
Edward T. Johnson, Santa Fe, for petitioner.
Earl E. Hartley, Atty. Gen., Harry S. Connelly, Jr., Sp. Asst. Atty. Gen., Santa Fe, for respondent.

OPINION ON MOTION FOR REHEARING
PER CURIAM.
Upon consideration of motion for rehearing the opinion heretofore filed is withdrawn and the following substituted therefor:
PER CURIAM:
Petitioner seeks release from custody in the New Mexico State Penitentiary on several grounds. The record discloses that in November, 1962 an information was filed charging him in count I with the crime of assault with intent to kill, contrary to § 40-6-6, N.M.S.A. 1953, and in count II with assault with a deadly weapon, contrary to § 40-17-4, N.M.S.A. 1953.
*309 On November 19, 1962 petitioner appeared in district court before Judge George L. Reese, Jr. When, upon inquiry, it was determined that petitioner was not represented by counsel and had no money to pay counsel, the court appointed one George Ward, a duly licensed attorney, to represent petitioner. The proceedings were recessed until December 10, 1962. At that time, with Mr. Ward present as his attorney, petitioner pleaded guilty to the charge in count II and, on motion of the district attorney, count I was dismissed. Petitioner was sentenced to a term of not less than two years nor more than three years in the penitentiary.
On May 22, 1964 petitioner sought habeas corpus in the district court of Santa Fe County, alleging that when taken before a justice of the peace in Chaves County for a preliminary hearing, he was not fully advised of his right to legal counsel or of his right to a preliminary hearing with counsel, as required by § 41-3-1, N.M.S.A. 1953. Petitioner further argued that he was not aware of his rights, did not competently or intelligently waive any rights; that he was not financially able to secure counsel and none was furnished him. Because of such facts, he asserted that he was denied his rights under Art. VI and Art. XIV of the Constitution of the United States, and under Art. II of the Constitution of New Mexico, and that the Chaves County district court therefore was without jurisdiction to sentence him, and his detention by respondent is illegal and void.
The Santa Fe County district court denied the petition. The same question is presented in the petition filed here. As already stated, counsel was appointed in the Chaves County district court and, after consultation with petitioner, a plea was entered to the lesser of the two offenses charged and the other was dismissed. Under the authority of Sanders v. Cox, 74 N.M. ___, 395 P.2d 353, the petition for a writ on the grounds stated is denied.
As a second ground for a writ of habeas corpus in the district court of Santa Fe County, petitioner asserted that the sentence of December 10, 1962 was void and illegal. He argued that the sentence was not in accord with law in that the penalty provided for the crime of assault with a deadly weapon was a fine not exceeding $1,000.00, or imprisonment at hard labor not exceeding three years, in the discretion of the court, whereas the sentence imposed was for a term in the penitentiary of not less than two nor more than three years.
The district court of Santa Fe County determined that the sentence was not legal for the reasons asserted and ordered the petitioner remanded to the sheriff of Chaves County for further proceedings as should be determined by the Chaves County district court. Thereupon, petitioner was returned to Chaves County. A petition for a writ of habeas corpus on the same grounds asserted in the district court of Santa Fe County was denied by the district court of Chaves County. The sentence of December 10, 1962 was set aside and on June 25, 1964 petitioner was sentenced to a term "not exceeding three years." In these proceedings petitioner was represented by the same George Ward who had represented him on the original charges. Petitioner was then returned to the penitentiary to enter upon the service of this new sentence under which he is now being held.
The question presented is whether petitioner is entitled to credit on the 1964 sentence for time served under the erroneous or void 1962 sentence. New Mexico has not passed on the identical question. We have recognized that sentences which are unauthorized by law are null and void. State v. Peters, 69 N.M. 302, 366 P.2d 148, and State v. Lucero, 48 N.M. 294, 150 P.2d 119. On the other hand, this court held in In the Matter of the Application of Joe Cica, et al., for a Writ of Habeas Corpus, 18 N.M. 452, 137 P. 598, 51 L.R.A.(N.S.) 373, that "where a court has jurisdiction of the person and the offense, the imposition of a sentence in excess of what the law permits does not render the legal or authorized portion of *310 the sentence void, but only leaves such portion in excess open to question and attack," and further, that:
"* * * A sentence is legal so far as it is within the provisions of law and the jurisdiction of the court over the person and the offense, and only void as to the excess, when such excess is separable and may be dealt with without disturbing the valid portion of the sentence. * * *"
The rule was recognized in Jordan v. Swope, 36 N.M. 84, 8 P.2d 788, although the sentence there being considered was held inseparable and accordingly void in toto.
Also, we have held that it is improper for a trial court to fix a date when the sentence should commence. State v. White, 71 N.M. 342, 378 P.2d 379. See also, Meyers v. Hunter (CCA 10) 160 F.2d 344, and DeBenque v. United States (CCA D.C.) 85 F.2d 202, which announce rules comparable to ours. An annotation on this subject appears in 35 A.L.R.2d 1283, 1288. It is there stated generally that the modern and best rule seems to be that it is proper to allow credit where a prisoner is resentenced without a new trial after serving part of a void sentence. Commencing at page 1291 are cases holding otherwise.
Although we recognize that under State v. White, supra, a trial court cannot fix the date at which incarceration is to begin, it is apparent that unless this court grants relief, prisoners who have not appealed and are serving wholly or partially void sentences, or who have been resentenced after serving a part of such sentence, may be subjected to punishment different from that authorized by the legislature.
If we were concerned only with the maximum penalty, we could refuse to consider whether petitioner is illegally held under the second sentence until he can demonstrate that by virtue thereof he is being restrained longer than the statutes provide. However, in so doing, petitioner is left without remedy as to the minimum which is important only as it affects the time when he is eligible to be considered for parole. We recognize that we have held that parole is a matter of grace and not a right. Owens v. Swope, 60 N.M. 71, 287 P.2d 605. However, not so the right to see the parole board which arises under the parole laws. In order to fully comply with the purpose intended to be served by our indeterminate sentencing statute and our parole statutes (Art. 17, N.M.S.A. 1953, and supps.) we must consider whether petitioner is deprived of the benefits arising under the statutory minimum when his parole board interview is denied by virtue of a sentence which did not conform to the statute.
We cannot, in good conscience, ignore the time spent in prison under the invalid sentence as it affects either the maximum or the minimum. In the instant case, petitioner, since December 10, 1962, has been serving a sentence void insofar as it provided that his term should be "not less than two years." The minimum, not being provided by law, was void, but being separable from the maximum which conformed to law, the maximum was legal and petitioner has been serving the same since December 10, 1962. In re Application of Cica, supra. Upon receiving a new sentence on June 25, 1964 of not to exceed three years, and disregarding allowances which he might be entitled to under the pertinent statutes, he would be held until June 25, 1967, whereas he would have actually served three years on December 10, 1965. That such a result is inherently unfair and unjust is not subject to dispute.
That we are so impotent because of shortcomings in our procedure, or for any other cause, as to be unable to correct such an injustice we are not willing to concede. We have previously found a means to prevent miscarriage of justice. In State v. Garcia, 19 N.M. 414, 143 P. 1012, we said:
"There exists in every court, however, an inherent power to see that a man's fundamental rights are protected in every case. * * * [T]his *311 court has the power, in its discretion, to relieve him and to see that injustice is not done."
Although petitioner has not demonstrated his right to immediate release, we hold that this proceeding is a proper one to correct the sentence, to eliminate the excessive part thereof. See 39 C.J.S. Habeas Corpus § 26, at 499-500; Ex Parte Smith, 95 Okl.Cr. 370, 246 P.2d 389, and Landreth v. Gladden, 213 Or. 205, 324 P.2d 475. We hold, in addition, that this court should, by order, direct the effective date of the 1964 sentence to be as of the time when the initial sentence, if valid, would have commenced. The trial court, when resentencing under fact situations such as here present, must do likewise. This conforms to the spirit of our indeterminate sentencing law, and is required in the name of justice and fair play. See McCutcheon v. Cox, 71 N.M. 274, 377 P.2d 683, and Owens v. Swope, supra.
We do not, by this holding, intend to overturn the rule announced in State v. White, supra. That case may be distinguished from the facts before us. State v. White, supra, involved a direct appeal from a judgment imposing a sentence designed to give credit for time spent in jail awaiting the decision of this court on appeal. This court ruled that the trial court could not fix the commencement date of incarceration.
The case before us has no bearing upon petitioner's right to suspend execution of his sentence by supersedeas during review. We are concerned only with the allowance of credit for time spent in prison when the right to suspend execution has not been exercised or has lapsed.
It is accordingly ruled that the writ heretofore issued in this cause is quashed and petitioner is remanded to the custody of the respondent to serve the legal sentence imposed June 25, 1964, but effective as of December 10, 1962, the date of the original sentence.
It is so ordered.
