
147 Cal.App.2d 515 (1957)
HERBERT L. SINGER et al., Appellants,
v.
DAVID BOGEN et al., Defendants; WILLIAM B. McKESSON, as Judge, etc., et al., Respondents.
Civ. No. 22026. 
California Court of Appeals. Second Dist., Div. One.  
Jan. 11, 1957.
 Randolph Weltner and C. A. Weltner for Appellants.
 Harold W. Kennedy, County Counsel (Los Angeles), William E. Lamoreaux, Assistant County Counsel, Isaac Pacht, Clore Warne and Harvey M. Grossman, for Respondents.
 FOURT, J.
 This is an appeal by the plaintiffs from a judgment of dismissal made and entered in favor of the respondents and against the plaintiffs.
 The plaintiff Sharon Singer, a minor, and her father and mother, Mr. and Mrs. Herbert L. Singer, filed an action for false imprisonment against respondents Judge William B. McKesson and Judge William B. Neeley, judges of the Superior Court of the State of California in and for the County of Los Angeles. The trial court ordered a dismissal of the action after having sustained the demurrer of the respondents to the amended complaint.
 Substantially, the allegations of the amended complaint are as follows: That Judge William B. McKesson and Judge William B. Neeley are sued in their official capacities as judges of the superior court. As to Judge William B. McKesson, it is alleged that on June 29, 1955, after a petition was filed to have Sharon Singer declared a ward of the juvenile court, Judge McKesson, without any hearing, ordered Sharon detained in Juvenile Hall and that on June 30, 1955, he conducted a predetention hearing in regard to Sharon, but that no citation with reference to the hearing was served upon Sharon's parents; that at the predetention hearing Judge McKesson ordered the continued detention of Sharon in juvenile hall, and on July 1, 1955, ordered her transferred to a boarding home where she was kept until she was returned to Juvenile Hall on July 6, 1955, on the further order of Judge McKesson. It is not alleged that Sharon's parents were not present at the hearing held on June 30, 1955.
 It is then alleged that the petition to declare Sharon a ward of the juvenile court was finally terminated by Judge McKesson in favor of Sharon.
 It is further alleged, on information and belief, that after the defendant David Bogen, superintendent of juvenile hall, *517 had been served with an order issued by the District Court of Appeal, District Two, Division Three, to release Sharon, he conferred with Judge McKesson, who instructed the defendant Bogen to disregard the order and that one hour expired before Sharon was released.
 As to Judge William B. Neeley, it is alleged that on June 24, 1955, he signed an order to detain Sharon in juvenile hall, pursuant to a written request of the district attorney, a copy of which was attached to the complaint, and is as follows:
 "In the Superior Court of the County of Los Angeles, State of California, Sitting In Separate Session In the Exercise of Jurisdiction As Juvenile Court"
 Tabular Material Omitted
 "In the Matter of the above mentioned minor person, it is respectfully submitted as follows:"
 "That a petition has been filed in the Juvenile Court of the County of Los Angeles; that said above mentioned person is residing within said county, and is a person alleged to come within the provisions of the 'Juvenile Court Law,' of the State of California; that said person is of the age of 8 years, and should be detained, as a material witness for the People of the State of California pending the trial of People of the State of California vs. S/David Eli Singer Dist. Atty's No. 211 526, on a charge of 288 of the Penal Code"
 "In the interests of justice because of pending charge against said adult and for the welfare and protection of said minor person it is necessary that said witness be not interviewed or allowed any visitors except on consent of the District Attorney or under conditions prescribed by the court which will insure that the minor witness will not be improperly influenced or intimidated. The reasons for requesting that said witness be so held are as follows: Defendant is grandfather of victim and parents do not wish to have him prosecuted. Case came to attention of police through neighbors who had observed defendant's actions."
 "The District Attorney hereby agrees to notify the Probation Department when said minor is no longer needed as a material witness in the above entitled action. *518"
 "Wherefore, your petitioner respectfully requests that said minor be detained in Juvenile Hall or other suitable place until no longer needed as a witness in the above entitled action."
 "Dated this 24 day of June, 1955"
 District Attorney
 By Florence E. Linn
 S/ Deputy District Attorney
 "For the welfare and protection of said minor, and in the interest of justice, it is hereby ordered that said minor be detained in Juvenile Hall as a material witness for the People of the State of California for the reasons above set forth, without visitation as above requested, except with the approval of the District Attorney or by order of this court."
 "Dated: This 24 day of June, 1955"
 William B. Neeley
 S/Judge of the Juvenile Court""
 The judge signed the order to detain the child as is set forth on the exhibit above. The complaint then alleges that at the time of the order no petition had been filed and none was filed until June 29, 1955.
 It is at once apparent that the two judges involved were acting in their official capacities as judges of the juvenile court of the State of California, in and for the County of Los Angeles.
 The appellants contend that the judges of the juvenile court had no jurisdiction to incarcerate or detain the minor for use as a witness and that the judges, acting without jurisdiction, are now subject to an action for false imprisonment.
 The appellants rely heavily upon the case of De Courcey v. Cox, 94 Cal. 665 [30 P. 95], which was an action for false imprisonment. The judgment in that case went in favor of the defendant on the pleadings, the plaintiff appealed, and the judgment was reversed. The complaint set forth that upon a complaint made before the defendant, a justice of the peace, charging plaintiff with refusing to return the sum of $20, alleged to have been overpaid the plaintiff by mistake by the El Cajon Vineyard Company, the defendant issued a warrant of arrest, upon which the plaintiff was arrested and brought before the defendant and required to and did plead to the charge, and after trial the defendant rendered judgment that the plaintiff restore the amount of $20 or be *519 committed to jail for 20 days; that pursuant to the judgment, the defendant issued a commitment and placed it in the hands of an officer who executed it by imprisoning the plaintiff in the county jail for three days. The court stated, at page 668: "Defendant proceeded upon the charge as he might have done had it constituted a crime, which it clearly did not."
 In Platz v. Marion, 35 Cal.App. 241 [169 P. 697], it was held that a justice of the peace was not liable for damages for false imprisonment in issuing a warrant for and causing the arrest of an attorney at law upon a complaint filed with him which attempted to charge, but was wholly insufficient to charge the attorney with the crime of common barratry, in the absence of any claim that the justice was actuated by malice or corrupt motives, his action being based upon an erroneous determination as to the sufficiency of the complaint. The De Courcey case is well analyzed in the Platz case, the court stating, at page 251:
 "... The supreme court held that the complaint stated a cause of action in favor of the plaintiff and against the defendant (the justice of the peace) for damages for false imprisonment. But readily it will be observed that absolutely no public offense whatever under the law was stated in the so-called complaint filed with the justice against the plaintiff. The justice had no jurisdiction of the subject matter of the complaint, so far as a criminal charge was concerned. The complaint merely alleged that the plaintiff, by a mistake, had been overpaid, and there was no pretense, so far as the complaint disclosed, that he obtained or even retained the amount overpaid through any criminal act on his part. If the so-called complaint disclosed anything at all, it was merely a civil action for money had and received, and obviously the proceeding taken by the justice under the complaint was wholly and entirely coram non judice. It was not a case which called for the arrest of the person of the plaintiff. It was, as before suggested, in no sense a criminal case or a proceeding in which the plaintiff was accused of committing a public offense. The facts pleaded by the plaintiff in his action against the justice of the peace might, therefore, be held sufficient to raise the implication that malice characterized the acts of the justice of the peace in issuing the warrant for the arrest of and in committing the plaintiff to imprisonment."
 The court in the Platz case went on further to say (at pages 248-249): "The early case of Grove v. Van Duyn, 44 N.J.L. *520 654 [42 Am.Rep. 648], holds to this view. In that case, which, in its general aspect, resembles the case at bar, a justice of the peace had authorized the arrest of the plaintiff and held him to bail for unlawfully carrying away bundles of cornstalks, 'under a statute which came no nearer to specifying such an offense than carrying away a stack of corn.' It was held that the justice was not civilly liable. So much is said in the opinion in that case that is instructive and enlightening upon the question involved in the case before us, that we feel justified in quoting therefrom in extenso. The court said:"
 " 'Most of the general principles of law pertaining to that branch of this controversy which relates to the alleged liability of the defendant in this suit, who was a justice of the peace, are so completely settled as not to be open to discussion. The doctrine that an action will not lie against a judge for wrongful commitment, or for an erroneous judgment, or for any other act, made or done by him in his judicial capacity, is as thoroughly established as are any other of the primary maxims of the law. Such an exemption is absolutely essential to the very existence, in any valuable form, of the judicial office itself, for a judge could not be either respected or independent if his motives for his official actions or his conclusions, no matter how erroneous, could be put in question at the instance of every malignant or disappointed suitor. Hence we find this judicial immunity has been conferred by the laws of every civilized people. That it exists in this state in its fullest extent has been repeatedly declared by our own courts. Such was pronounced by the supreme court to be the admitted principle in the cases of Little v. Moore, 4 N.J.L. 74, 75 [7 Am.Dec. 574]; Taylor v. Doremus, 16 N.J.L. 473, 476; Mangold v. Thorpe, 33 N.J.L. 134, 137; and by this court in Loftus v. Fraz, 43 N.J.L. 667. To this extent there is no uncertainty or difficulty whatever in the subject."
 " 'But the embarrassment arises where an attempt is made to express, with perfect definiteness, where it is that acts done by a judge, and which purport to be judicial acts, are such within the meaning of the rule to which reference has just been made. It is said everywhere in the text-books and decisions that the officer, in order to entitle himself to claim the immunity that belongs to judicial conduct, must restrict his action within the bounds of his jurisdiction, and jurisdiction has been defined to be "authority of the law to act officially *521 in the particular matter in hand": Cooley on Torts, 417. But these maxims, although true in a general way, are not sufficiently broad to embrace the principle of immunity that appertains to a court or judge exercising a general authority. Their defect is that they leave out of the account all those cases in which the officer, in the discharge of his public duty, is bound to decide whether or not a particular case, under the circumstances as presented to him, is within his jurisdiction, and he falls into error in arriving at his conclusion. In such instances, the judge, in point of fact and law, has no jurisdiction according to the definition just given, over "the particular matter in hand," and yet in my opinion, plainly, he is not responsible for the results that wait upon his mistake. And it is upon this precise point that we find confusion in the decisions."
 " 'There are certainly cases which hold that if a magistrate, in the regular discharge of his functions, causes an arrest to be made under his warrant on a complaint which does not contain the charge of a crime cognizable by him, he is answerable in an action for the injury that has ensued. But I think these cases are deflections from the correct rule in that they make no allowance for matters of doubt and difficulty. If the facts presented for the decision of the justice are of uncertain signification with respect to their legal effect, and he decides one way, and exercises a cognizance over the case, if the superior court in which the question arises in a suit against the justice differs with him on this close legal question, is he open by reason of his error to an attack by action? If the officer's exemption from liability is to depend on the question whether he had jurisdiction over the particular case, it is clear that such officer is often triable under such conditions, because the higher court, in deciding a doubtful point of law, may have declared that some element was wanting in the complaint which was essential to bring the case within the judicial competency of the magistrate.' "
 A petition to have the Platz case heard in the Supreme Court was denied.
 In the case of Perry v. Meikle, 102 Cal.App.2d 602 [228 P.2d 17], the plaintiff brought an action against several defendants, among them being a superior court judge. The general charge of the complaint was that the plaintiff had been falsely imprisoned under a contempt order made by the judge. A demurrer was sustained without leave to amend *522 and the appeal taken. The court, in determining the case said, among other things, this (pages 605-606):
 "Notwithstanding the apparent effort of plaintiff to keep from alleging that defendant Twain Michelsen was a judge of the superior court and was acting as such in the proceeding complained of, it is clear from the complaint and the exhibits that Judge Michelsen was acting as superior judge in a matter over which he had jurisdiction, that the proceeding was regular in all respects, and that there would be no basis for any action against him, even if he were not entitled to immunity from civil liability under the well- established and sound rule of public policy so well expressed by Justice Brewer of the U.S. Supreme Court, sitting as a circuit justice, in Cooke v. Bangs, 31 F. 640, 642, as follows: 'With respect to all judicial officers,--justices of the peace, as well as judges of the higher courts,--the settled law of the supreme court of the United States, and I think the plain intimation of the supreme court of this state, is that, where they act within their jurisdiction, they are not amenable to any civil action for damages. No matter what their motives may be, they cannot be inquired into.'"
 "And in Turpen v. Booth, 56 Cal. 65, 69 [38 Am.Rep. 48], our Supreme Court quoted with approval the following language of Justice Field in Bradley v. Fisher, 13 Wall. (U.S.) 335 [20 L.Ed. 646]: '[J]udges of courts of record of superior or general jurisdiction are not liable to civil actions for their judicial acts, even when such acts are in excess of their jurisdiction, and are alleged to have been done maliciously and corruptly. ...' " (Emphasis added.)
 In Pearson v. Reed, 6 Cal.App.2d 277 [44 P.2d 592], the defendant Johnson was the city prosecutor of Los Angeles. The plaintiffs were arrested and charged with petty theft, imprisoned for a short time, released on their recognizance, tried and found not guilty. The plaintiffs thereafter brought an action for malicious prosecution and false arrest against Johnson and others. On the appeal the verdict for the plaintiffs was reversed. The court said in its decision, at pages 280-282:
 "Principles of public policy declared and expounded by courts which have given the subject exhaustive consideration lead irresistibly to the conclusion that no such liability exists. No policy has been declared and maintained more firmly than the one which preserves the independence and freedom of action of judicial and quasi-judicial officers acting in official capacity. The exception runs as to liability for *523 damages resulting from official acts, although they be done without probable cause and with malice. There are but few cases in which the courts have been called upon to decide whether the immunity is extended to a prosecuting officer. The latter question has not been decided in California. In approaching a consideration of the question, it will be helpful to review briefly the principles underlying the rule."
 "In Bradley v. Fisher, 13 Wall. (80 U.S.) 335, 337 [20 L.Ed. 646, 647], Justice Field used the following language: 'For it is a general principle of the highest importance to the proper administration of justice that a judicial officer, in exercising the authority vested in him, shall be free to act upon his own convictions without apprehension of personal consequence to himself. Liability to answer to everyone who might feel himself aggrieved by the action of the judge would be inconsistent with the possession of this freedom and would destroy that independence, without which no judiciary can be either respectable or useful. As observed by a distinguished English judge, it would establish the weakness of judicial authority in a degrading responsibility. (Taaffe v. Downes, 3 Moore P.C. 41 n.) The principle, therefore, which exempts judges of courts of superior or general authority from liability in a civil action for acts done by them in the exercise of their judicial functions obtains in all countries where there is any well ordered system of jurisprudence. It has been the settled doctrine of the English courts for many centuries and has never been denied that we are aware of in the courts of this country. ... The allegation of malicious or corrupt motives could always be made, and if the motives could be inquired into, judges would be subjected to the same vexatious litigation upon such allegations, whether the motives had or had not any real existence. Against the consequences of their erroneous or irregular action, from whatever motives proceeding, the law has provided for private parties numerous remedies, and to those remedies they must in such cases resort. But for malice or corruption in their action while exercising their judicial functions within the general scope of their jurisdiction, the judges of these courts can only be reached by public prosecution in the form of impeachment, or in such other form as may be specially prescribed.'"
 "In Cooley on Torts, third edition, volume 2, page 795, the author says: 'Whenever, therefore, the State confers judicial powers upon an individual, it confers them with full immunity *524 from private suits. In effect the State says to the officer that these duties are confided to his judgment; that he is to exercise his judgment fully, freely and without favor and he may exercise it without fear; that the duties concern individuals but they concern more especially the welfare of the State and the peace and happiness of society; that if he shall fail in the faithful discharge of them, he shall be called to account as a criminal, but that in order that he may not be annoyed, disturbed, and impeded in the performance of these high functions, a dissatisfied individual shall not be suffered to call in question his official action in a suit for damages. This is what the State, speaking by the mouth of the common law, says to the judicial officer. The rule thus laid down applies to large classes of offices, embracing some, the powers attached to which are very extensive and others whose authority is exceedingly limited.' " A petition for a hearing in the Supreme Court in the Pearson case was denied.
 [1] The superior court is a court of general jurisdiction, and the juvenile court is but a part thereof. True it is that there are special procedures and rules adopted for proceedings in the juvenile court. However, when a judge sits as a judge of the juvenile court, he is sitting as a judge of the superior court, exercising a part of the general jurisdiction conferred by the law in such cases, and is referred to as a judge of the juvenile court.
 [2] Great care must be taken not to restrict the absolution from liability where the judge performs, or purports to perform his official functions, and care should be taken in limiting the immunity only to situations where the judge has jurisdiction, if jurisdiction is to have a restricted and limited meaning, for, as counsel for the respondents point out, "there is a danger of becoming ensnared in the conceptual labyrinth which surrounds the term jurisdiction."
 [3] This court, in the case of Frazier v. Moffatt, 108 Cal.App.2d 379, 386 [239 P.2d 123], speaking through Mr. Presiding Justice White, appropriately said: "From a review of the cases we are persuaded that the test of immunity from a civil suit for damages on the part of a judicial officer is not whether he committed an error of judgment in acting as he did, but the question of judicial immunity must be determined on the basis of whether the act in question was within the general scope of the officer's judicial powers and whether he acted in an honest belief that he was legally warranted in doing it." *525
 The reasons for such a rule are obviously not to protect or throw a shield around a misbehaving judge, but rather to preserve and maintain an efficient and independent judiciary who will not have to be continuously worried and concerned over annoying suits for damages.
 [4] It is apparent in the instant case that appellants merely claim certain procedural irregularities in connection with the detention of the minor child, in that a petition and citation were not timely filed, and that the grounds upon which the district attorney sought the detention did not warrant the same. Appellants, necessarily, must admit that respondents had the authority to entertain the proceedings for detention, and that, if the petition and citation had been timely filed, there would not be even a semblance of a valid claim. In other words, the judges in the instant case acted within the scope of the general subject matter over which they were given power, even though there might have been some procedural error.
 [5] The appellant vigorously contends that the District Court of Appeal, in the case of In re Singer, 134 Cal.App.2d 547 [285 P.2d 955] (habeas corpus), has already determined that the judges in question acted beyond their jurisdiction and that such a ruling must necessarily prevail here.
 In our opinion, the decision in the habeas corpus matter (In re Singer, supra) does not amount to a finding that the respondents were acting without jurisdiction in the sense that it would take them out of the immunity rules. One standard will be recognized for obtaining relief from imprisonment on habeas corpus, and another standard for obtaining damages from public officials in a civil suit.
 In the case of Vallindras v. Massachusetts etc. Ins. Co., 42 Cal.2d 149 [265 P.2d 907], the sheriff had imprisoned the plaintiff under a contempt order of the superior court. The plaintiff was thereafter discharged from imprisonment by a writ of habeas corpus issued by the Supreme Court. The civil action was brought by the plaintiff against the sheriff and his surety for false imprisonment. General demurrers were sustained without leave to amend, and the appeal was taken from the judgment. The Supreme Court in its opinion, in determining the case, said, among other things, the following (pages 151-152):
 "The allegations that the order of commitment was 'void upon its face' and that the sheriff 'did unlawfully imprison *526 plaintiff' are conclusions of law and add nothing to the substantive averments of the complaint. (Citing cases.)"
 "It is plaintiff's theory that our holding in the habeas corpus proceeding (In re Vallindras (1950), supra, 35 Cal.2d 594, 596 [220 P.2d 1]), that he was entitled to be released because 'regardless of the court's failure to file [with the clerk] these judgments [the orders adjudicating contempt] and other deficiencies in the procedure leading to the imprisonment of Vallindras, the order of April 10th does not meet the law's requirements,' establishes as a matter of law that his arrest and detention were unlawful not only as being vulnerable to the attack on habeas corpus but also as establishing civil liability of the sheriff in this damage action. But this theory is not tenable."
 "From time immemorial our law has recognized differences between criminal proceedings and civil proceedings. The fact that a man is held to be entitled to release on habeas corpus does not mean that his custodian must answer in damages for the previous detention. Generally speaking, the right to release from custody is determined by the rules of criminal law while the right to recover damages for false imprisonment depends on the rules of civil law. By the light of the civil law, therefore, we must examine the factual allegations of the complaint to ascertain whether the sheriff was justified in imprisoning plaintiff pursuant to the order of the superior court and prior to the ruling of this court."
 In our opinion the demurrers in the instant case were properly sustained.
 Judgment affirmed.
 White, P. J., and Doran, J., concurred.
