
42 Cal.App.4th 1801 (1996)
50 Cal. Rptr.2d 236
MICHAEL BODNER, Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. B093995.
Court of Appeals of California, Second District, Division Four.
March 1, 1996.
*1802 COUNSEL
Michael P. Judge, Public Defender, Kenneth P. Erlich and John Hamilton Scott, Deputy Public Defenders, for Petitioner.
No appearance for Respondent.
Gil Garcetti, District Attorney, Brentford J. Ferreira and Natasha S. Cooper, Deputy District Attorneys, for Real Party in Interest.
OPINION
VOGEL (C.S.), P.J. 

INTRODUCTION
Defendant and petitioner Michael Bodner seeks a writ compelling the trial court to dismiss attempted murder charges against him, pursuant to Penal Code section 1387, which bars further prosecution of an action which has been twice terminated.[1] We grant the writ. A prior action was terminated by the granting of defendant's motion under section 995; at the preliminary hearing in the second action the magistrate declined to hold defendant to answer for attempted murder, but held him to answer for assault with a deadly weapon. Under Ramos v. Superior Court (1982) 32 Cal.3d 26, 35-36 [184 Cal. Rptr. 622, 648 P.2d 589], the second magistrate's order is a second termination of attempted murder charges, which bars the People's further prosecution under section 739 for attempted murder.


*1803 FACTUAL AND PROCEDURAL BACKGROUND
The prosecution arises from an incident in which defendant shot at one named victim, who testified at the preliminary hearing, and at a John Doe victim.
There is no dispute that there has been a previous prosecution, in 1994 in superior court case (People v. Bodner (Super. Ct. L.A. County No. BA094674)), which was finally terminated. In the prior action, the People filed a felony complaint charging two counts of attempted murder; the magistrate at the first preliminary hearing believed the evidence insufficient to show intent to kill; the magistrate did not hold defendant to answer to the two counts of attempted murder but did hold defendant to answer to one count of a lesser offense, assault with a deadly weapon. Pursuant to section 739 the People then filed an information in that same case again alleging attempted murder. On defendant's motion under section 995, which the People did not then oppose, the superior court dismissed the attempted murder charges. Subsequently the People dismissed the remaining count in No. BA094674 pursuant to section 1382.
In 1995 the People initiated by felony complaint a second prosecution for two counts of attempted murder, in case No. BA112997. The magistrate at the preliminary hearing of the second prosecution found the evidence insufficient to hold defendant to answer for two counts of attempted murder, but sufficient to hold defendant to answer for two counts of assault with a deadly weapon.
The dispute involves whether, at that point, the People were entitled to file an information in No. BA112997, pursuant to section 739, again alleging two counts of attempted murder. After the People did so, defendant moved to dismiss pursuant to section 1387. The trial court denied defendant's motion to dismiss. Defendant petitioned this court for a writ of mandate. We granted an alternative writ commanding the trial court either to set aside its order denying defendant's motion or show cause why it should not do so. The People filed an answer and return.

