
258 N.W.2d 306 (1977)
Fred BLANTON, Appellant,
v.
Ronald BARRICK, Individually and in his capacity as County Attorney of Clay County, and Dick Clemens, in his Capacity as Sheriff of Polk County, Appellee.
No. 58790.
Supreme Court of Iowa.
October 19, 1977.
*307 Alfredo G. Parrish and Linda Del Gallo, Des Moines, for appellant.
Clyde Putnam, Jr., Des Moines, and Francis Fitzgibbons, Estherville, for appellee Barrick.
Heard by MOORE, C. J., and MASON, LeGRAND, UHLENHOPP and REYNOLDSON, JJ.
MOORE, Chief Justice.
The issue here presented is whether defendant part-time county attorney, who was representing plaintiff's wife in a dissolution of marriage proceeding and later initiated a criminal prosecution against plaintiff charging him with child stealing thereby causing him to be arrested and incarcerated for two days, is amenable to an action for malicious prosecution. Trial court held the doctrine of judicial immunity applied to protect defendant and sustained his summary judgment motion. We agree and therefore affirm on plaintiff's appeal.
The facts giving rise to this action as alleged in the pleadings and developed through discovery are as follows. Defendant, Ronald Barrick, is an attorney engaged in the private practice of law in Spencer and at all times pertinent to this litigation was the Clay County Attorney.
In the course of his private practice he represented Sheila Blanton (plaintiff's wife) as petitioner in a dissolution of marriage proceeding which was commenced in August 1974. During pendency of the dissolution a restraining order was served on plaintiff Fred Blanton to prevent him from harassing Sheila and the couple's minor child, Shannon.
On January 10, 1975, before the dissolution was finalized, the plaintiff, with agreement of all parties and counsel, picked up Shannon in Spencer for visitation with the clear understanding he would return the child to his estranged wife by 5:00 P. M. that afternoon. He did not return the child as agreed but telephoned and stated because of the severe winter weather condition he was not sure he could honor the agreement. This was the last anyone heard from plaintiff for two days when he telephoned from Des Moines and advised his mother-in-law he was taking Shannon to Indiana.
At this point defendant, as attorney for Mrs. Blanton, obtained a court order directing plaintiff to relinquish custody of the child to a representative of the Polk County Social Services Department for return to his client in Spencer. Plaintiff was served with the order but refused to comply. Thereafter defendant obtained a second amended order and plaintiff was orally advised of its contents. Again he refused to comply although he later said, "I wasn't too sure of the legality of it."
On January 14, 1975, defendant, acting and signing as the Clay County Attorney, filed a preliminary information against plaintiff charging him with child stealing in violation of Code section 706.2. Plaintiff was arrested in Des Moines on January 15 *308 and incarcerated for two days in the Polk County jail when he was released on a writ of habeas corpus.
Defendant stated in his deposition he "certainly" viewed the situation as a conflict of interest but because there was neither an assistant county attorney nor a special prosecutor available to file the criminal action, it was his responsibility to do so. After filing the preliminary information, defendant withdrew as prosecutor and a special prosecutor was appointed by the Board of Supervisors to present the case to the grand jury. Ultimately the grand jury did not return an indictment.
Plaintiff then filed a petition alleging defendant was liable for malicious prosecution and demanded damages of $55,500. This action precipitated defendant's withdrawal from the domestic relations matter as well.
Defendant answered by way of general denial and raised as an affirmative defense that as county attorney he was immune from civil liability for acts committed in the performance of his official duties. The case then proceeded to discovery. After both plaintiff Blanton and defendant Barrick were deposed, defendant filed motion for summary judgment. Defendant Sheriff Dick Clemens had earlier been dismissed with prejudice from the action.
On October 1, 1975, the trial court filed its findings, conclusions and order granting defendant summary judgment. The court concluded even if defendant violated Code section 336.5, which forbids a county attorney from prosecuting cases wherein he has an interest in a civil case, this did not abrogate his immunity as a quasi-judicial officer.
I. Recently in Unification Church v. Clay Cent. Sch. Dist., Iowa, 253 N.W.2d 579, we analyzed our earlier cases and summarized the scope of our review in determining whether summary judgment was properly entered. Repetition is unnecessary as the applicable well-settled principles are not here challenged.
II. This case marks our first opportunity to squarely address the civil liability of a county attorney. However, we do so guided by established principles in this jurisdiction and recent developments elsewhere.
We start our analysis with recognition that prosecutors, as quasi-judicial officers, State v. Hospers, 147 Iowa 712, 126 N.W. 818, are generally cloaked with the same immunity afforded judges when their duties are primarily judicialthe filing and vigorous prosecution of criminal charges. Wilhelm v. Turner, 8th Cir., 431 F.2d 177, 182, and citations, cert. denied, 401 U.S. 947, 91 S.Ct. 919, 28 L.Ed.2d 230.
The general rule is thus stated in 63 Am.Jur.2d, Prosecuting Attorneys, section 34 at page 361:
"The prosecuting attorney is, as a matter of public policy, immune from civil liability for acts done in his official capacity, and this is true even though he has acted wilfully or maliciously, where he has acted in the proper performance and course of his duties. Acting as he does in a judicial or quasi-judicial capacity, he enjoys the same immunity from liability for damages that protects a judge. However, since immunity is conferred on the prosecuting attorney solely by virtue of the office he holds, the rule is different if he acts in a matter clearly outside the authority or jurisdiction of his office. * * *."
Few doctrines have been more settled than the absolute immunity of judges from damages for acts committed within their judicial jurisdiction. This immunity applies even when the judge is accused of acting maliciously and corruptly because as a matter of policy it is in the public best interest that judges should exercise their function without fear of consequences and with independence. Pierson v. Ray, 386 U.S. 547, 87 S.Ct. 1213, 18 L.Ed.2d 288; Bradley v. Fisher, 13 Wall. 335, 20 L.Ed. 646.
In two opinions we have, after an extensive review of applicable authorities, held the doctrine of judicial immunity is available even though a judge exceeds his jurisdiction; civil liability attaches only when he *309 acts wholly without jurisdiction. Osbekoff v. Mallory, Iowa, 188 N.W.2d 294, 299, 300; Huendling v. Jensen, Iowa, 168 N.W.2d 745, 749, 750. In other words, so long as the judge is acting within the scope of his authority, his acts are absolutely privileged.
Plaintiff recognizes these general principles but argues they should not bar his malicious prosecution action here for two reasons. First, he contends absolute judicial immunity should not apply to prosecutors in this jurisdiction relying on the case of Vander Linden v. Crews, Iowa, 205 N.W.2d 686, where we refused to extend the doctrine to non-judicial officers. Second, he contends that even if absolute immunity is the general rule, clearly when a part-time county attorney brings criminal charges where the facts are intertwined with civil matters he is embroiled in as a private practitioner in violation of Code section 336.5, he is acting wholly without jurisdiction and is thus amenable to civil suit for malicious prosecution.
Defendant's first contention requires some discussion of Vander Linden v. Crews, supra. There plaintiff as proprietor of a pharmacy filed a malicious prosecution action against defendant secretary of the Iowa Board of Pharmacy arising out of a rather bizarre factual situation. Crews, who was also designated Director of Drug Law Enforcement, caused plaintiff to be arrested without a warrant and taken before a justice of the peace where Crews filed a preliminary information charging plaintiff with illegal sale of drugs. Plaintiff was later indicted and tried to a jury which returned a verdict of acquittal. Thereafter the malicious prosecution action was commenced. The trial court sustained a summary judgment motion holding Crews was immune under the judicial immunity doctrine. We reversed, holding:
"In summary, we conclude that the doctrine of judicial immunity shall not be further extended to protect and shield nonjudicial officers from civil suits where actual malice is alleged. * * *." (Emphasis supplied). 205 N.W.2d at 691.
We still adhere to the rationale of Vander Linden v. Crews, supra, and refuse to extend the judicial immunity doctrine to all sorts of "minor functionaries." However, this case is not controlling here. Clearly, as previously stated, prosecutors performing their official duties are quasi-judicial officials, not non-judicial functionaries and should be able to vigorously proceed with their tasks unhampered by the fear of unlimited civil litigation.
Recently the United States Supreme Court has exhaustively detailed the policies behind adhering to the need for a rule of absolute prosecutorial immunity where the prosecutor's activities are "intimately associated with the judicial phase of the criminal process." Imbler v. Pachtman, 424 U.S. 409, 96 S.Ct. 984, 47 L.Ed.2d 128 (1976). In Imbler, a convicted murderer who ultimately obtained his release from state prison through federal habeas corpus, filed a civil rights action under 42 U.S.C. section 1983 seeking damages for loss of liberty by alleged unlawful prosecution and malicious prosecutorial misconduct. The Supreme Court affirmed the Court of Appeals for the Ninth Circuit which had dismissed the cause holding a state prosecutor who acted within the scope of his duties in initiating and pursuing a criminal prosecution is absolutely immune from civil suit for damages under 42 U.S.C. section 1983. The court reasoned the same considerations which underpinned the common law rule of absolute immunity of a prosecutor from a suit for malicious prosecution were controlling. Justice Powell, writing for the court, explained the rationale for the decision as follows at pages 422, 423 of 424 U.S., at pages 991, 992 of 96 S.Ct., at pages 139, 140 of 47 L.Ed.2d:
"The common-law immunity of a prosecutor is based upon the same considerations that underlie the common-law immunities of judges and grand jurors acting within the scope of their duties. These include concern that harassment by unfounded litigation would cause a deflection of the prosecutor's energies from his public duties, and the possibility that he would shade his decisions instead of *310 exercising the independence of judgment required by his public trust. One court expressed both considerations as follows:
"`The office of public prosecutor is one which must be administered with courage and independence. Yet how can this be if the prosecutor is made subject to suit by those whom he accuses and fails to convict? To allow this would open the way for unlimited harassment and embarrassment of the most conscientious officials by those who would profit thereby. There would be involved in every case the possible consequences of a failure to obtain a conviction. There would always be a question of possible civil action in case the prosecutor saw fit to move dismissal of the case. . . . The apprehension of such consequences would tend toward great uneasiness and toward weakening the fearless and impartial policy which should characterize the administration of this office. The work of the prosecutor would thus be impeded and we would have moved away from the desired objective of stricter and fairer law enforcement.' Pearson v. Reed, 6 Cal.App.2d 277, 287, 44 P.2d 592, 597 (1935)."
Since Imbler numerous jurisdictions have adhered to its ruling and held a prosecutor is absolutely immune where his acts are within the scope of prosecutorial duties, particularly "initiating a prosecution." See Helstoski v. Goldstein, 3rd Cir., 552 F.2d 564; Palermo v. Warden, Green Haven State Prison 2nd Cir., 545 F.2d 286; Walker v. Cahalan, 6th Cir., 542 F.2d 681; Hilliard v. Williams, 6th Cir., 540 F.2d 220; Bruce v. Wade, 5th Cir., 537 F.2d 850; Brawer v. Horowitz, 3rd Cir., 535 F.2d 830; Flood v. Harrington, 9th Cir., 532 F.2d 1248. See also Sampson v. Rumsey, 1 Kan.App.2d 191, 563 P.2d 506; Loveridge v. Schillberg, 17 Wash.App. 96, 561 P.2d 1107; State, etc. v. Dist. Ct. 8th Judicial Dist., Mont., 560 P.2d 1328; Powell v. Seay, Okl., 553 P.2d 161; Schroeck v. Pennsylvania State Police, 26 Pa.Cmwlth. 41, 362 A.2d 486.
The following is set out in Restatement, Torts 2nd, section 656 at pages 414, 415:
"A public prosecutor acting in his official capacity is absolutely privileged to initiate, institute, or continue criminal proceedings.
"Comment:
"a. Public prosecutor defined. The term `public prosecutor' is used to describe an official whose duty it is to prosecute on behalf of the government criminal proceedings initiated by him or by other public officials or by a private person. Such an official is variously described in different parts of the United States as `district attorney,' `prosecuting attorney,' `state's attorney,' `county attorney,' `public commissioner' and by other terms. The important thing is not the name by which he is called but the function that he exercises.
"b. Absolute character of privilege. The privilege stated in this Section is absolute. It protects the public prosecutor against inquiry into his motives, and from liability, even though he knows that he has no probable cause for the institution of the proceedings and initiates them for an altogether improper purpose.
"c. Policy of the law. The absolute privilege of the public prosecutor under the rule stated in this Section is based upon the same policy of law that gives immunity from liability to a public prosecutor who, in the course of a criminal prosecution, publishes defamatory matter about the accused or third persons, on which see § 586, Comment b.

"d. Persons protected. The rule stated in this Section gives immunity from liability only to those who are public prosecutors within the meaning of that term as explained in Comment a. It does not apply to all persons whose function it is to aid in the enforcement of the criminal law. Thus it does not give immunity to a peace officer who swears out a warrant against another in the mistaken belief that his conduct is such as to make him guilty of the offense charged against him."
See also Harper and James, The Law of Torts, Vol. 1, section 4.3 at page 305.
*311 Faced with the general rule of absolute immunity for prosecutors, plaintiff takes the position that here defendant county attorney acted wholly outside the jurisdiction of his office by violating the provisions of Code section 336.5 and thus the shield of immunity is not available to him.
Section 336.5 provides:
"336.5 County attorneyprohibitionsdisqualified assistants
No county attorney shall accept any fee or reward from or on behalf of anyone for services rendered in any prosecution or the conduct of any official business, nor shall he, or any member of a firm with which he may be connected, be directly or indirectly engaged as an attorney or otherwise for any party other than the state or county in any action or proceeding pending or arising in his county, based upon substantially the same facts upon which a prosecution or proceeding has been commenced or prosecuted by him in the name of the county or state; nor shall any attorney be allowed to assist the county attorney in any criminal action, where such attorney is interested in any civil action brought or to be commenced, in which a recovery is or may be asked upon the matters and things involved in such criminal prosecution."
We note there are potential problems inherent in our state system which provides for part-time prosecutors. This is why the American Bar Association Standards, The Prosecution Function, section 2.3, so strongly advocate establishment of full-time prosecutors.
Undeniably there are clearly circumstances in which the participation of a county attorney in a criminal trial as prosecutor would be improper. Certainly it would be improper to prosecute a case where "by personal relations with an accused, he has acquired knowledge of facts on which the prosecution is based or which are closely interwoven therewith." State v. Orozco, Iowa, 202 N.W.2d 344, 345, 346 and citations.
Furthermore, generally it is axiomatic a prosecutor should never try a defendant with whom he is embroiled in civil litigation. People v. Superior Ct. of Contra Costa Cty., 19 Cal.3d 255, 137 Cal.Rptr. 476, 561 P.2d 1164, 1168; People v. Jiminez, 187 Colo. 97, 102, 528 P.2d 913, 916; Sinclair v. State, 278 Md. 243, 363 A.2d 468, 474. The aforementioned ABA Standards, The Prosecution Function, state the principle as follows:
"1.2 Conflicts of Interest
(a) A prosecutor should avoid the appearance or reality of a conflict of interest with respect to his official duties."
Of course, there are serious ethical concerns inherent in this type of situation. Code of Professional Responsibility, DR7-105(A):
"A lawyer shall not present, participate in presenting, or threaten to present, criminal charges solely to obtain advantage in a civil matter."
A prosecutor is still clearly thus amenable for unethical conduct. Imbler v. Pachtman, supra, 424 U.S. at 428-429, 96 S.Ct. at 994, 47 L.Ed.2d at 143; Complaint of Rook, 276 Or. 695, 556 P.2d 1351.
Although, as stated, there are many serious consequences which flow from a violation of this statute we do not believe one of them should be an abrogation of immunity. To hold a prosecutor in response to what he considers an emergency situation cannot file a preliminary information in fulfillment of his obligations to enforce the law because of fear of civil retaliation if the charges are ultimately dismissed clearly is inconsistent with all that Imbler v. Pachtman, supra, stands for. Defendant in initiating the prosecution was performing the quasi-judicial function to which the absolute judicial immunity has been engrafted to protect.
As we discussed in Huendling v. Jensen, Iowa, 168 N.W.2d 745, where the judicial officer is acting within the sphere of his jurisdiction, even though perhaps exceeding it (here violation of this statute, section 336.5) he is still immune from civil suit. That is not to say this court approves of the *312 procedure used here but only to underline the important policy that judicial officers shall not operate under the threat of a civil action questioning the motives for their charging decisions.
In an earlier decision we have held that even though section 336.5 is violated, if prior to commencement of the trial the conflict of interest is resolved, then there is no need to reverse a subsequent conviction. State v. Weiland, Iowa, 202 N.W.2d 67. Here defendant filed the preliminary information and had defendant arrested but requested that the Board of Supervisors appoint a special prosecutor to present the case to the grand jury.
We find no error in trial court's entry of summary judgment for defendant.
AFFIRMED.
