
159 Cal.App.3d 1110 (1984)
206 Cal. Rptr. 242
JAMES LORRIE DUNN, Petitioner,
v.
THE SUPERIOR COURT OF SAN MATEO COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. A027002.
Court of Appeals of California, First District, Division Four.
September 11, 1984.
*1113 COUNSEL
Edward D. Thirkell and Thirkell, Pierpoint & Cretan for Petitioner.
No appearance for Respondent.
John K. Van de Kamp, Attorney General, Gloria F. DeHart and Kristofer Jorstad, Deputy Attorneys General, for Real Party in Interest.
OPINION
PANELLI, J.
In this proceeding, James Lorrie Dunn seeks a writ of mandate to require respondent superior court to grant his motion to dismiss counts in an information on the ground that those charges had been twice terminated prior to the filing of the information.
The first termination occurred at the request of the People. The People had charged petitioner with violations of Penal Code section 207 (kidnaping), Penal Code section 220 (assault with intent to commit rape) and Vehicle Code section 10851 (theft of an automobile). Petitioner was held to answer on all charges but the People included only kidnaping and assault in *1114 the information. On the morning set for jury trial, the information was dismissed.
The second termination occurred by a failure to hold petitioner to answer. The People had filed a second complaint, this time charging violations of Penal Code sections 209 (kidnaping for the purpose of robbery), 211 (robbery), 496 (possession of stolen property) and 32 (accessory to kidnaping, robbery and auto theft).[1] A preliminary hearing was held at which the magistrate granted a motion to suppress evidence. At the conclusion of the preliminary hearing, the magistrate refused to hold petitioner to answer on any charge except the charge of being an accessory after the fact as that charge related to auto theft. The magistrate refused to hold petitioner to answer on the other charges because he concluded that there was insufficient evidence that a kidnaping or robbery occurred.
The district attorney, however, included all counts in the information. At the same time, the district attorney filed a request for a hearing de novo pursuant to section 1538.5, subdivision (j) to relitigate the magistrate's ruling on the admissibility of evidence. Following the hearing, the superior court found that the search was proper.
Petitioner then filed a motion for dismissal of the kidnaping, robbery and receiving counts under section 1387 of the Penal Code. The superior court denied the motion and petitioner seeks review of that decision.

