
43 Cal.App.3d 530 (1974)
117 Cal. Rptr. 898
LEONARD BURRIS, Petitioner,
v.
THE SUPERIOR COURT OF TULARE COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. 2349.
Court of Appeals of California, Fifth District.
November 26, 1974.
*533 COUNSEL
James B. Oliver for Petitioner.
No appearance for Respondent.
Evelle J. Younger, Attorney General, Jack R. Winkler, Chief Assistant Attorney General, Arnold O. Overoye, Willard F. Jones and William G. Prahl, Deputy Attorneys General, for Real Party in Interest.
OPINION
FRANSON, J.
Proceeding in prohibition to restrain the further prosecution of petitioner on felony counts of perjury and grand theft. Writ denied.
The petition presents a question of first impression: Does a magistrate at a preliminary hearing on a complaint charging both a felony and a misdemeanor offense have jurisdiction to pronounce judgment and impose sentence on the misdemeanor charge absent a contemporaneous disposition of the felony charge? We hold that the magistrate does not.

STATEMENT OF THE CASE
A criminal complaint was filed in the Municipal Court of the Visalia Judicial District, County of Tulare, charging petitioner with felony counts *534 of perjury (Pen. Code, § 118) and grand theft (Pen. Code, § 484), and with a misdemeanor count of practicing law without a license (Bus. & Prof. Code, § 6126).
A preliminary hearing was held before a magistrate following which petitioner was bound over for trial in the superior court on the two felony charges. However, during the preliminary hearing, at the close of the presentation of the evidence, petitioner pleaded guilty to the misdemeanor count and insisted, over the objection of the People, that the magistrate pronounce immediate judgment and sentence.[1] The magistrate thereupon sentenced petitioner on the misdemeanor to six months in the county jail and imposed a $500 fine.
The People thereafter filed an information in the superior court, charging petitioner with perjury and grand theft, based on the evidence presented at the preliminary hearing. Petitioner moved to dismiss the information on the ground that Penal Code section 654 prohibits further prosecution of the felony offenses because petitioner had been convicted and sentenced on the misdemeanor offense which arose out of the same course of criminal conduct as the felonies. The motion was denied and petitioner filed the instant petition for a writ of prohibition with this court; we ordered respondent to show cause why the relief prayed for should not be granted.
The evidence introduced at the preliminary hearing and the exhibits attached to respondent's brief establish the following:
About September 30, 1973, petitioner mailed a letter to Judge Allen of the Visalia Municipal Court in which he stated that he had become a member of the county bar association and offered his services for indigent criminal cases. Although petitioner was not licensed to practice law in California, he signed the letter as an "attorney-at-law." Thereafter, petitioner was notified by the clerk's office that he had been appointed as counsel to defend an indigent named Vargas. On October 17, 1973, and on October 30, 1973, petitioner appeared as counsel for Vargas at pretrial and sentencing proceedings.
On November 5, 1973, petitioner filed with the superior court a petition and order for payment of attorney's fees in the amount of $300 for 12 hours work in the Vargas case. The petition recited that petitioner was a licensed attorney and it was executed under penalty of perjury. Judge Allen approved the petition for payment of the attorney's fees and on December *535 4, 1973, the Tulare County Auditor's office issued a warrant to petitioner in the amount of $307.60.