DISCUSSION
Section 1387, subdivision (a) provides in pertinent 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...."
*1804 (1) There is no dispute there was a previous termination in No. BA094674. Then in the second action, No. BA112997, the magistrate dismissed the two counts of attempted murder but held defendant to answer for two counts of assault with a deadly weapon.
Defendant contends the second magistrate's order was a second termination as to attempted murder, and that section 1387 bars the People from further prosecution for attempted murder by filing an information pursuant to section 739. Defendant contends the People's remedy, which the People failed to follow, was to challenge the magistrate's order directly pursuant to section 871.5.
The People contend section 1387 does not prevent the filing of an information in the second action pursuant to section 739. The People contend that because the second magistrate did not dismiss the action entirely, but held defendant to answer for related lesser charges of assault with a deadly weapon, section 1387 does not by its terms apply. Section 1387 refers to an order terminating an action pursuant to section 871. Section 871 provides for the magistrate to dismiss the action if the evidence shows no public offense has been committed or there is insufficient cause to believe the defendant has committed a public offense. Because the magistrate held defendant to answer to assault, the People contend, the applicable section is section 872, which provides for the magistrate to hold the accused to answer to any offense supported by the evidence. Thus, the People contend, there has been no second order "terminating an action pursuant to ... Section 871...." The People contend that section 1387 does not bar filing an information pursuant to section 739, which authorizes the prosecution to file an information charging any offense supported by the preliminary hearing evidence, "[w]hen a defendant has been examined and committed, as provided in Section 872."
Although the People's argument is consistent with the literal terms of the statutes, it has been rejected by Supreme Court case law we are bound to follow. In Ramos v. Superior Court, supra, 32 Cal.3d 26, 29, the defendant was charged with murder with special circumstances. The magistrate at the first preliminary hearing dismissed all charges. The prosecution initiated a new complaint. The magistrate at the second preliminary hearing held the defendant to answer for murder but not for special circumstances. The People there argued, as here, that the second magistrate's order did not terminate the prosecution, and that section 1387 did not bar filing an information pursuant to section 739, because such an information should not be considered an "other prosecution," but merely a continuation of the second action as authorized. (32 Cal.3d at p. 34.) The Supreme Court *1805 rejected that argument. "[W]e conclude that the district attorney's reinstatement of the special circumstance allegation pursuant to section 739 was an `other prosecution for the same offense' which was barred under section 1387 because the allegation had already been dismissed twice under section 871." (Id. at p. 36.) The court went on to say, "[t]his interpretation of section 1387 does not leave the People without means to challenge a second order of a magistrate dismissing all or a portion of a complaint. The 1980 legislation added a new Penal Code provision  section 871.5  which provides the People with a specially designed procedure for challenging a magistrate's dismissal order. [Fn. omitted.] In this case, however, the People did not avail themselves of the remedy afforded by section 871.5, but instead attempted simply to ignore the second dismissal by proceeding directly under section 739. Although the People suggest that we should equate the district attorney's authority to proceed under section 739 with his authority to challenge a magistrate's ruling under section 871.5, section 871.5 differs from section 739 in a number of significant respects, establishing more stringent time limitations and notice requirements than section 739 and, perhaps most importantly, placing the burden on the People  rather than the defendant  to go forward and demonstrate the impropriety of the magistrate's dismissal. In light of the overall purpose and interrelated provisions of the 1980 legislation, we conclude that after a second dismissal, section 1387 bars the People from simply refiling the dismissed charges under section 739. [Fn. omitted.]" (Id. at pp. 36-37.)
This case is indistinguishable from Ramos. The action was previously terminated in No. BA094674, where both the magistrate at the first preliminary hearing and the superior court on a motion under section 995 found the evidence insufficient to support reasonable cause to believe defendant guilty of attempted murder. Then in the second action, No. BA112997, the magistrate at the preliminary hearing of the second action likewise found the evidence insufficient and refused to hold defendant to answer for attempted murder. This is the precise situation in which the Supreme Court held in Ramos that the People could not proceed by merely filing an information under section 739. In Brazell v. Superior Court (1986) 187 Cal. App.3d 795 [232 Cal. Rptr. 246], the Court of Appeal followed Ramos on facts also similar to this case. A first prosecution terminated with an order of dismissal by the superior court under section 995. (187 Cal. App.3d at p. 798.) The People initiated a new prosecution. The magistrate at the preliminary hearing in the second prosecution dismissed murder charges but held defendant to answer on related other charges. The People filed an information pursuant to section 739. (187 Cal. App.3d at p. 798.) The appellate court ordered the superior court to dismiss the murder charges. It held the second magistrate's order was a second termination within the meaning of section 1387 *1806 and the fact that the magistrate held defendant to answer on other charges "does not affect our conclusion that the murder counts were dismissed." (187 Cal. App.3d at p. 800, citing Ramos; see In re Williams (1985) 164 Cal. App.3d 979, 983 [211 Cal. Rptr. 32] ["Despite the all-or-nothing wording of (section 871), it obviously applies where the magistrate finds insufficient evidence of and dismisses one count, but sufficient evidence of others"].)
The instant case is controlled by Ramos and not by our decision in People v. Superior Court (Martinez) (1993) 19 Cal. App.4th 738 [23 Cal. Rptr.2d 733], on which the trial court relied. In Martinez the defendants erroneously attempted to construe the first action as having been terminated twice, barring another prosecution. In that context we referred to the first action as having been continued under section 739 until dismissed by the superior court under section 1385. We expressly distinguished Ramos as a "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) [in which] the Supreme Court held further prosecution under section 739 would violate section 1387." (People v. Superior Court (Martinez), supra, 19 Cal. App.4th at p. 746.)

CONCLUSION
The trial court should have held that the attempted murder charges had been twice terminated for the purpose of section 1387. The parties agree that the trial court did not reach, and on remand should be permitted to reach, the issue whether the People may prosecute a third action under the "excusable neglect" exception to section 1387 in section 1387.1.

DISPOSITION
The alternative writ, having served its purpose, is discharged. Let a peremptory writ issue commanding the trial court to vacate its order denying defendant's motion to dismiss the attempted murder charges as twice dismissed under section 1387 and to conduct further proceedings consistent with the views expressed in this opinion.
Epstein, J., and Hastings, J., concurred.
The petition of real party in interest for review by the Supreme Court was denied May 15, 1996. Baxter, J., was of the opinion that the petition should be granted.
NOTES
[1]  All further statutory references are to the Penal Code.
