
380 P.2d 886 (1963)
The STATE of Montana, on the Relation of William J. NELSON, Relator,
v.
Edward C. ELLSWORTH, Jr., Respondent.
No. 10557.
Supreme Court of Montana.
Submitted March 11, 1963.
Decided April 25, 1963.
William R. Taylor (argued orally), Deer Lodge, for relator.
Donald Douglas, Asst. Atty. Gen. (argued orally), Helena, for respondent.
JOHN C. HARRISON, Justice. Court.
This is a petition for a writ of habeas corpus.
Petitioner was first convicted of first degree burglary in the district court of the thirteenth judicial district, County of Yellowstone, on or about January 21, 1954, and sentenced to ten years in the state penitentiary. When he entered prison and commenced serving this sentence he was subject to the provisions of section 80-739, R.C.M. 1947, on parole and probation. This statute was repealed by Chapter 117, Laws of 1955, and on April 1, 1955, a new law became effective.
Petitioner in the meantime had perfected an appeal to this court and on December 13, 1956, this court in the case of State v. Nelson, 130 Mont. 466, 304 P.2d 1110, reversed the cause and remanded it for a new trial. The petitioner was again tried, found guilty and sentenced to ten years in the state penitentiary on April 11, 1957. This conviction was affirmed by this court in State v. Nelson, 133 Mont. 300, 322 P.2d 1113.
Petitioner alleges that he is entitled to the benefits of section 80-739, R.C.M. 1947, (repealed by Laws of 1955) which reads as follows:
"Commutation of sentence upon good behavior. The board is hereby authorized and required to grant to any convict confined in the state prison, who shall well behave *887 himself and who shall perform regular labor during good health, either within or without the state prison inclosures, a credit of the time from his sentence as appears in the following table, for respective years of his sentence, and pro rata for any part of a year when the sentence is for more or less than a year:


"NUMBER
OF YEARS      GOOD                                    TIME TO BE SERVED
 OF           TIME          TOTAL GOOD                IF FULL TIME IS
SENTENCE      GRANTED       TIME MADE                 MADE
----------------------------------------------------------------------------
 1st year      1 month        1 months                            11 months
 2nd year      2 months       3 months                 1 year and  9 months
 3rd year      3 months       6 months                 2 years and 6 months
 4th year      4 months      10 months                 3 years and 2 months
 5th year      5 months      1 year and 3 months       3 years and 9 months
 6th year      6 months      1 year and 9 months       4 years and 3 months
 7th year      6 months      2 years and 3 months      4 years and 9 months
 8th year      6 months      2 years and 9 months      5 years and 3 months
 9th year      6 months      3 years and 3 months      5 years and 9 months
10th year      6 months      3 years and 9 months      6 years and 3 months"

