
406 P.2d 347 (1965)
75 N.M. 472
Edward E. MORGAN, Petitioner,
v.
Harold A. COX, Warden of the New Mexico State Penitentiary, Respondent.
No. 7963.
Supreme Court of New Mexico.
September 20, 1965.
Rehearing Denied October 25, 1965.
Edward T. Johnson, Santa Fe, for petitioner.
Boston E. Witt, Atty. Gen., Harry S. Connelly, Asst. Atty. Gen., Santa Fe, for respondent.
PER CURIAM:
The only question here involved is whether time served under a void sentence is to be considered and credited against a subsequent sentence, upon a second conviction for the same offense.
The record discloses that on February 11, 1963, petitioner pleaded guilty to an information containing four felony counts, and was sentenced to serve a term in the penitentiary of not less than one nor more than three years concurrently on two counts and not less than one nor more than ten years on each of the other two counts, with all suspended except three years, and to run concurrently with the sentences ordered to be served. He was incarcerated in the state penitentiary until July 17, 1964, when the district court of Santa Fe County ordered him discharged on a writ of habeas corpus because of defects in his conviction resulting in an absence of jurisdiction and a void conviction and sentence.
Upon being discharged from the penitentiary, petitioner was taken into custody again and once more charged with the offenses to which he had pleaded guilty in 1963. On August 13, 1964, he pleaded guilty to the first count in the information charging that on January 6, 1963, he did break and enter into an office in the night time with intent to commit a felony, contrary to § 40-9-6, N.M.S.A. 1953, this being one of the offenses to which he had pleaded guilty in 1963. The record does not disclose the disposition, if any, made of the other three counts. Upon his plea being entered, he was sentenced to a term of not less than one nor more than three years in the state penitentiary, which sentence was "suspended during good behavior" and the petitioner was placed on "parole" by the trial judge.
Thereafter, on April 20, 1965, after hearing on a motion of the district attorney that the suspension of the sentence be revoked, the court entered an order revoking the suspension and invoking the sentence as of August 13, 1964.
*348 The attorney general and counsel for petitioner have stipulated that if time served from February 11, 1963, to July 17, 1964, is to be considered as having been served on the sentence under which petitioner is now being held, petitioner is entitled to his immediate release.
The problem has been before the court on at least three previous occasions, in the cases of Irwin v. Cox, No. 362 H.C., Hults v. Cox, No. 363 H.C., and Lloyd v. Cox, No. 355 H.C. In both Irwin and Hults, the writs were quashed and it was held that the petitioners were not entitled to credit for the time served under a void conviction by a court lacking jurisdiction to impose the same. Thereafter, in Lloyd, under authority of Sneed v. Cox, 74 N.M. 659, 397 P.2d 308, a different conclusion was reached and the warden of the penitentiary was directed to give the petitioner in that case credit for the time served under the earlier void conviction and commitment. Because of the inconsistency apparent in the results in these cases, it behooves us to reconsider the problem, and announce the correct rule to be applied.
We conclude that Sneed v. Cox, supra, does not control in situations such as were present in Irwin, Hults, and Lloyd, and that we were in error when we considered it controlling in Lloyd. It is clear that Sneed is applicable when it appears that a prisoner has received an illegal sentence following a proper conviction. In that circumstance, upon a correct sentence being imposed, credit shall be allowed as if the prisoner had been serving the proper sentence from the inception of his incarceration. This rule applies both to the minimum and maximum portions of the sentence. In Sneed, we discussed the different rule applicable when a trial court attempted to fix the commencement date of the sentence at a time prior to its imposition as held in State v. White, 71 N.M. 342, 378 P.2d 379. Also in support of our conclusion, we cited the note in 35 A.L.R.2d 1283, 1288, where it is stated:
"What appears to be the modern (and the better) view on the question whether one who has served in prison under a sentence is entitled to have time so served credited where, because the original sentence was invalid, it is necessary that he be resentenced, is that such an allowance is proper. * * *"
The same note recognizes that a majority of the courts deny credit for time served under resentencing after a reversal and new trial. 35 A.L.R.2d 1283, 1285. This accords with our conclusion in State v. White, supra. Although the situation here present is in some respects comparable to that which exists when a prisoner is held in prison while his appeal is pending, in which he does not get credit for time served during pendency of the appeal, we appreciate that differences are likewise present.
While being fully aware that there is no unanimity among courts that have considered the problem, we are constrained to hold that, even though time was served under a conviction found to be void because of absence of jurisdiction, credit may not be given for such time served when the prisoner is, on a subsequent trial, validly convicted of the same offense and given a new sentence. See 35 A.L.R.2d 1283, 1291; State ex rel. Drankovich v. Murphy, 248 Wis. 433, 22 N.W.2d 540; Ex parte Wilkerson, 76 Okl.Cr. 204, 135 P.2d 507. In other words, the Sneed rule is applicable when an erroneous sentence is being corrected, but does not apply where the original proceeding was void for lack of jurisdiction.
It follows that the alternative writ heretofore issued should be quashed and petitioner remanded to the custody of respondent.
It is so ordered.
