If we should disregard the contracts set forth in the answers, it is clear that the plaintiff, upon proof of his allegations, would be entitled to judgment for the fees earned by him as justice of the peace under the provisions of the statutes which were in force at the times when the respective fees were earned. The affirmative answers of the defendants rest solely upon the special contract. The question for decision relates, therefore, to the sufficiency of the affirmative defenses assuming, in view of plaintiff's demurrer, that the special contract as alleged was made and that under its provisions, if *Page 444 valid, no fees were due or owing to the plaintiff at the time of filing the complaint.
We shall first inquire concerning the validity of the special contract upon which the defendants rely. In the statute which was in force during the entire period of this controversy, it is provided as follows:
"Justices of the Peace * * * shall collect in advance, except in criminal cases, from all litigants the fees now allowed by law." O.C.L.A. § 27-212.
Under this statute, it is not only a right, but a duty of the justice of the peace in all civil cases to collect the statutory fees in advance.
A bargain of one who holds public office, the emoluments of which are fixed by law, whereby he agrees to take less than legal compensation, is contrary to public policy and void. SchoolDistrict No. 1 v. Teacher's Retirement Fund, 163 Or. 103,95 P.2d 720, 96 P.2d 419, 125 A.L.R. 720; DeBoest v. Gambell,35 Or. 368, 58 P. 72.
"A bargain for either increasing or diminishing compensation fixed by law for a public official is illegal." 2 Restatement, Contracts, § 565, p. 1070; 6 Williston, Contracts, § 1730, p. 4886; 70 A.L.R. 793.
If the statutory emoluments of non-judicial public officers cannot be validly reduced by agreement, a fortiori the same rule should be applied to judicial officers.
*Page 445"A, a commissioner entitled by law to certain fees, bargains with B, a party to a hearing before A, not to charge fees unless costs are recovered by B. The bargain is illegal, and though costs are not recovered by B, A can recover his legal fees." 2 Restatement, Contracts, § 565, p. 1071, illus. 4; Watson v. Fales, 97 Me. 366, 54 A. 853.
2, 3. "Conduct of Judiciary. With respect to agreements that involve considerations which may affect the impartiality of a magistrate, public policy requires that they shall be declared void, and they are equally futile as the basis of an action or of a defense. The law applies the general principle to all agreements which embody this potential danger to the public interests. No agreement is valid which makes the payment of fees to a judicial officer in any way dependent on his decision between the parties. Accordingly, an agreement that a judicial officer shall receive no compensation for his services unless the party is successful or until he collects from his adversary is against public policy and void. * * *" 12 Am.Jur. § 187, p. 689. And see Pitsch v. Continental and C. Nat. Bank, 305 Ill. 265, 137 N.E. 198, 25 A.L.R. 164.
Contracts which make the compensation of a judicial officer dependent upon the outcome of the case to be decided by him, tend to pollute the fountain of justice at its source. To recognize such an agreement as valid would, in effect, permit a judge to become an interested party in cases tried by him. Under the agreement set forth in the answers of the defendants, the compensation of the justice would have depended, in part at least, upon the rendition by him of orders and judgments favorable to the plaintiff.
Performance of such a contract would trench upon, if it did not actually invade, the constitutional right to a fair and impartial trial on the part of persons against whom suits might be brought in the justice court. The decision of the United States Supreme Court in Tumey v. Ohio, 273, U.S. 510, 71 L. Ed. 749,47 S. Ct. 437, 50 A.L.R. 1243, while not directly in point, is highly persuasive. In that case, pursuant to statute and ordinance, jurisdiction was vested in the mayor of a city *Page 446 to try criminal prosecutions for the violation of the liquor law. Upon conviction of a defendant, the mayor, as judge, might be entitled to costs in the amount of $12. The only source from which the fees of the mayor could be derived was the fine imposed upon the defendant in the event of his conviction. The Supreme Court by Chief Justice Taft reviewed the authorities, English and American, from Bonham's case, 8 Coke 118A, 77 Eng. reprint, down to modern times. It was held that a person convicted under the foregoing provisions was denied due process of law under the Fourteenth Amendment. And see 12 Am.Jur. § 635, p. 326. We hold that the special contract set forth in the affirmative answers was against public policy and void.
Our next inquiry is whether the plaintiff is barred from recovery in this action by reason of the illegal contract to which he was a party. Defendants in their brief assert that the plaintiff "under the pleadings in this case, is in no position to urge that any sum of money is owing to him by respondents, or either of them, under or pursuant to the contract pleaded in therespective answers * * *." (Italics ours.) It is the position of the plaintiff that he is not seeking to recover "under or pursuant to the contract pleaded in the respective answers." So far at least as his complaint is concerned, it is true that he relies solely upon his right to recover fees prescribed by statute. The complaint contains no reference to the special contract or to any part of it. Therefore, cases in which the plaintiff pleads a contract which is void as against public policy and seeks to recover thereon are not in point.
We recognize that plaintiff may sometimes be barred from recovery even though his pleading does not *Page 447 disclose any illegality, if the essential facts upon which he bases his case depend upon the illegal transaction. 2 Paige, Contracts, § 1103; Brown v. New Jersey Insurance Co., 140 Or. 547, 14 P.2d 272. But here the plaintiff need not prove or rely upon any portions of his illegal contract in order to support his statutory claim.
*Page 448"Even though the parties to an action have been engaged in a transaction either malum in se or prohibited by law, if the cause of action between them is disconnected from the illegal act and is founded upon a distinct and collateral consideration, and the plaintiff is not obliged to resort to the illegal agreement or transaction in order to maintain the suit, the illegality of the former transaction will not impair or bar the right to maintain the suit. If the contract or obligation does not depend upon, or require the enforcement of, the unexecuted provisions of the illegal agreement, it will be carried out. The test is whether the agreement sought to be enforced can be separated from the illegal acts or agreements relied upon as avoiding it and whether the plaintiff requires any aid from, or must in any way rely upon, the illegal transaction in order to establish his case. As to the ability of the plaintiff to make out his cause of action without referring to the illegal agreement, it may be stated that the plaintiff for such purpose cannot refer only to the legal portion of the agreement upon which he proposes to found his right of action, but that the whole of the agreement must be brought in. But an illegal agreement made by a plaintiff will not defeat him unless his cause of action is founded upon, or arises out of, such agreement. His right to recover upon a ground of action that exists independently of the agreement is not affected thereby. * * *" 12 Am.Jur. 719, § 211, Contracts.
Applying this broad doctrine, it is said by the editors of A.L.R.,
"The rule in most jurisdictions is that, a contract by a public officer to render services for a compensation less than that fixed by law being invalid, such officer may recover the legal salary or fees therefor." 70 A.L.R. 976, citing many cases.
The doctrine which denies recoveries to a plaintiff who is in pari delicto is subject to a well recognized exception.
"If refusal to enforce or to rescind an illegal bargain would produce a harmful effect on parties for whose protection the law making the bargain illegal exists, enforcement or rescission, whichever is appropriate, is allowed." 2 Restatement, Contracts, § 601, p. 1116.
"* * * In some instances, however, a sound public policy may demand either the enforcement of an executory illegal bargain, or the rescission of an executed one, when a denial of such relief by the courts would work a forfeiture disproportionate to the social interest supporting the public policy, or result in harm to those for whose protection such bargains are declared illegal." 6 Williston, Contracts, rev. ed. § 1762, p. 5002; and see id. at § 1787, p. 5081; 116 A.L.R. 1018, anno.
An apt illustration of the general principle is stated by Professor Williston as follows:
"* * * Thus, for the security of depositors and others, banks are prohibited from entering into certain kinds of loans or purchases. When a transaction of this sort has been entered into, however, should the corporation be refused a right of recovery the result would be the impairment of the assets of the bank — the very result which the law seeks to prevent, and, therefore, the bank is allowed to recover. * * *" 5 Williston, Contracts, rev. *Page 449 ed. § 1632, p. 4573; 116 A.L.R. 1018, anno.; Darnell-Love Lumber Co. v. Wiggs, 144 Tenn. 113, 230 S.W. 391.
We are not concerned alone with the plaintiff and defendants in this case. The public interest imperatively requires that all parties filing suit in courts of justice shall be treated with equal impartiality. To allow special pecuniary concessions to one plaintiff while denying it to the others, is to place the court on the level of an auctioneer. To make the compensation of the justice dependent upon the success of plaintiffs over defendants in a litigation, would place the court beneath that level.
There is another reason for recognizing the right of the plaintiff to recover his statutory fees notwithstanding his participation in an unlawful contract. Our statute provides that each justice of the peace shall make a monthly accounting of fees collected for the previous month, "and all fees in excess of $200 collected for the previous month shall be forwarded with said itemized statement * * * and said fees shall be credited to the general fund of the county." O.C.L.A. § 27-213.
We have no way of knowing the amount of fees at the statutory rate which may have been payable to the justice on account of litigation brought in his court by the defendants and by all other litigants, but we do know that the county has a contingent interest in the excess over $200 collected in any one month and that it is the duty of the justice to collect the fees and render monthly accounting to the end that the rights of the county may be protected. The special contract did not merely waive the private rights of the justice of the *Page 450 peace, it attempted ineffectually to waive rights of the public.
We have examined the cases of Bradfeldt v. Cooke, 27 Or. 194,40 P. 1, 50 Am. St. Rep. 701; Ah Doon v. Smith, 25 Or. 89,34 P. 1093; Moreland v. Devenney, 72 Kan. 471, 83 P. 1097; Peters v.City of Davenport, 104 Iowa 625, 74 N.W. 6; Ridgway v.Wetterhold, 96 Kan. 736, 153 P. 490, all cited in respondents' brief, and find them clearly distinguishable from the case at bar. In Willemin v. Bateson, 63 Mich. 309, 29 N.W. 734, decided in 1886, the court held that a contract similar to the one involved here was a "palpable violation of judicial duty" and void, but it also held that the plaintiff could not recover, the "whole transaction being covered by the same taint." In that case the county had no interest in the collection of the fees as is the case here, but in any event we decline to follow the Michigan decision.
The defendant relies strongly upon DeBoest v. Gambell, supra, and the similar case of Chandler v. City of Elgin, 129 Or. 558,278 P. 581. In the first mentioned case, DeBoest brought mandamus to compel the payment to him of the full amount of his legal salary. The defense was a special agreement to receive less than legal compensation. The court held the special contract void as against public policy. The answer alleged that the plaintiff had received and accepted the stipulated sum in full payment of all demands against the city. This allegation was admitted by the plaintiff's demurrer. The demurrer to the answer was sustained by the trial court and the question on appeal related to the sufficiency of the answer. The court held that where the salary had been earned, no principle of public policy is violated by his voluntary acceptance of an amount less than that provided by the statute. It appeared from the pleadings that the illegal transaction *Page 451 was fully executed, the plaintiff having accepted the stipulated payment each month in full settlement. The plaintiff was denied recovery.
Concerning this situation, we quote from 6 Williston on Contracts:
"* * * If the agreement is executed by the payment of the diminished emoluments, there are decisions holding that no further claim can be made. [citing DeBoest v. Gambell, supra] But the opposite view, also supported by authority, seems better. A debt has accrued which cannot be surrendered by parol without consideration." 6 Williston, Contracts, rev. ed. § 1730, p. 4887.
The essential distinction between the DeBoest case and the one at bar lies in the fact that the one relates merely to compensation of a fire chief and the other to the integrity and impartiality of a judicial officer. Furthermore, in the case at bar, the illegal contract was not fully executed. The account had not been closed. The defendants plead that no funds have been realized by the defendants in the cases listed in the complaint, but so far as the record shows, funds may yet be realized in the actions listed. Even under the terms of the special contract, if valid, plaintiff would be entitled to fees if and when the defendants as plaintiffs in collection cases should realize from the persons against whom suits have been brought.
Under these circumstances, the defendants cannot avail themselves of the equitable principle of estoppel by asserting that they filed cases in the plaintiff's court in reliance upon an illegal and executory contract. The case falls within the noted exception to the rule which bars recovery to plaintiffs who are in pari delicto. The testimony is not before us. Although the facts appear *Page 452 to be generally conceded, the pleadings which alone we have considered show general denials to some of the material allegations of the parties. We hold that the affirmative answers of the defendants failed to state any defense to the allegations of the complaint.
The judgment is reversed and the cause is remanded for a new trial.
Mr. Justice KELLY dissents. *Page 453