
20 Cal.App.2d 397 (1937)
In the Matter of the Application of GORDON ROGERS, for a Writ of Habeas Corpus.
Crim. No. 1553. 
California Court of Appeals. Third Appellate District.  
April 16, 1937.
 Gordon Rogers, in pro. per., for Petitioner.
 U.S. Webb, Attorney-General, and Wilmer W. Morse, Deputy Attorney-General, for Respondent.
 Thompson, J.
 By means of habeas corpus the petitioner seeks to obtain his discharge from Folsom state prison on the ground that he was wrongfully determined to be an habitual criminal and that he has served the maximum term which the law is authorized to impose for the offense of a felon having possession of a revolver capable of being concealed on his person contrary to the provisions of section 2 of an act regulating the possession, use, control or sale of firearms. (Stats. 1923, p. 695, and amendments, 1 Deering's Gen. Laws of 1931, p. 900, Act 1970.) *399
 The petitioner was convicted as a felon of having possession of a revolver, contrary to the provisions of the statute mentioned. He was at the same time charged and found guilty of three prior convictions of felonies, to wit, burglary, robbery and grand larceny. Pursuant to section 644 of the Penal Code, he was thereupon determined to be an habitual criminal, and sentenced to imprisonment in the state prison at Folsom for the term of his life without the benefit of parole. He has served in excess of three years and seven months of his sentence. He was awarded credits aggregating one year and five months for good behavior. It is conceded that if the petitioner's contention that five years' imprisonment in the state prison is the maximum penalty authorized by law to be imposed for the offense of which he was convicted, then the prisoner is entitled to be discharged.
 [1] The petitioner contends that the offense of unlawful possession of firearms by a felon, as prescribed by section 2 of the act referred to, is a mere misdemeanor and that because it was necessary to charge and prove his prior convictions of other felonies as a necessary element of the offense of having possession of firearms by a felon, those prior convictions may not also be used to aggravate the offense and to authorize the court to determine that he was an habitual criminal and therefore sentence him to state prison for life under the provisions of section 644 of the Penal Code, for that procedure would result in punishing him twice for the same offense.
 The offense of owning, possessing or having the custody or control of firearms, by a felon, an alien or an addict of narcotic drugs, under the circumstances recited in the act regulating the possession, use or sale of firearms, above referred to, is a felony and not a mere misdemeanor. Section 2 of that act provides in part:
 "... No person not a citizen of the United States of America and no person who has been convicted of a felony ... or who is addicted to the use of any narcotic drug or drugs shall own or have in his possession or under his custody or control any pistol, revolver or other firearm capable of being concealed upon the person ... having a barrel less than twelve inches in length. Any person who shall violate the provisions of this section shall be punishable by imprisonment in the state prison not exceeding five years, or in a *400 county jail not exceeding one year, or by fine not exceeding five hundred dollars, or by both fine and imprisonment."
 [2] A crime which may be punished by imprisonment in the state prison, although the statute confers a discretion on the court to impose a mere county jail sentence, is deemed to be a felony, unless the court actually exercises that discretion by imposing only a fine or a jail sentence. (Sec. 17, Pen. Code; 7 Cal.Jur. 870, sec. 27; 16 C.J. 55, sec. 6; People v. War, 20 Cal. 117; People v. Cornell, 16 Cal. 187; In re Rameriz, 193 Cal. 633 [226 P. 914, 34 A.L.R. 51].) In 16 C.J., at page 56, it is said in that regard:
 "Where an offense is not designated by the statute which creates it, either as a felony or a misdemeanor, but its punishment is prescribed, then the grade of such offense is determined by the punishment."
 The only modification of this rule followed the adoption of section 17 of the Penal Code in 1874. By the provisions of that section a felony punishable by either imprisonment in the state prison, or in the county jail, in the discretion of the court, after such punishment "other than imprisonment in the state prison", shall be deemed to be a mere misdemeanor. (Doble v. Superior Court, 197 Cal. 556 [241 P. 852]; In re Miller, 218 Cal. 698 [24 PaCal.2d 766]; People v. Pryor, 17 Cal.App.2d 147 [61 PaCal.2d 773].) The necessary inference to be drawn from the language of section 17 of the Penal Code that "when a crime, punishable by fine or imprisonment in a county jail, in the discretion of the court, it shall be deemed a misdemeanor for all purposes after a judgment imposing a punishment other than imprisonment in the state prison", is that the offense remains a felony except when the discretion is actually exercised and the prisoner is punished only by a fine or imprisonment in a county jail. Moreover, it is clear, and it has been frequently so held, that the character of the offense is not changed from a felony to a misdemeanor by the mere imposition of a fine or a jail sentence. It remains a felony for all purposes except that "after a judgment imposing a punishment other than imprisonment in the state prison", it shall thereafter be deemed to be a mere misdemeanor. One of the chief reasons for this change in the nominal character of the offense as a result of imposing a jail sentence is that under such circumstances the offense is not considered to be serious enough to entitle the court to resort to it as a prior conviction *401 of a felony for the purpose of increasing the penalty for a subsequent crime. It is the nature of an offense and the penalty which is imposed by law that determines whether it is a misdemeanor or a felony, and not the mere name which the legislature may attach to it. It is evident that the inadvertent naming of petit larceny as a felony would not have the effect of transforming a well-known misdemeanor into a felony. In the present proceeding the question of transforming a felony into a misdemeanor after judgment is not involved, for the reason that the petitioner was sentenced to state prison and not to the county jail.
 The petitioner cites the fact that section 5 of the act in question characterizing the mere possession of firearms by an ordinary individual without a license therefor as a misdemeanor indicates that the legislature could not change the character of that offense from a misdemeanor to that of a felony by merely applying the same circumstances to an addict of narcotic drugs, an alien or a felon. But it is apparent that is exactly what the legislature intended to do for the very good reason that those three classes of individuals are deemed to be more dangerous to society when armed with a deadly weapon than others who are not included in those classes. The act regulating the possession, use and sale of weapons forbids various practices, some of which are specifically termed misdemeanors and some of which are called felonies, while under section 2, which is involved in this proceeding, they are characterized as felonies by the penalty which is provided therefor and by the more serious nature of the offense. Section 1 of that act specifically declares that it is a felony to manufacture, import, sell or offer for sale certain specified weapons or to carry concealed upon one's person deadly explosives, a dirk or a dagger. The character of the various offenses prohibited by this act must be determined by their nature and by the penalties prescribed therefor. We therefore conclude that the offense of which the petitioner in this proceeding was convicted is a felony.
 [3] There is no merit in the contention that because it was necessary to allege and prove at least one prior conviction of the petitioner as a necessary element of the offense prohibited by section 2 of the act to regulate the possession, use or sale of firearms, that therefore the three prior convictions of which he was also convicted may not be resorted *402 to, under the provisions of section 644 of the Penal Code, to determine that he is also an habitual criminal and therefore subject to be sentenced to state prison for life without the benefit of parole. It may be conceded that result would constitute a harsh penalty in some cases. But it is imposed in the discretion of the legislature for the protection of society against the menace of habitual criminals who are considered more dangerous, and less susceptible to law and order than a first offender. It has been repeatedly held that section 644 is constitutional and that it does not result in punishing a criminal twice for the same offense. (In re Rosencrantz, 205 Cal. 534 [271 P. 902]; People v. Vaile, 112 Cal.App. 258 [296 P. 901]; 58 A.L.R. 20, note, 82 A.L.R. 345, note.) The increased penalty provided by section 644 of the Penal Code for an habitual criminal is not a cumulative punishment for prior offenses. It is a mere increase of punishment for the last crime, which is deemed to have been aggravated by the former convictions. (People v. Floth, 8 Cal.App.2d 600 [47 PaCal.2d 817]; People v. Stratton, 136 Cal.App. 201 [28 PaCal.2d 695]; People v. Coleman, 145 Cal. 609 [79 P. 283].)
 The proceeding In re O'Donnell (In re Rodgers), 121 Cal.App. 370 [9 PaCal.2d 223], upon which the petitioner in this case relies, is not in conflict with what we have previously said regarding the classification of the crime of which this petitioner was convicted or what was said regarding the application of the provisions of section 644 of the Penal Code characterizing him as an habitual criminal. Section 644 was not involved in that case. In that proceeding Roy Rodgers was convicted of the possession of firearms contrary to the provisions of section 2 of the act regulating the possession thereof, and he was also found guilty of certain prior convictions. The question as to whether he became an habitual criminal by virtue of his prior convictions was not involved in that case. There was no evidence that he had been armed with a deadly weapon while he was engaged in the commission of a felony so as to increase his penalty on that account as provided by section 1168 (2b) of the Penal Code. The state prison board fixed the term of his imprisonment at fifteen years, pursuant to the provisions of section 1168. Upon habeas corpus this court merely determined that, since the petitioner in that case was not armed with a deadly weapon while he was engaged in committing another felony, *403 neither section 3 regulating the possession and use of firearms, nor section 1168, was involved in his case, and that the prison board was therefore not authorized to fix his term of imprisonment at fifteen years. Since the right to extend his term of imprisonment on account of prior convictions was not considered and since it was not contended that he had been sentenced as an habitual criminal, section 644 of the Penal Code was not involved in that decision and Roy Rodgers was properly discharged, having completed the full term for which he was lawfully sentenced. That case has no bearing on the problems involved in this proceeding.
 Nor is the case of In re Boatwright, 216 Cal. 677 [15 PaCal.2d 755], upon which the petitioner also relies, in conflict with what we have heretofore said regarding the issues of this proceeding. The court was there merely considering the application of section 667 of the Penal Code, as it then existed. That section has been amended to provide for imprisonment in the county jail only upon conviction of an offense under such circumstances. That fact is immaterial in the determination of this proceeding.
 The only issue upon which the Boatwright case was determined was expressed by the court as follows:
 "The question presented is whether or not the conviction of petitioner herein on the charge of petit theft, taking into consideration the prior convictions which he had suffered, amounted to a felony. ..."
 "Petit larceny, or petit theft, is not of itself a felony, and becomes such only when it is superadded to some other offense of which the party charged has suffered conviction, and this is done, not to enlarge the scope of the crime, but to add to the punishment of the person who commits it, for his many prior violations of the law."
 It will be observed the court was called upon to determine whether the conviction of an offense specifically called "petit theft" which is classified as a misdemeanor by providing for a fine or a county jail penalty therefor (sec. 490, Pen. Code), may authorize the court to determine that the accused person is an habitual criminal under the provisions of section 644 of the Penal Code, merely because he was also guilty of prior convictions of other felonies. It seems very clear that the court properly determined in the Boatwright case that he could not be so adjudged an habitual criminal, when the offense of which he is finally convicted is a declared misdemeanor *404 of "petit theft" and not a felony. The language of section 644 definitely settles that problem. The very first line of that section reads as follows: "Every person convicted in this state of any felony ... shall be adjudged an habitual criminal ..." Of course, the conviction of a mere misdemeanor may not furnish the foundation for declaring one an habitual criminal under section 644.
 The Boatwright case, therefore, furnishes no authority in conflict with what we have formerly said in this proceeding.
 This petitioner was not finally convicted of a mere misdemeanor. There is a wide distinction between the misdemeanor of an ordinary person carrying on his person a concealed weapon, contrary to the provisions of section 5 of the regulatory firearms act, and the possession of a revolver by one of the three dangerous classes of persons, viz.: addicts of narcotics, felons and aliens, which latter offense is classified in section 2 of the act as a felony by fixing the possible penalty therefor as imprisonment in the state prison.
 The fact that it is necessary to plead and to prove that the accused is a felon, or an alien or an addict of narcotics, in order to complete the crime, does not preclude the right to also plead and prove the prior convictions of former felonies for the additional purpose of determining that the accused person is an habitual criminal. The Boatwright case makes no statement or intimation to that effect.
 The writ is denied and the prisoner is remanded.
 Blummer, J., and Pullen, P. J., concurred.