Petitioner also alleges that under the provisions of section 80-739 before repeal and, in effect when the crime was committed, he was entitled to be discharged on January 11, 1963.
The respondent officials of the State of Montana take the position that the petitioner having been convicted the second time, his sentence did not begin to run until April 10, 1958, and that his discharge time is provided for in the 1955 law, now section 80-740, R.C.M. 1947, which provides:
"Good behavior allowance for convicts in certain employments. The state board of prison commissioners is hereby authorized and required to adopt rules and regulations applicable to all convicts employed upon any prison work or activity whereby said convicts so employed, but only while so employed, may be granted good time allowance which shall operate as a credit of time from his sentence as imposed by the court, conditioned upon such convicts' good behavior and compliance with all rules and regulations which may be made by said board or superintendent or warden of the state prison, for the management and control of said prison and such convicts; provided, said rules may grant not to exceed good time allowance of ten (10) days per month, and further, provided, that an attempted escape by the convict, or such violation of the rules and regulations so prescribed, as in the judgment of the said board should be punished by forfeiture of such extra good time, shall operate as forfeiture of all extra good time as may have been allowed by said board of prison commissioners, now authorized in this act. The warden of the state prison shall advise the board of pardons of the good time allowances granted to all convicts each month."
The respondent's position is that under this section of our statute, the petitioner is not eligible for discharge from the prison until October 11, 1965.
The question before this court is whether the application of the provisions of the 1955 law to the petitioner is ex post facto, and therefore illegal as to the petitioner. While this is a matter of first impression for this court we do have guidance from other jurisdictions having a like statute, and constitutional provision.
In Dowd v. Sims (1950), 229 Ind. 54, 95 N.E.2d 628, a case involving whether or not a statute was ex post facto that deprived a prisoner of his "good time" while *888 on parole, the Supreme Court of Indiana stated:
"However, it is clear that as to the appellee Sims, § 1(a) of Ch. 85 of the 1947 Acts, § 13-116a, Burns' 1942 Replacement ([1949] Supp.), is invalid since it does not mitigate but increases his punishment. Legislation which by its terms deprives a convicted prisoner of his good time is ex post facto and in violation of § 24 of Article I of the Constitution of Indiana, and Clause 3 of § 9 of Article I of the Constitution of the United States. State of Kansas v. Tyree, 1904, 70 Kan. 203, 78 P. 525; Murphy v. Commonwealth, 1899, 172 Mass. 264, 52 N.E. 505, 43 L.R.A. 154; In the Matter of Charles Canfield on Habeas Corpus, 1898, 98 Mich. 644, 57 N.W. 807; People ex rel. Adams v. Johnson, Warden, 1904, 44 Misc. 550, 90 N.Y.S. 134; 12 C.J. 1103, § 810; 16 C.J.S. Constitutional Law § 444. The good time law then in effect at the time the offense was committed `enters into the judgment as if written therein'. Woodward v. Murdock, 1890, 124 Ind. 439, 444, 24 N.E. 1047, 1048, supra." See also Ex parte Hunt, 28 Texas App. 361, 13 S.W. 145; Ex parte Lee, 177 Cal. 690, 171 P. 958, 960; People v. Schmidt, 33 Cal. App. 426, 165 P. 555; Andrus v. McCauley, D.C., 21 F. Supp. 70; Fletcher v. Peck, 10 U.S. 87, 138, 3 L.Ed. 162; 24 C.J.S. Criminal Law § 1584; 15 Am.Jur., Criminal Law, § 460, p. 118.
In the above case, Dowd v. Sims, supra, the petitioner had been sentenced in 1941 to ten years for burglary. In 1944, he was released to go into the Army. After four months duty he was given an honorable discharge for medical reasons having received a broken vertebra in line of duty. Two years later after returning to Indiana he was arrested on a felony charge which was later dismissed. A month later the governor revoked his parole. Under the law by which he was convicted, Chapter 164 of the 1933 Acts of Indiana he was entitled by good conduct to earn three years and four months of good time diminution. A 1947 law provided that diminution of sentence could not be earned while a prisoner serving a determinate sentence had been released on parole.
Article I, Section 9 of the Constitution of the United States reads:
"No Bill of Attainder or ex post facto Law shall be passed."
Article I, Section 10 of the United States Constitution reads:
"No State shall enter into any Treaty, Alliance, or Confederation; grant Letters of Marque and Reprisal; coin Money; omit Bills of Credit; make any Thing but gold and silver Coin a Tender in Payment of Debts; pass any Bill of Attainder, ex post facto Law, or Law impairing the Obligation of Contracts, or grant any Title of Nobility."
Article III, Section 11 of the Montana Constitution reads:
"No ex post facto law nor law impairing the obligation of contracts, or making any irrevocable grant of special privileges, franchises, or immunities, shall be passed by the legislative assembly."
In Calder v. Bull, 3 Dall 386, 3 U.S. 386, 390, 1 L.Ed. 648, the Supreme Court of the United States set forth the following definitions of an ex post facto law as:
"Laws under the following circumstances are to be considered ex post facto laws within the words and intent of the prohibition: 1st. Every law that makes an action done before the passing of the law, and which was innocent when done, criminal; and punishes such action. 2d. Every law that aggravates a crime, or makes it greater than it was when committed. 3d. Every law that changes the punishment, and inflicts a greater punishment, than the law annexed to the crime when committed."
In United States v. Platt, (D.C.Tex. 1940), 31 F. Supp. 788, 792, the court held that "any law passed after the commission of the offense for which the defendant is tried which inflicts a greater punishment for the act than provided by law at the time the offense was committed, or which alters the situation of the accused to his disadvantage, is ex post facto and unconstitutional."
*889 Therefore, under our constitutional provisions and the general law the 1955 law, as applied to this case, is ex post facto, in that its operation in relation to the consequences of his offense alters the situation of the petitioner.
The writ is therefore ordered issued and petitioner is ordered discharged from the State penitentiary.
JAMES T. HARRISON, C. J., and CASTLES, ADAIR and DOYLE, JJ., concur.
