
592 P.2d 935 (1979)
Kevin T. MURPHY, Petitioner,
v.
STATE of Montana, Respondent.
No. 14252.
Supreme Court of Montana.
March 20, 1979.
Kevin T. Murphy, pro se.
Mike Greely, Atty. Gen., Helena, John G. Winston, County Atty., Butte, for respondent.
HASWELL, Chief Justice.
Petitioner, Kevin T. Murphy, filed a pro se application for habeas corpus on April 10, 1978. By order of July 21, 1978 this petition was denied as a proceeding for habeas corpus but it was decided that the portions of the petition concerning sentence imposed upon the petitioner would be treated as a petition for post conviction relief under Title 95, Ch. 26, R.C.M. 1947, now Title 46, Ch. 21 MCA.
Kevin T. Murphy was found guilty by a jury on September 23, 1976 of a burglary committed on May 3, 1976. He was sentenced on October 1, 1976 to confinement in the State Prison for the term of not less than 10 years. The order of commitment contains the following:
"It is further ordered and adjudged and this order does order and adjudge that said defendant, Kevin T. Murphy, is a persistent offender, and that said Defendant receive no credit for the time served to date in the Silver Bow County Jail. That the defendant is not to be granted good time as a first offender, but must earn his own credit for good time."
One issue raised by petitioner is whether a letter dated September 28, 1976 addressed to the sentencing judge and signed by John Lynch as parole and probation officer at Butte, Montana was used as a presentence report by the judge at the sentencing on October 1, 1976.
The memorandum filed by the Silver Bow County Attorney in response to the court order of July 21, 1978 raised factual questions as to his letter. The court ordered an evidentiary hearing in the District Court. The hearing was held on January 26, 1979 and on February 14, 1979 the judge of the District Court filed an order and judgment with this Court.
*936 In part the order states:
"That an evidentiary hearing was had and a report dated September 28, 1976 of the Pardon and Parole Officer, namely John Lynch, was entered in evidence, and said report was recognized by the court as being the same as was served upon the parties and delivered to the Court before sentencing in this matter which had occurred on the first day of October, 1976."
The order then confirmed the order of October 1, 1976.
The Silver Bow County Attorney's brief states:
"This letter, dated September 28, 1976, is in the form of an arrest record of the Defendant while under the supervision of Probation and Parole Office. This letter is not in the proper form of a presentence as required by Section 95-2004, [95-2204] R.C.M. 1947 (now section 46-18-112 MCA) . . ."
The letter after listing ten arrests from March 1973 to February 1976 concludes as follows:
"Along with the current charge, there have been a total of six charges involving burglary that Kevin Murphy has been involved in during the time this office has been associated with him  a period of a little over three years.
"During this time, we have attempted to work with him in every way possible. We have tried to get him help for his drug and alcohol problems but he has been totally unreceptive.
"At this time, the only alternative I can recommend is incarceration in Montana State Prison."
The memorandum of the Silver Bow County Attorney states:
"In March, 1973 petitioner KEVIN T. MURPHY entered a plea of Guilty to the charge of Burglary, a Felony, in the District Court of the First Judicial District, Lewis and Clark County, and received a three (3) year Deferred Imposition of Sentence. In September, 1974, the Petitioner entered a plea of Guilty to the charge of Burglary, a Felony, in the District Court of the Second Judicial District, Butte-Silver Bow County, and received a one (1) year Deferred Imposition of Sentence. The Petitioner completed the probationary period in both cases without being revoked. Motions by the Petitioner to have these Guilty Pleas expunged from the Court records were not filed until November, 1977.
"Based on the two (2) above-mentioned cases the Petitioner was found to be a persistent Felony offender, pursuant to Section 95-2206.5, R.C.M. 1947, (section repealed by section 6, Ch. 340, Laws of 1977) after he was found Guilty of Burglary, a Felony, on October 1, 1976 . ."
From the above it is clear that the letter of September 28, 1976 was used as a presentence investigation. Further it did not comply with the requirements of section 95-2204, R.C.M. 1947, now XX-XX-XXX MCA, and while there may be discretion in the trial judge not to order a presentence investigation under section 95-2203, R.C.M. 1947, now XX-XX-XXX MCA, such was not the case here; especially where the report was used to find the defendant a persistent offender. Under section 95-2206.5, enacted by Section 2, Ch. 312, Laws of 1975. Repealed by Section 6, Ch. 340, Laws of 1977.
Also enacted by Ch. 312 as Section 3, Laws of 1975 was an amendment of section 95-3214, R.C.M. 1947, now section 46-23-201 MCA but amended by Section 60, Ch. 184, Laws of 1977, amended Section 3, Ch. 340, Laws of 1977, and amended Section 3, Ch. 580, Laws of 1977, which provided that no convict serving a time sentence could be paroled until he had served at least one-third of his full term, less good time allowance off if he were designated a persistent felony offender under section 95-2206.5 as opposed to serving one-fourth of a full term less good time allowance off if not a persistent felony offender.
The defendant therefore is entitled to be returned to the District Court in Silver Bow County for resentencing for the following reasons:
(1) The letter of September 28, 1976 did not comply with section 95-2204, R.C.M. *937 1947, now XX-XX-XXX MCA, and the procedure set out in Kuhl v. District Court (1961), 139 Mont. 536, 366 P.2d 347, 351.
(2) The denial of credit for time served in the Silver Bow County jail before conviction is error. Section 95-2215, R.C.M. 1947, now section 46-18-403 MCA, states:
"Credit for incarceration prior to conviction. (a) Any person incarcerated on a bailable offense and against whom a judgment of imprisonment is rendered shall be allowed credit for each day of incarceration prior to or after conviction . . ."
Such credit is granted by the statute as a matter of right. Maldonado v. Crist (1973), 162 Mont. 240, 510 P.2d 887; State ex rel. Bovee v. District Court (1973), 162 Mont. 98, 508 P.2d 1056; In the Matter of Hanson (1976), 169 Mont. 80, 544 P.2d 816; Matter of LeDesma (1976), Mont., 554 P.2d 751, 33 St.Rep. 902.
The remaining issue presented is not ready for decision. As stated above the court apparently relied on two previous deferred impositions of sentence to find defendant a persistent felony offender under section 95-2206.5, R.C.M. 1947 as it existed on October 1, 1976.
Section 95-2207, R.C.M. 1947, now XX-XX-XXX MCA, provides for dismissal after deferred imposition.
"Whenever the court has deferred the imposition of sentence, and after termination of the time period during which imposition of sentence has been deferred, upon motion of the court, the defendant or the defendant's attorney, the court may allow the defendant to withdraw his plea of guilty, or may strike the verdict of guilty from the record, and order that the charge or charges against him be dismissed."
Here the defendant did not move until November 1977, more than a year after the October 1, 1976 sentence, to have the pleas of guilty withdrawn and the charges dismissed.
As to the question of whether a guilty plea followed by a deferred imposition of sentence can be relied upon by the State as a prior felony conviction in order to invoke the persistent felony offender statute, sufficient facts are not known. As this matter must be returned to the District Court for resentencing the issue should be addressed by the District Court.
In passing it should be noted that other courts have come to different conclusions on this or similar issues. See State v. Drew (1971), 158 Mont. 214, 490 P.2d 230.
Judge Russell Smith refers to it as "adopting the Omar Khayyam approach". Fite v. Retail Credit Company (D.C.Mont. 1975), 386 F. Supp. 1045, 1047.
For a good discussion of the development of the similar California statute, California Penal Code, Sec. 1203.4, see State v. Walker, 14 Wash. App. 348, 541 P.2d 1237, 1240; see also State v. Bock (1958), 80 Idaho 296, 311, 328 P.2d 1065; Padilla v. State (1977), 90 N.M. 664, 568 P.2d 190; (1949) 2 Stanford L.Rev. 221; (1954) 27 S.Cal.L.Rev. 327.
As to the definition of conviction under such a statute see 12 S.Cal.L.Rev. 201.
Effect of expungement on criminal conviction (1967), 40 S.Cal.L.Rev. 127; Expungement myth (1963), 28 Los Angeles Bar Bulletin (1963) 161; Wiping out a criminal or juvenile federal jury, L. Baum (1965), 40 S.Bar J. 816.
The sentence is vacated and the cause remanded to the District Court with directions to resentence petitioner Kevin T. Murphy in a manner not inconsistent with this opinion.
DALY, HARRISON, SHEA and SHEEHY, JJ., concur.
