Opinion
An enhancement is dismissed twice, the first time by a superior court judge pursuant to a Penal Code section 995 motion.1 The enhancement is refiled. It is dismissed a second time by a magistrate after a preliminary hearing.
Here we hold that section 1387 bars prosecution of the enhancement.
*806 The Two-dismissal Rule
The prosecution of defendant Salvador Carreon first proceeded by grand jury indictment. Count in of the indictment charged Carreon with, among other matters, assault with a deadly weapon on J.H. by means likely to produce great bodily injury. “J.H.” apparently refers to Joey Hernandez.
[[/]]*
The superior court granted Carreon’s section 995 motion to dismiss count HI, which included a gang enhancement. [[/]]*
Despite the dismissal of some counts by the trial court, the matter proceeded to jury selection. Before a jury was sworn, however, the prosecution moved to dismiss the case in the interest of justice. (§ 1385.) The motion was granted.
The prosecution refiled the action, this time proceeding by complaint. Count IV of the complaint alleged Carreon assaulted Hernandez. The count included a gang enhancement.
After the preliminary hearing, the magistrate to answer on the substantive count, but did not hold him or any of his codefendants to answer on a gang enhancement allegation. Thus, the allegation was dismissed pursuant to section 871 which provides that a magistrate shall order a complaint dismissed where there is not sufficient cause to believe defendant guilty of a public 2 Nevertheless, the prosecution filed an information in superior court alleging both the assault and the gang enhancement against Carreon. Carreon’s section 995 motion was denied by the superior court. Carreon subsequently pleaded no contest to the assault, and the gang enhancement was found true by the trial court.
Carreon argues that the trial court’s grant of the section 995 motion as to count III of the indictment was the first dismissal of the gang enhancement, and the magistrate’s dismissal pursuant to section 871 of the gang enhancement alleged in the complaint was the second dismissal.
*807Section 1387, subdivision (a) provides in 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 . . . and the action has been previously terminated pursuant to this chapter, or Section 859b, 861, 871, or 995 .. .
Carreon relies on Ramos v. Superior Court (1982) 32 Cal.3d 26 [184 Cal.Rptr. 622, 648 P.2d 589]. There Ramos was charged by complaint with murder and a special-circumstance allegation. After a preliminary hearing, a magistrate found the charges against Ramos insufficient in all respects and dismissed the charges under section 871. The prosecution then filed a new complaint alleging the same charges. This time the magistrate held Ramos to answer for murder, but dismissed the special-circumstance allegation. The prosecution responded to the dismissal by filing an information in the superior court pursuant to section 739 alleging both murder and special circumstance.
Ramos sought a writ of prohibition to bar trial on the special-circumstance allegation under section 1387. Our Supreme Court agreed with Ramos that two section 871 dismissals by a magistrate bars prosecution under section 1387. The court concluded that the prosecution’s remedy for an improper dismissal by a magistrate was under section 871.5, a statute specifically designed to challenge a magistrate’s dismissal. (Ramos v. Superior Court, supra, 32 Cal.3d at pp. 36-37.)
The Ramos court acknowledged in a footnote that section 739 allows the prosecution to file an information in superior court alleging “ . . any offense or offenses shown by the evidence taken before the magistrate to have been committed ....’” (Ramos v. Superior Court, supra, 32 Cal.3d at pp. 34-35, fn. 9.) Section 739 therefore allows the prosecution to file an information alleging charges that have been dismissed by the magistrate. In such a case it would appear that the magistrate’s dismissal would not be “[a]n order terminating the action” as provided in section 1387.
Nevertheless, the Ramos court made section 739 subject to the two-dismissal rule of section 1387, where, as in its facts, there were two prosecutions, two preliminary hearings, and two magistrates’ dismissals because of insufficient evidence under section 871. The Ramos court concluded that “[i]n light of the direct reference to section 871 in section 1387, we also conclude that a dismissal of a special circumstance allegation under section 871 is ‘an order terminating an action’ under section 1387.” (Ramos v. Superior Court, supra, 32 Cal.3d at p. 34.)
In response to our query whether an enhancement is an action pursuant to section 1387, the People state that in section 1387, the term “action” appears *808to be synonymous with “offense.” The People argue therefore that section 1387 cannot be applicable to enhancements because an enhancement is not an offense. The People cite People v. Wims (1995) 10 Cal.4th 293, 307 [41 Cal.Rptr.2d 241, 895 P.2d 77] for the proposition that an enhancement is not a separate crime or offense, but an additional term of imprisonment added to the base term of an offense.
The People distinguish Ramos on the ground that it did not involve an enhancement, but a special-circumstance allegation. They point out that a special circumstance is not an enhancement, but is sui generis. (Citing People v. Garcia (1984) 36 Cal.3d 539, 552 [205 Cal.Rptr. 265, 684 P.2d 826].) The People argue that a special circumstance is like an offense in that the facts to be found for a special circumstance are as crucial to the deprivation of liberty as are the elements of the underlying crime. They assert the same is not true of an enhancement.
It is true the finding of a special circumstance can result in the ultimate penalty, or as in the case of Ramos a sentence of life. But enhancements, even a single enhancement, “can have a significant impact on the number of years to which a defendant may ultimately be sentenced.” (People v. Superior Court (Mendella) (1983) 33 Cal.3d 754, 760 [191 Cal.Rptr. 1, 661 P.2d 1081].) Thus, enhancement allegations can also be crucial to the potential for deprivation of liberty.
It is also true that an enhancement is not an “action” or “offense,” but neither is a special circumstance. Nevertheless, the Ramos court treated the dismissal of a special circumstance as an order terminating an action within the meaning of section 1387. The court reasoned that section 1387 barred “any other prosecution” for the same offense. The court stated that the term “prosecution” was sufficiently comprehensive to include every step in the action, and thus the section barred the reintroduction of the special-circumstance allegation. (Ramos v. Superior Court, supra, 32 Cal.3d at pp. 35-36.) We fail to see why the same reasoning should not apply to the reintroduction of an enhancement.
As Carreon points out, without a limit as to the number of times the prosecution could refile a section 995 dismissal of an enhancement, such a dismissal would be meaningless. The prosecution could continue to refile enhancement allegations until it found a judge who allows it. This would undermine the intent behind sections 995 and 1387 to prevent forum shopping. Enhancement allegations along with special-circumstance allegations must come within section 1387.
He also posits that the logical extension of the People’s position would prevent them from refiling a dismissed enhancement under section 739. Like *809section 1387, section 739 also uses the word “offense.” For purposes of refiling a dismissed enhancement, People v. Superior Court (Mendella), supra, 33 Cal.3d at pages 754 and 764, treated an enhancement as an offense under section 739. “Offense” cannot mean one thing for section 1387 and another for section 739.
Even if an enhancement is treated as an offense, the People argue this case is governed by People v. Superior Court (Martinez) (1993) 19 Cal.App.4th 738 [23 Cal.Rptr.2d 733]. Martinez was charged by complaint with murder and insurance fraud. After the preliminary hearing, the magistrate dismissed the murder charge but held him to answer for insurance fraud. The prosecution nevertheless filed an information alleging murder and fraud. Meanwhile the prosecution obtained an indictment against Martinez for murder. When the indictment was presented, the prosecution moved to dismiss the information pursuant to section 1387.
Martinez moved to dismiss the indictment on the ground that the dismissal of the murder charge under the complaint and also the information barred further prosecution. The trial court granted the motion, and the Court of Appeal granted the People’s petition for writ of mandate compelling the trial court to vacate its order. The Martinez court distinguished Ramos stating: “It was in the context of two separate prosecutions, two preliminary hearings and two magistrate’s dismissals for insufficiency of evidence (a paradigm example of successive prosecutions harassing a defendant) that the Supreme Court held further prosecution under section 739 would violate section 1387. [Citation.] The court was careful to limit its holding to the circumstance of a second magistrate’s dismissal order.” (People v. Superior Court (Martinez), supra, 19 Cal.App.4th at p. 746.)
The instant case at best bears no more than a superficial similarity to Martinez in that there were not two separate complaints, two preliminary hearings and two magistrates’ dismissals for insufficiency under section 871. There are, however, far more significant similarities between the instant case and Ramos.
The first dismissal was by a superior court judge. Certainly such a dismissal should rank as equal in importance to a dismissal by a magistrate. The People then refiled the action with the dismissed gang enhancement. A second time the gang enhancement was dismissed. This is the “paradigm example of successive prosecutions harassing a defendant” that the Martinez court said would be a violation of section 1387 under Ramos. (People v. Superior Court (Martinez), supra, 19 Cal.App.4th at p. 746.) There is no more reason to allow further prosecution under section 739 here than there was in Ramos.
*810Carreon’s reliance on Bodner v. Superior Court (1996) 42 Cal.App.4th 1801 [50 Cal.Rptr.2d 236] is well placed. There, as in Ramos, there were two complaints, two preliminary hearings and two section 871 dismissals by a magistrate. The Bodner court, which was the same court that decided Martinez, distinguished Martinez on those facts. The instant case may be similarly distinguished.
The prosecution of the gang enhancement was barred here by section 1387.
[[/]]*
The criminal street gang enhancement is stricken. [[/]]* In all other respects, the judgment is affirmed.
Stone (S. J.), P. J., concurred.