
54 Cal.2d 498 (1960)
THE PEOPLE, Respondent,
v.
BARBARA JEAN ELLIOT, Appellant.
Crim. No. 6630. 
Supreme Court of California. In Bank.  
July 22, 1960.
 Leonard Nasatir for Appellant.
 Stanley Mosk, Attorney General, William E. James, Assistant Attorney General, and Marvin L. Part, Deputy Attorney General, for Respondent.
 PETERS, J.
 Appellant Barbara Elliot was convicted on two counts of violating section 288a of the Penal Code (sex perversion). She was sentenced to serve one year in the county jail on each count, the sentences to run concurrently. Both sentences were suspended, and she was granted probation on the condition that she pay a $300 fine.
 This appeal is based solely on the ground that the committing magistrate, over appellant's repeated objections, allowed an unauthorized person to remain in the courtroom during the preliminary examination after appellant had moved to exclude all such persons under the provisions of section 868 of the Penal Code.
 Section 868 provides: "The magistrate must also, upon the request of the defendant, exclude from the examination every person except his clerk, court reporter and bailiff, the prosecutor and his counsel, the Attorney General, the district attorney of the county, the defendant and his counsel, and the officer having the defendant in custody; ..." *502
 At the commencement of the preliminary examination, on December 3, 1957, appellant duly requested that the magistrate exclude all persons not excepted by section 868 from the courtroom. The magistrate granted the motion, and cleared the court of all such unauthorized persons. A short time later, however, a newspaper reporter was permitted to return, and, in spite of appellant's repeated objections, was permitted to remain in the courtroom during the remainder of the preliminary examination. At the close of the preliminary examination appellant was ordered held for trial, and, on December 18, 1957, an information was filed charging her with the violations of which she was subsequently convicted.
 On January 27, 1958, pursuant to section 995 of the Penal Code,  [fn. 1] appellant filed a motion in the superior court to set aside the information on the ground that she had not been "legally committed." This motion was denied. Appellant then sought a writ of prohibition from the District Court of Appeal. The application was denied without opinion. Then, at the commencement of her trial in the superior court, appellant, after waiving a jury trial, moved to dismiss the information, and, in the alternative, to exclude all evidence on the ground that her rights had been violated by the committing magistrate. These motions were overruled. She was then tried, found guilty, and sentenced.
 There is no doubt that the trial court committed error in denying appellant's motion to set aside the information. The question is as to the effect of that error.
 [1] In the first place, as a result of that error, appellant was not "legally" committed within the meaning of section 995 of the Penal Code. That section expressly provides that the court "must" set aside an information if the defendant has not been "legally committed." "The phrase 'legally committed,' ... refers to the examination of the case and the holding of the defendant to answer, as prescribed by title 3, chapter 7, of the Penal Code." (Ex parte Baker, 88 Cal. 84, 85 [25 P. 966].) [2] An information, of course, will not be set aside merely because there has been some irregularity *503 or minor error in procedure in the preliminary examination. (People v. Rodrigo, 69 Cal. 601 [11 P. 481].) But where it appears that, during the course of the preliminary examination, the defendant has been denied a substantial right, the commitment is unlawful within the meaning of section 995, and it must be set aside upon timely motion. (People v. Napthaly, 105 Cal. 641 [39 P. 29]; People v. Salas, 80 Cal.App. 318 [250 P. 526]; People v. Miller, 123 Cal.App. 499 [11 P.2d 884]; People v. Williams, 124 Cal.App.2d 32 [268 P.2d 156]; McCarthy v. Superior Court, 162 Cal.App.2d 755 [328 P.2d 819].)
 [3] It is also settled that, if the defendant has not been legally committed and if the trial court erroneously denies the motion to set the commitment aside and permits the action to proceed to judgment, the resulting conviction must be reversed. (Whitney v. Superior Court, 182 Cal. 114 [187 P. 12]; People v. Howard, 111 Cal. 655 [44 P. 342]; People v. Napthaly, supra, 105 Cal. 641.) [4] The theory of these cases is that where the accused is not legally committed within the meaning of section 995 of the Penal Code, the commitment is voidable. Upon proper objection, the superior court has no jurisdiction to proceed. It is the same as if no preliminary examination at all had been held, and is analogous to the situation where no evidence to connect the accused with the crime is introduced at the preliminary examination. In such event, of course, the information must be quashed. (Greenberg v. Superior Court, 19 Cal.2d 319 [121 P.2d 713].) The holding to the contrary in People v. McCalla, 63 Cal.App. 783 [220 P. 436], is disapproved.
 The commitment procedure is set forth in title 3, chapter 7, of the Penal Code. In that portion of the Penal Code, the Legislature has provided numerous basic safeguards which are aimed at assuring the defendant a "fair trial" during the process of commitment as well as at his actual trial. [5] "The forms of procedure required by law in preliminary examinations establish a substantial right vested in every person charged with crime and should not be lightly waved aside." (People v. Brooks, 72 Cal.App.2d 657, 661 [165 P.2d 51].)
 [6] The preliminary examination must be held basically in accordance with the procedures established by law, and if the magistrate disregards substantial rights guaranteed to the defendant the resulting commitment is unlawful. Any implication to the contrary found in the broad generalizations set forth in the cases of People v. Beach, 122 Cal. 37 [54 *504 P. 369]; People v. Van Horn, 119 Cal. 323 [51 P. 538]; and People v. Collins, 117 Cal.App.2d 175, 181 [255 P.2d 59], is disapproved. (See People v. Malowitz, 133 Cal.App. 250, 255 [24 P.2d 177].)
 [7] The right afforded to a defendant by section 868 of the Penal Code, to require that all unauthorized persons be excluded from the courtroom during the preliminary examination, is a substantial safeguard which cannot be disregarded by the magistrate. The section is mandatory. It contrasts sharply with section 867, which gives the magistrate discretion to exclude and/or separate witnesses. Section 868 gives the defendant an absolute right to protect himself against the presence of unauthorized persons at his preliminary examination.
 This is not a mere insubstantial right. It is, rather, a fundamental safeguard. The testimony heard at the preliminary examination is often that of the prosecution only. The defense may remain silent if it appears that reasonable or probable cause to commit has been established. [8] One of the main purposes of section 868 is to give the defendant the opportunity of protecting his right to an impartial and unbiased jury by preventing dissemination of this testimony, either by newspaper or other media prior to trial. (See Kirstowsky v. Superior Court, 143 Cal.App.2d 745 [300 P.2d 163].) [9] "The right to unbiased and unprejudiced jurors is an inseparable and inalienable part of the right to a trial by jury guaranteed by the constitution." (Lombardi v. California St. Ry. Co., 124 Cal. 311, 317 [57 P. 66].) This right may be substantially impaired if the protection afforded by section 868 is denied.
 [10] Appellant's waiver of a jury trial in the present case did not cure the magistrate's error. She should not have been placed in a position where she had to choose to either waive her right to a jury trial, or risk being tried by jurors who may have read or heard testimony prior to trial. The right to be tried by an impartial jury, if one so chooses, is absolute.
 [11] The preliminary examination is not merely a pretrial hearing. "The purpose of the preliminary hearing is to weed out groundless or unsupported charges of grave offenses, and to relieve the accused of the degradation and the expense of a criminal trial. Many an unjustifiable prosecution is stopped at that point, where the lack of probable cause is clearly disclosed." (Jaffe v. Stone, 18 Cal.2d 146, 150 [114 P.2d 335, 135 A.L.R. 775].) [12] Section 868 provides a substantial and often indispensable protection to *505 the person who is unjustifiably accused of a criminal offense. The Legislature has specifically conferred upon an accused the right to protect his name from being maligned at a preliminary examination. This protection is too important to the innocent, as well as to the guilty, to permit it to be ignored by the committing magistrate.
 [13] Nor was it necessary for the accused to show actual prejudice caused by the denial of her rights. One of the basic purposes of section 868 of the Penal Code is to preserve the defendant's right to a trial by an unbiased jury. It is a fair trial statute implementing the constitutional guarantees. Of such a statute the United States Supreme Court in Hayes v. Missouri, 120 U.S. 68, 69 [7 S.Ct. 350, 30 L.Ed. 578], had the following to say: "The constitution of ... every state of the Union, guarantees to all persons accused ... the right to a trial by an impartial jury, ... and this implies that the jurors shall be free from all bias. ... To secure such a body numerous legislative directions are necessary. ... All of these ... are matters of legislative discretion. But to prescribe whatever will tend to secure the impartiality of jurors in criminal cases is not only within the competency of the legislature, but among its highest duties." (Italics added.) [14] When the statute is violated no showing of actual prejudice is required.prejudice must be presumed. Obviously, if actual prejudice must be shown, the guarantee would become meaningless. (People v. Byrnes, 84 Cal.App.2d 72, 79 [190 P.2d 290].)
 [15] It is well established that an accused cannot ignore errors in the commitment procedure until after conviction and then attempt to raise such errors for the first time on appeal. But appellant does not fall within this rule. She raised her objection to the magistrate's erroneous conduct at every stage in the proceedings and by every means available to her. She first attempted to invoke the protection of section 868 at the commencement of the preliminary examination. She repeatedly objected when the magistrate erroneously permitted the newspaper reporter to return to the courtroom. She moved in a timely manner to set aside the information in conformity with section 995 of the Penal Code. Then she sought a writ of prohibition, and, when this was denied, she further objected at the commencement of her trial. Under these circumstances, appellant is entitled to urge the illegality of her commitment as a ground for reversal on appeal. (Whitney v. Superior Court, supra, 182 Cal. 114; People v. Howard, *506 supra, 111 Cal. 655; People v. Napthaly, supra, 105 Cal. 641.) If this were not the rule then an erroneous denial of a motion to set aside the information would cure a substantial error in the commitment procedure.
 [16] Article VI, section 4 1/2, of the Constitution, cannot operate so as to save this conviction. When a defendant has been denied a fair trial prejudice must be presumed. [17] Nor can a fair trial in the superior court cure the errors of the committing magistrate and of the superior court judge in permitting the trial to take place. Before an accused can be required to defend himself he must be committed in accordance with law. (People v. Bomar, 73 Cal.App. 372, 378 [238 P. 758].)
 In People v. Sarazzawski, 27 Cal.2d 7 [161 P.2d 934], a judgment imposing the death penalty was reversed, even though the evidence amply supported the verdict and judgment, because of errors tending to deprive the defendant of certain elements of a fair trial. These errors, as is true in the instant case, had nothing to do with the merits of the case. One error was in telling counsel that argument on the motion for the new trial would be had on October 16th, and then requiring counsel to argue the motion on October 6th, when the motion was filed. The other error consisted in telling the jurors that if they honestly answered questions on their voir dire but forgot some possible ground of disqualification and remembered it after the trial started, they should keep the matter secret and not tell the judge about it. These errors were held to have denied appellant some of the elements of a fair trial. [18] The court said (p. 11): "When a defendant has been denied any essential element of a fair trial or due process, even the broad saving provisions of section 4 1/2 of article VI of our state Constitution cannot remedy the vice and the judgment cannot stand. [Citing four cases.] [19] That section was not designed to 'abrogate the guaranties accorded persons accused of crime by other parts of the same constitution or to overthrow all statutory rules of procedure and evidence in criminal cases. When we speak of administering "justice" in criminal cases, under the English or American system of procedure, we mean something more than merely ascertaining whether an accused is or is not guilty. It is an essential part of justice that the question of guilt or innocence shall be determined by an orderly legal procedure, in which the substantial rights belonging to defendants *507 shall be respected.' (People v. O'Bryan, 165 Cal. 55, 65 [130 P. 1042].)"
 [20] It must be remembered that here we have a mandatory statute that admittedly has been violated. Unless the error can be reached on appeal from the judgment it cannot be reached at all even though the superior court erroneously denied a motion under section 995 of the Penal Code and the appellate court erroneously denied the application for a writ. To agree with respondent would, in effect, be to write the statute off the books.
 The judgment is reversed, and the trial court is directed to set the information aside.
 Gibson, C. J., Traynor, J., Schauer, J., McComb, J., White, J., and Dooling, J., concurred.
 "If it be an information:"
 "1. That before the filing thereof the defendant had not been legally committed by a magistrate."
 "2. That the defendant had been committed without reasonable or probable cause."
NOTES
[fn. 1]  1. Section 995 reads, in part: "The indictment or information must be set aside by the court in which the defendant is arraigned, upon his motion, in either of the following cases: ...
