
66 Cal.App.3d 881 (1977)
136 Cal. Rptr. 311
T.P.B., Petitioner,
v.
THE SUPERIOR COURT OF ALAMEDA COUNTY, Respondent;
THE PEOPLE, Real Party in Interest.
Docket No. 39382.
Court of Appeals of California, First District, Division One.
February 8, 1977.
*883 COUNSEL
Michael E. Kyle for Petitioner.
Evelle J. Younger, Attorney General, Jack R. Winkler, Chief Assistant Attorney General, Edward P. O'Brien, Assistant Attorney General, William D. Stein and Herbert F. Wilkinson, Deputy Attorneys General, for Respondent and for Real Party in Interest.
OPINION
MOLINARI, J.
(1) (See fn. 1.) Petitioner seeks a writ of prohibition restraining the superior court, sitting as a juvenile court, from taking any further action in the proceedings pending against him on the ground that he has once been placed in jeopardy.[1] An alternative writ was issued by this court.
A verified petition was filed alleging that petitioner was a person described in Welfare and Institutions Code section 602 in that he violated Penal Code section 459 (burglary). Following a detention hearing the adjudicatory hearing was instituted before a judge of the juvenile court. During the voir dire of a police officer by petitioner's counsel the judge disqualified himself on the ground that he could not fairly and impartially consider the evidence and declared a mistrial. Petitioner did not move for nor did he consent to a mistrial. Following the declaration of a mistrial the matter was set for hearing before a different judge. Petitioner then entered a plea of once in jeopardy pursuant to Penal Code section 1016, subdivision 5. The plea was rejected on the basis that legal necessity warranted the declaration of a mistrial.
(2) In juvenile court proceedings juveniles are entitled to constitutional protection against twice being placed in jeopardy for the same offense. (Breed v. Jones, 421 U.S. 519, 531 [44 L.Ed.2d 346, 356-357, 95 S.Ct. 1779]; Richard M. v. Superior Court, supra, 4 Cal.3d 370, 376-377.) *884 The court-trial analogy is applicable because a jury trial is inapplicable in juvenile proceedings. (Richard M. v. Superior Court, supra, at p. 375.) Accordingly, jeopardy attached when the first witness was sworn in the adjudicatory hearing (Richard M. v. Superior Court, supra; People v. Sturdy, 235 Cal. App.2d 306, 314 [45 Cal. Rptr. 203]) and petitioner could not be retried and placed in jeopardy unless the mistrial was consented to or there was legal necessity for the declaration of a mistrial. (See Paulson v. Superior Court, 58 Cal.2d 1, 5 [22 Cal. Rptr. 649, 372 P.2d 641]; Cardenas v. Superior Court, 56 Cal.2d 273, 275 [14 Cal. Rptr. 657, 363 P.2d 889, 100 A.L.R.2d 371].)
In the present case there was no consent by petitioner to the mistrial. The juvenile court, in denying the plea of once in jeopardy determined that petitioner was not in legal jeopardy because the mistrial was the result of legal necessity. Hence, our inquiry is whether there was a legal necessity for the mistrial.
(3) (See fn. 2.) The concept of "legal necessity" was described in Curry v. Superior Court, supra, 2 Cal.3d 707, 713-714, as follows: "... legal necessity for a mistrial typically arises from an inability of the jury to agree [citations] or from physical causes beyond the control of the court [citations], such as the death, illness, or absence of judge or juror [citations] or of the defendant [citations]. A mere error of law or procedure, however, does not constitute legal necessity. [Citations.]"[2]
(4a) In the present case, while testimony was being taken, the juvenile court judge hearing the matter first disqualified himself and then declared a mistrial. The parties agree that the reason given by the judge for his disqualification was that he could not fairly and impartially consider the evidence.[3] The People contend that because the declaration of disqualification was proper in that the trial judge was in the best position, as the factfinder, to evaluate his own bias, such disqualification acted as a mistrial in that it prevented the case as a matter of legal necessity from proceeding.
*885 Petitioner places strong reliance on Scott v. Municipal Court, 17 Cal. App.3d 885 [95 Cal. Rptr. 460]. In that case the defendant, who was charged with a misdemeanor, waived a jury trial. After the case had been submitted and during the summarization of the evidence by the judge, defense counsel interrupted to object to consideration of certain evidence and, in connection with the objection, stated that another woman charged with the same offense had been acquitted by another judge. The trial judge chastised counsel for making that statement, declared that because of it he could no longer render an impartial decision, and then declared a mistrial. The reviewing court held that no "legal necessity" existed for the order of mistrial and that, because defendant had been in jeopardy at her first trial, she could not be retried for the same offense. (At p. 888.)
The People argue that Scott was wrongly decided. We need not concur with this assertion in holding that in the present case there was legal necessity for declaring a mistrial. Scott is factually different from the case at bench. In Scott the trial judge ordered a mistrial after the case had been submitted for decision upon the mere declaration that he could no longer render an impartial decision because of a statement made by defense counsel during the judge's summarization of the evidence. Here, the mistrial was declared prior to submission of the cause and after the judge had declared his disqualification.
In Code of Civil Procedure section 170 it is provided, in pertinent part, as follows: "No justice or judge shall sit or act as such in any action or proceeding: ... 5. When it is made to appear probable that, by reason of bias or prejudice of such justice or judge a fair and impartial trial cannot be had before him.... If such judge admits his disqualification, ... the action or proceeding shall be heard and determined by another judge or justice not disqualified, ..." (Italics added.) (5) Code of Civil Procedure section 170 is applicable in criminal proceedings. (Blackman v. MacCoy, 169 Cal. App.2d 873, 878-879 [338 P.2d 234, 339 P.2d 169]; see People v. Thomas, 8 Cal.3d 518, 520-521 [105 Cal. Rptr. 366, 503 P.2d 1374]; McKay v. Superior Court, 98 Cal. App.2d 770 [220 P.2d 945]; In re Harrington, 87 Cal. App.2d 831 [197 P.2d 783]; People v. Crappa, 73 Cal. App. 260, 261 [238 P. 731].) There can be no question as to the applicability of this statute to juvenile court proceedings.
(6) Any act of a disqualified judge in violation of section 170 of the Code of Civil Procedure is absolutely void whenever brought into question and a judgment rendered by such judge is open to attack at any *886 time. (Cadenasso v. Bank of Italy, 214 Cal. 562, 567-568 [6 P.2d 944]; Cuyamaca Water Co. v. Superior Court, 193 Cal. 584, 592 [226 P. 604, 33 A.L.R. 1316]; In re Harrington, supra, 87 Cal. App.2d 831, 835.) (4b) In the instant case the judge admitted his disqualification on the basis that by reason of bias or prejudice a fair and impartial trial could not be had before him. From that moment the judge was disqualified from acting or sitting in the case other than to declare a mistrial. Under section 170 it was required that action or proceeding be heard by another judge. Accordingly, a "legal necessity" existed for the order of mistrial because the trial judge was disqualified as a matter of law from continuing to sit and act in the case. (See Chastain v. Superior Court, 14 Cal. App.2d 97, 104 [57 P.2d 982].)
The situation in the present case did not involve a mere error of law or procedure; rather it involved the very jurisdiction of the trial judge to proceed with the action. The posture in which the action found itself is akin to the legal necessity deemed a physical cause beyond the control of the court brought about by the illness or absence of the judge. (See Curry v. Superior Court, supra, 2 Cal.3d 707, 714.)
We do not apprehend the instant situation to be one where a defendant is deprived of his "constitutionally protected freedom of choice in the name of a paternalistic concern for his welfare." (Curry v. Superior Court, supra, 2 Cal.3d 707, 717.) That freedom of choice must yield to the paramount fundamental right of every litigant to a fair trial. Here the judge because of his admitted bias and prejudice was unable as a matter of law to afford petitioner a fair and impartial trial. Had he proceeded with the trial he would have offended the basic concepts of due process.
The peremptory writ of prohibition is denied and the alternative writ of prohibition is discharged.
Sims, J., and Elkington, J., concurred.
NOTES
[1]  Prohibition is the proper remedy to prevent further proceedings against a defendant who has once been placed in jeopardy. (Richard M. v. Superior Court, 4 Cal.3d 370, 375 [93 Cal. Rptr. 752, 482 P.2d 664]; Curry v. Superior Court, 2 Cal.3d 707, 712 [87 Cal. Rptr. 361, 470 P.2d 345]; Clemensen v. Municipal Court, 18 Cal. App.3d 492, 497 [96 Cal. Rptr. 126].)
[2]  A defendant may waive the double jeopardy protection by consenting to the declaration of mistrial but such consent must clearly appear from the affirmative conduct of the defendant. (Curry v. Superior Court, supra, 2 Cal.3d 707, 713; People v. Franklin, 56 Cal. App.3d 18, 23 [128 Cal. Rptr. 94]; see People v. Compton, 6 Cal.3d 55, 62 [98 Cal. Rptr. 217, 490 P.2d 537].)
[3]  Petitioner asserts that the trial court became upset over the manner and attitude of petitioner's counsel in his voir dire examination of a police witness.