MULTIPLE PROSECUTION
(1a) Because of the Penal Code section 654[2] proscription against multiple prosecution where a defendant has been convicted and sentenced for an act made punishable in different ways by different criminal statutes, we first must decide whether petitioner's course of criminal conduct gives rise to more than one punishable act. (People v. Beamon, 8 Cal.3d 625, 637 [105 Cal. Rptr. 681, 504 P.2d 905]; People v. Brown, 49 Cal.2d 577, 591 [320 P.2d 5].)
Section 654 has been applied not only when there is one "act" in the ordinary sense but also where a course of conduct involving several acts violates more than one statute. (People v. Brown, supra, at p. 591.) The inquiry is whether the acts which comprise the course of conduct are "divisible" so that the defendant can be punished more than once. Whether the acts are divisible depends on the intent and objective of the defendant; if all of the acts were incident to one objective, he may be punished for any one of such acts but not for more than one. (People v. Beamon, supra, 8 Cal.3d at p. 637; People v. Bauer, 1 Cal.3d 368, 376 [82 Cal. Rptr. 357, 461 P.2d 637, 37 A.L.R.3d 1398]; Neal v. State of California, 55 Cal.2d 11, 19 [9 Cal. Rptr. 607, 357 P.2d 839].)
(2) Examining petitioner's conduct, it is readily apparent that his principal objective either was to unlawfully obtain money from the county (grand theft), with the unlawful practice of law and perjury being incidental to and in furtherance of this objective, or his principal objective was to engage in the practice of law for compensation, with the perjury and grand theft acts being incidental to and in furtherance of that objective. Thus, whether appellant's ultimate objective was to steal money from the county or to unlawfully engage in the practice of law for money, the three criminal acts were part of an indivisible course of criminal conduct.
(1b) The fact that one crime is separated in time from the other, or that one is completed before the other is commenced or is an afterthought does not itself make the criminal acts divisible. (People v. Bauer, supra, *536 1 Cal.3d 368, 377; In re Ward, 64 Cal.2d 672, 676 [51 Cal. Rptr. 272, 414 P.2d 400]; People v. McFarland, 58 Cal.2d 748, 760-762 [26 Cal. Rptr. 473, 376 P.2d 449].)
Real party in interest's reliance on People v. Eckley, 33 Cal. App.3d 91 [108 Cal. Rptr. 52], is misplaced. There the defendant was indicted for various crimes including grand theft and unlawful practice of medicine and psychotherapy. Defendant previously had been convicted and sentenced on plea of nolo contendere to a misdemeanor complaint filed by the city attorney of practicing medicine without a license. The reviewing court reversed the dismissal of the indictment because the misdemeanor charge related to an identifiable single incident and was prosecuted by the city attorney, while the indictment was based on testimony presented by the district attorney to the grand jury allegedly indicating widespread involvement of defendant in defrauding the Medi-Cal program by filing false claims for services rendered to many patients over an extended period of time. In response to defendant's contention that she could not be prosecuted under the indictment because of her previous conviction and sentence on the misdemeanor complaint, the court stated: "[I]t would appear that in practicing medicine without a license ..., the practice in connection with each patient would be a separate violation divisible in time from the others. It is also clear that defendant ... entertained multiple criminal objectives and that multiple criminal acts were involved." (33 Cal. App.3d at p. 97. Italics added.)
(3a) Having concluded that petitioner cannot be subjected to multiple punishment if he should be convicted of more than one offense charged in the felony-misdemeanor complaint, we come now to whether, under the unusual circumstances presented here, he nonetheless can be prosecuted on the felony charges.
The situation is unique because the question of multiple prosecution after an acquittal or conviction and sentence on a lesser charge normally arises in the context of successive prosecutions in different courts or in separate prosecutions in the same court. We are unaware of a case such as the one before us where a court has taken a plea and sentenced a defendant on a lesser charge in an accusatory pleading which also contained a greater charge without, at the same time, disposing of the greater offense.
Because petitioner cannot be punished for more than one of the crimes charged in the complaint, the magistrate's pronouncement of judgment and sentence on the misdemeanor count brings the case squarely within the multiple prosecution prohibition of section 654, assuming the validity *537 of the judgment and sentence. (See Kellett v. Superior Court, 63 Cal.2d 822, 828 [48 Cal. Rptr. 366, 409 P.2d 206].)