Discussion
(1) Section 1387 of the Penal Code is a bar to prosecution of an action which has been twice terminated whether at the request of the prosecution or by the dismissal of a magistrate.[2] The section applies to bar the inclusion of counts of an information as well as to bar an entire information. (People v. Horning (1984) 150 Cal. App.3d 1015, 1021 [198 Cal. Rptr. 384]; Lee v. Superior Court (1983) 142 Cal. App.3d 637, 640 [191 Cal. Rptr. 361]; People v. Crowder (1982) 136 Cal. App.3d 841, 847-848 [186 Cal. Rptr. 469].)
(2a) There is no dispute in the instant case that there were two dismissals. However, the People take the position that the second dismissal was properly challenged by the motion pursuant to section 1538.5, subdivision *1115 (j) and was vacated by the ruling on the motion. To hold otherwise, argue the People, would be to nullify the People's statutory right to a de novo hearing in the trial court following an erroneous suppression order and dismissal.[3]
If evidence is suppressed at the preliminary and the defendant is held to answer, section 1538.5, subdivision (j) permits the People a de novo litigation of the suppression ruling in superior court. The superior court's ruling is then ordinarily binding at trial. It can only be binding, obviously, on the counts for which the defendant is to be tried, i.e., the counts in the information. Section 1538.5, subdivision (j) does not purport to revive a dismissed count or allow the filing of a new information more than 15 days after the preliminary hearing or to do anything but provide for an evidentiary ruling. Perhaps realizing this, the district attorney at the same time he filed the 1538.5, subdivision (j) motion also filed the information containing the dismissed counts. The district attorney did not wait to have the counts reinstated by their section 1538.5 motion; the motion had not even been heard.
The People, of course, are permitted by section 739 to file an information containing counts dismissed by the magistrate. They cannot do so, however, after the counts have been twice dismissed because of the bar of 1387. The court, in Ramos v. Superior Court (1982) 32 Cal.3d 26 [184 Cal. Rptr. 622, 648 P.2d 589], explained its rejection of the People's conclusion that the Legislature did not intend the district attorney's exercise of the section 739 procedure to be subject to section 1387's two-dismissal bar: "The suggested conclusion, however, simply does not follow from its premises. Ramos does not contend that the 1980 legislation eliminated the district attorney's authority under section 739 to file an information charging an offense or special circumstance that has been dismissed by the magistrate; he properly *1116 concedes that after the first dismissal by the magistrate, the district attorney may either refile a new complaint, file an information under section 739 charging the dismissed matter (see People v. Encerti (1982) 130 Cal. App.3d 791, 795-798 [182 Cal. Rptr. 139]), [fn. omitted] or  if he wishes to eliminate the effect of the first dismissal for section 1387 purposes  challenge the dismissal directly under section 871.5. (See Chism v. Superior Court (1981) 123 Cal. App.3d 1053, 1061 [176 Cal. Rptr. 909].) On the other hand, there is nothing in the new legislation to support the People's suggestion that when a charge has already been dismissed twice under section 871, an information filed under the section 739 procedure recharging the dismissed matter is not `any other prosecution for the same offense.' Such a conclusion would significantly undermine both the respect which the new legislation generally accords to dismissals by a magistrate and the added protection from repeated refilings afforded defendants by the amendment of section 1387." (32 Cal.3d at p. 35.) Thus, according to Ramos, the People cannot use section 739 to include in the information counts which, as here, have been twice dismissed. If the People wish to challenge the second dismissal, they must proceed under section 871.5.[4]
The People do not mention Ramos but quote extensively from People v. Encerti (1982) 130 Cal. App.3d 791 [182 Cal. Rptr. 139], which held that section 871.5 should not be construed to repeal the statutory right of the prosecutor under section 739 to charge additional offenses. Encerti did not confront the issue of twice dismissed charges. The People are apparently using Encerti to illustrate the premise that the People's statutory right under 1538.5, subdivision (j) should not be nullified.
The People's premise is inapplicable. Section 1538.5, subdivision (j) has a function not affected by the bar of section 1387. It produces an evidentiary ruling to be applied to counts which have not been dismissed. The People are seeking to use it for a purpose for which it was not designed, i.e., for a review of a magistrate's dismissal ruling. The Legislature, however, has specifically provided for such a review in section 871.5 and section 1538.5 recognizes this in its prefatory language which states that the People "may move to reinstate the complaint, or those parts of the complaint for which *1117 the defendant was not held to answer, pursuant to Section 871.5." (§ 1538.5, subd. (j).)
The statutory structure for review of rulings favorable to the defendant parallels the structure for review of rulings favorable to the People. (3) When the magistrate denies a suppression motion at the preliminary hearing, the defendant has two alternatives. He may seek a review of the search and seizure issue by a 995 motion where the superior court is limited to the evidence before the magistrate. If the superior court concludes that the magistrate erred and if there is insufficient evidence to hold the defendant to answer, the 995 motion will be granted. The defendant may also obtain an evidentiary ruling on the suppression motion in superior court through a de novo hearing pursuant to 1538.5. The effect of granting this motion, however, is merely to render the evidence inadmissible at the later trial. (§ 1538.5, subd. (d).) If the defendant wishes to challenge the holding order itself, he must proceed under section 995; a section 1538.5 evidentiary ruling does not itself produce a dismissal. (4) Similarly, if the motion to suppress is granted at the preliminary hearing, the People have two alternatives. They are entitled to a review of the ruling of the magistrate through a section 871.5 motion where the superior court is limited to the evidence before the magistrate; the result may be reinstatement of the charge if, with the challenged evidence, there was sufficient evidence to hold the defendant to answer. The other alternative is a de novo hearing in superior court which produces an evidentiary ruling to be later used at trial but which does not itself reinstate dismissed charges.
(2b) The facts peculiar to the instant case illustrate the mischief that could result from confusing the functions of 1538.5, subdivision (j) and 871.5. At the preliminary hearing, the magistrate made an evidentiary ruling and a probable cause ruling. The rulings, however, were not related in that the probable cause ruling did not result from the evidentiary ruling. The magistrate found no probable cause to hold petitioner for kidnaping and robbery not because he suppressed evidence seized at the time of the arrest but because he did not think there was evidence of an intent to kidnap or rob. If section 1538.5, subdivision (j) could revive or overturn the dismissal, it would do so in this case on an issue on which dismissal did not turn.
The People in this case are not being denied their remedy pursuant to section 1538.5, subdivision (j). That remedy can only apply, however, to the charges which have not been twice dismissed.
We turn now to the question of what "offenses" within the meaning of section 1387 were twice terminated. Although section 1387 bars charges of "the same offense," it is clear that this phrase does not simply mean that *1118 the district attorney is not permitted to charge violation of the same statute. The attorney general concedes as much by taking the position that the only offense twice terminated within the meaning of section 1387 is kidnaping although this "offense" had been charged under both sections 207 and 209 of the Penal Code. The Attorney General, however, does not agree with petitioner that the charge of robbery is barred because of the prior terminations of auto theft and robbery involving the same vehicle. Both petitioner and the People agree that the charges of receiving stolen property and being an accessory have not been twice terminated.
In seeking a meaning of the term "the same offense" in section 1387, attention has been directed by petitioner to the case of Wallace v. Municipal Court (1983) 140 Cal. App.3d 100 [189 Cal. Rptr. 886], where the court considered whether driving with a blood-alcohol level of 0.10 (Veh. Code, § 23152, subd. (b)) was the same offense as driving under the influence of alcohol (Veh. Code, § 23152, subd. (a)) for purposes of Penal Code section 853.6. This section bars the prosecutor from charging the same misdemeanor after a failure to file a notice to appear within 25 days of arrest. The court likened this bar to the bar of section 1387 and, after reviewing several cases, stated: "The general rule which can be distilled from these examples is that when the essence of the offense charged in a second action is the same as the essence of the offense in a previously dismissed action the second action will be barred." (140 Cal. App.3d at p. 107.) The court concluded that the essence of the two offenses before it was not the same. Although the court did not go on to provide a definition of "essence," it pointed out that either offense could be committed without committing the other and held that "[t]hus the essence of the two offenses is different...." (Id., at p. 109.)
(5) This cannot be said of the offenses of kidnaping and kidnaping for the purpose of robbery. Kidnaping for the purpose of robbery cannot be committed without committing the lesser offense of kidnaping. Two dismissals of kidnaping should bar a prosecution for kidnaping for the purpose of committing robbery on the theory that to charge the greater would be also to charge the lesser an additional and prohibited third time.
(6) So too with the offenses of auto theft and robbery. Although every robbery does not include an auto theft, the concept of necessarily included offenses permits reference to the facts in the accusatory pleading. (People v. Marshall (1957) 48 Cal.2d 394, 398 [309 P.2d 456].) Thus, in Marshall auto theft was held to be a necessarily included offense in robbery where the property taken in the robbery was alleged in the information to be the automobile involved in the auto theft. Here, the essence of the auto theft *1119 and robbery is the same since the robbery was specifically alleged to be the taking of the same automobile.
The Attorney General, however, contends that there was not the requisite termination of the auto theft charge because there was no order of dismissal. The auto theft charge was not included in the first information despite the fact that petitioner was held to answer on the charge by the magistrate. Failure to include the charge in the information was tantamount to a dismissal since section 860 requires the district attorney to file the information within 15 days after the defendant is held to answer and the failure to do so is a ground for dismissal pursuant to section 1382. Therefore, when the district attorney did not include the offense of auto theft in the information, petitioner was entitled to a dismissal which would have been a termination within section 1387.
The Attorney General contends that petitioner's failure to seek dismissal on that ground waives the argument that the failure of the district attorney to include the charge in the information was tantamount to an order terminating the charge. We reject that contention. A defendant cannot be expected to move for dismissal of a count not included in the information. Failure to include the count terminated that charge as far as that information was concerned.
(7) The purpose of section 1387 is to prevent the prosecution from harassing defendants with successive prosecutions (Lee v. Superior Court, supra, 142 Cal. App.3d 637, 640) and, in part, to pressure the prosecution to bring the case to trial within the time limits of section 1382 (Alex T. v. Superior Court (1977) 72 Cal. App.3d 24, 30 [140 Cal. Rptr. 17]). Petitioner here was subjected to two preliminary hearings after being charged with the theft of the automobile, first under the Vehicle Code and second under the Penal Code. Both times the theft charges were terminated for reasons within the prohibitions listed in section 1387, first by the failure to charge in the information and second by a failure to hold to answer. In neither situation was there a formal order. There was, however, a termination of the charge and, it is concluded, a termination within the meaning of section 1387.
Let a peremptory writ of mandate issue directing respondent court to dismiss counts charging petitioner with kidnaping and robbery.
Poche, Acting P.J., and Newsom, J.,[*] concurred.
NOTES
[1]  All statutory references not otherwise designated refer to the Penal Code.
[2]  Section 1387 provides in relevant part: "An order terminating an action pursuant to this chapter, or Section 859b, 861, 871, or 995, is a bar to any other prosecution for the same offense if it is a felony or it is a misdemeanor charged together with a felony and the action has been previously terminated pursuant to this chapter, or Section 859b, 861, 871, or 995 ...."
[3]  Subdivision (j) of section 1538.5 provides, in relevant part: "If the property or evidence relates to a felony offense initiated by complaint and the defendant's motion for the return of the property or suppression of the evidence at the preliminary hearing is granted, and if the defendant is not held to answer at the preliminary hearing, the people may file a new complaint or seek an indictment after the preliminary hearing, and the ruling at the prior hearing shall not be binding in any subsequent proceeding. In the alternative, the people may move to reinstate the complaint, or those parts of the complaint for which the defendant was not held to answer, pursuant to Section 871.5. If the property or evidence relates to a felony offense initiated by complaint and the defendant's motion for the return or suppression of the property or evidence at the preliminary hearing is granted, and if the defendant is held to answer at the preliminary hearing, the ruling at the preliminary hearing shall be binding upon the people unless, upon notice to the defendant and the court in which the preliminary hearing was held and upon the filing of an information, the people within 15 days after the preliminary hearing request in the superior court a special hearing, in which case the validity of the search or seizure shall be relitigated de novo on the basis of the evidence presented at the special hearing, and the defendant shall be entitled, as a matter of right, to a continuance of the special hearing for a period of time up to 30 days...."
[4]  Section 871.5 provides in relevant part: "(a) When an action is dismissed by a magistrate pursuant to Section 859b, 861, 871, 1008, 1381, 1383.5, 1385, 1387, or 1389, or a portion thereof is dismissed pursuant to those same sections which may not be charged by information under the provisions of Section 739, the prosecutor may make a motion in the superior court within 15 days to compel the magistrate to reinstate the complaint or a portion thereof and to reinstate the custodial status of the defendant under the same terms and conditions as when the defendant last appeared before the magistrate. [¶] (b) Notice of the motion shall be made to the defendant and the magistrate. The only ground for the motion shall be that, as a matter of law, the magistrate erroneously dismissed the action or a portion thereof."
[*]   Assigned by the Chairperson of the Judicial Council.