INVALIDITY OF JUDGMENT AND SENTENCE ON MISDEMEANOR
(4) To render a valid judgment, a court must have jurisdiction over the subject matter and of the person of the defendant. Jurisdiction of the subject matter is derived from the law; it neither can be waived nor conferred by consent of the accused. Inherent in subject matter jurisdiction is the power to inquire into the facts, to apply the law and to declare the punishment. (21 Am.Jur.2d, §§ 376, 379, pp. 398-399, 400.)
The authority of a magistrate is purely statutory. (Pen. Code, §§ 806, 807; People v. Cohen, 118 Cal. 74, 78 [50 P. 20].) He is not a judge. (5) "... [A] judge who sits as a magistrate does not carry his court or his judicial attributes with him except to the extent that they inhere in the office of magistrate." (Amos v. Superior Court, 182 Cal. App.2d 343, 348 [6 Cal. Rptr. 252]; see also People v. Brite, 9 Cal.2d 666, 683-684 [72 P.2d 122]; People v. Superior Court (Scofield) 249 Cal. App.2d 727, 735 [57 Cal. Rptr. 818].)
The magistrate at a preliminary hearing on a felony complaint has no power to make inquiry into the guilt or innocence of the defendant or to make a decision on the prosecution's case; his sole function is to resolve the issue of probable cause. (People v. Uhlemann, 9 Cal.3d 662, 664, 667, fn. 3 [108 Cal. Rptr. 657, 511 P.2d 609].)
If the magistrate finds probable cause to believe that the defendant is guilty of the felony, he must hold him to answer for trial in the superior court. (Pen. Code, § 872.) If, however, he finds that no offense has been committed or there is insufficient evidence to believe the defendant guilty of a public offense, he must order him discharged. (Pen. Code, § 871.)
In Kellett v. Superior Court, supra, 63 Cal.2d 822, it was recognized that the Legislature, by a series of amendments to Penal Code section 954,[3] had demonstrated its purpose to require joinder of related offenses *538 in a single prosecution. Kellett holds that because section 954 does not distinguish between felonies and misdemeanors in its provisions for joinder it authorizes the joinder of a misdemeanor count and a felony count for prosecution in the superior court. (Kellett, supra, at p. 826, fn. 3; see also People v. Bundte, 87 Cal. App.2d 735, 744 [197 P.2d 823].) Kellett noted that in addition to preventing harassment, joinder of the misdemeanor with the felony count for prosecution in the superior court avoids needless repetition of evidence and saves the state and the defendant time and money. (Kellett, supra, at p. 826.)
(6) Thus, where a defendant is charged in the same complaint with both a felony and a misdemeanor offense that are connected in their commission the superior court has original trial jurisdiction over both offenses (In re McKinney, 70 Cal.2d 8, 13 [73 Cal. Rptr. 580, 447 P.2d 972]; People v. Clark, 17 Cal. App.3d 890, 896 [95 Cal. Rptr. 411]) and the complaint is not within the trial jurisdiction of the inferior court. (People v. Hardin, 256 Cal. App.2d Supp. 954, 959 [64 Cal. Rptr. 307].)
(7) If the magistrate finds probable cause to believe that the defendant committed both the felony and the misdemeanor offenses, he will hold defendant to answer to the superior court for trial on both offenses. However, if he finds insufficient evidence to hold the defendant to answer on the felony offense, but finds probable cause to believe that the defendant committed the misdemeanor offense, the proper procedure is to order a dismissal of the felony charge and to remand the misdemeanor to the municipal court for arraignment for trial. (People v. Hardin, supra, 256 Cal. App.2d Supp. at p. 961; see Bein, Implementation of Kellett's Command: Joinder of Misdemeanors and Felonies in Superior Court, 7 San Diego L.Rev. 1, at pp. 11-12.)
(3b) Because the evidence established probable cause to believe that petitioner committed the felony offenses as well as the misdemeanor offense, the magistrate had no jurisdiction to pronounce judgment and impose sentence on the misdemeanor count. Only if there had been a contemporaneous dismissal of the felony offenses, either with the consent of the People as part of a plea bargain or, because of a lack of probable cause to hold the defendant to answer on the felony charges, would the magistrate have had the authority, sitting as a municipal court judge and after arraigning petitioner for trial on the misdemeanor count, to pronounce judgment thereon. As a consequence, the judgment imposing sentence is a nullity.[4]


*539 PETITIONER WILL NOT BE SUBJECTED TO MULTIPLE PUNISHMENT, MULTIPLE PROSECUTION OR DOUBLE JEOPARDY
Even though petitioner has served his sentence on the void misdemeanor judgment, his contention that if he is further prosecuted on the felony charges he will be subjected to multiple punishment and multiple prosecution as prohibited by Penal Code section 654 is without merit. Public policy requires that where a defendant is convicted of multiple crimes arising out of the same course of criminal conduct, that he be sentenced on the greater rather than the lesser crime. (People v. Brown, supra, 49 Cal.2d 577, 593; People v. Kehoe, 33 Cal.2d 711, 716 [204 P.2d 321]; People v. Griffin, 209 Cal. App.2d 125, 130 [25 Cal. Rptr. 667].) Thus, if petitioner is convicted of the felony offenses after trial in the superior court, he will be sentenced on the perjury conviction, the punishment of which is one to fourteen years in the state prison (Pen. Code, § 126) and punishment will be suspended on the grand theft conviction, which calls for a lesser punishment of one year in the county jail or ten years in state prison (Pen. Code, § 489). Petitioner, of course, will receive full credit on the sentence for the greater offense for the time he has served on the misdemeanor offense. (See People v. Breland, 243 Cal. App.2d 644, 652-653 [52 Cal. Rptr. 696].)
We recognize that the preclusion of multiple prosecution is separate and distinct from the preclusion of multiple punishment. The rule against multiple prosecution is a procedural safeguard against harassment and is not necessarily related to the punishment to be imposed. (See Kellett v. Superior Court, supra, 63 Cal.2d 822, 825; Neal v. State of California, supra, 55 Cal.2d 11 at p. 21.) For this reason it may be argued that petitioner should not be prosecuted on the felonies even though he will not be subjected to double punishment.
(8) However, the proscription against multiple prosecution does not apply where there is but one prosecution; that is, a single criminal action. It prohibits only a subsequent prosecution for the same act or omission which means the filing and pressing of a new criminal action. (Pen. Code, § 1023; People v. Seiterle, 59 Cal.2d 703 [31 Cal. Rptr. 67, 381 P.2d 947]; People v. Tideman, 57 Cal.2d 574, 584-587 [21 Cal. Rptr. 207, 370 P.2d 1007].) Similarly, double jeopardy has no application in a single *540 criminal prosecution to a defendant who is tried but once on several counts. (See Pen. Code, § 1023; People v. Tideman, supra.)
The filing of an information in superior court charging petitioner with the same felonies alleged in the complaint before the magistrate and based on evidence adduced at the preliminary examination cannot be deemed to be a new criminal action. The complaint, whether it includes only a felony offense or both a felony and a misdemeanor offense, and the magistrate's examination thereon, are but preliminary steps to a single prosecution in the superior court. Therefore, apart from the double punishment question, petitioner will not be unlawfully subjected to double prosecution or double jeopardy by reason of his having to stand trial on the felony counts.
Finally, we observe that, in spite of the fact that petitioner has served his sentence on the misdemeanor count, our holding that he nonetheless may be prosecuted on the felony counts is consistent with the sound administration of criminal justice. The People not only are entitled to prosecute a defendant in one criminal action on both felony and misdemeanor offenses arising out of the same transaction, but they are required to do so if they are, or should be, aware of the existence of such offenses. (Kellett, supra, at p. 827.) When the prosecution complies with the mandate of Kellett by joining the misdemeanor and felony charges in a single action, the defendant cannot be permitted to contrive a procedural device to avoid prosecution for the more serious charges. (See People v. Winchell, 248 Cal. App.2d 580, 593 [56 Cal. Rptr. 782].)
As stated in Kellett: "Accordingly, to avoid these risks [of multiple prosecution and double jeopardy] it has always been necessary for prosecutors carefully to assess the seriousness of a defendant's criminal conduct before determining what charges should be prosecuted against him. By emphasizing the importance of such assessment, our holding herein will not open the door to the escape of defendants from punishment for serious crimes because of convictions or acquittals of closely related minor crimes. It should tend instead to reduce the risk that they may escape such punishment by invoking the double jeopardy doctrine or the bar of section 654." (Kellett v. Superior Court, supra, 63 Cal.2d at pp. 828-829.)
The petition for writ of prohibition is denied.
Brown (G.A.), P.J., and Thompson, J.,[*] concurred.
NOTES
[1]  Petitioner's attorney stated that petitioner would waive the six-hour period but would not waive the five-day period within which judgment must be pronounced on a misdemeanor plea as provided by Penal Code section 1449.
[2]  Penal Code section 654 provides in pertinent part: "An act or omission which is made punishable in different ways by different provisions of this code may be punished under either of such provisions, but in no case can it be punished under more than one; an acquittal or conviction and sentence under either one bars a prosecution for the same act or omission under any other...."
[3]  Penal Code section 954 in pertinent part provides: "An accusatory pleading may charge two or more different offenses connected together in their commission, ... under separate counts, ... The prosecution is not required to elect between the different offenses or counts ..., but the defendant may be convicted of any number of the offenses charged, ... An acquittal of one or more counts shall not be deemed an acquittal of any other counts."
[4]  As we view it, the plea itself is not void for want of jurisdiction. By analogy with the Penal Code section 859a procedure for certifying a felony plea of guilty or nolo contendere to the superior court for sentencing, it would seem that if a defendant elects to plead guilty before a magistrate to a misdemeanor offense which is combined with a felony offense, where he is held to answer on the felony offense, the proper procedure would be for the magistrate also to certify the misdemeanor plea to the superior court for disposition. As noted in Penal Code section 859a, the magistrate is required to certify the case to the superior court "and thereupon such proceedings shall be had as if such defendant had pleaded guilty in [the superior] court."
[*]   Retired judge of the superior court sitting under assignment by the Chairman of the Judicial Council.
