
16 Cal.2d 436 (1940)
TOM KYNE, Jr., a Minor, etc., Appellant,
v.
TOM KYNE, Defendant; R. M. WILSON et al., Respondents.
S. F. No. 16402. 
Supreme Court of California. In Bank.  
October 28, 1940.
 Allen Spivock, Philander B. Beadle and Samuel Hauser for Appellant.
 John G. Taheny for Respondents.
 SHENK, J.
 Tom Kyne, Jr., aged three years, recovered a money judgment against defendant Tom Kyne in the sum of $7,702.87 in an action to establish paternity and for support. On November 10, 1938, execution was levied upon coins and currency to the amount of $10,000 in the possession of said defendant. The sheriff retained sufficient of this money to satisfy the plaintiff's claim. R. M. Wilson, Julius Wild and Earl Eby filed third party claims to said money totaling $7,695. The plaintiff filed a petition for a hearing to determine title to the property levied upon. After hearing, the court entered judgment for the third party claimants. The plaintiff appealed from the judgment. The third party claimants will be referred to as the respondents.
 The claims of the respondents arose out of the following facts: The defendant was and had been for many years a self-styled "betting commissioner". He maintained a place of business for the purpose of accepting wagers on the happening of events. He accepted bets made, received the stakes risked, and issued receipts stating the terms of the wagers. His method was, if possible, to cover wagers by making offsetting wagering agreements with other bettors. His remuneration was a commission of five per cent charged on all deposits or stakes.
 On November 8, 1938, a general election was held in California. On or prior to that date each of the respondents had made certain wagers with the defendant as to the outcome of the voting for gubernatorial and senatorial candidates. The vote cast for such candidates determined that Wild, who had staked $1,500, won $1,500. He claimed $3,000 of the money taken under execution levy by the sheriff. Eby staked $790 and won $790, making his claim $1,580. Wilson staked $1,650 and won $1,465, a total of $3,115. *438
 On November 10, 1938, the defendant Kyne took a valise containing $10,000 in coins and currency to his place of business. This purportedly comprised all the moneys wagered by various bettors on the outcome of the election and was to be used to pay the winners after deducting the 5 per cent commission. The sheriff under the levy took $7,702.87 of this money. The balance was sufficient for and was used by the defendant to pay off other winners, but without retaining any commissions. The only persons placing bets on said election with the defendant who were not paid their winnings were the respondents herein. The court adjudged that $500 of said sum of $7,702.87, representing 5 per cent on the total deposits of $10,000, belonged to the defendant Tom Kyne, and that each of the respondents was entitled to the total amount of his claim, namely, his stake and his winnings, less a proportionate amount of the $500 commission.
 The appeal presents the question whether, in the proceeding to determine title, they whose claims of title rested upon the successful outcome of an unlawful wagering agreement may recover the amount wagered and the winnings, or either of them, from the sheriff who has seized the stakes and the winnings from the stakeholder on behalf of a judgment creditor of the person with whom the unlawful wager was made. The record shows and the question assumes that the defendant from whom the money was seized was both the stakeholder and the other betting party to the unlawful agreement.
 [1] The general rule is that the courts will not recognize such an illegal contract and will not aid the parties thereto, but will leave them where it finds them. This rule has been rigidly enforced in this state to deny any relief in the courts to parties seeking to recover either their stakes or their winnings under a wagering contract which is in violation of law, whether the party against whom the relief was sought was a party to the wager or a stakeholder for the parties to the wager. (Johnston v. Russell, 37 Cal. 670; Gridley v. Dorn, 57 Cal. 78 [40 Am. Rep. 110]; Schenck v. Hirshfeld, 22 Cal.App. 709 [136 P. 725]; Matthews v. Lopus, 24 Cal.App. 63 [140 P. 306]; 6 Cal.Jur., p. 150; see, also, 13 Cor. Jur., p. 492; 17 Cor. Jur. Secundum, p. 656, and cases cited.)
 The wagering agreements here involved were illegal contracts to which the rule will apply. (Pen. Code, secs. 337a, *439 659; sec. 11504, Elections Code, formerly sec. 60, Pen. Code.) The respondents do not dispute the rule nor the illegality of the wagering agreements. They contend that the rule is inapplicable, when a third party steps in and the recovery is sought against such third party; that the judgment is supported by the application of the exception to the rule, namely, that a third person, not a party to the illegal contract, may not invoke the defense of illegality, and that the plaintiff or the sheriff was a third party as to whom the defense was properly denied by the trial court. The plaintiff relies on the well-settled extension of the general rule to cases where the party seeking relief must rely upon the illegal contract even though his alleged rights are sought as against a third party.
 The respondents assert that it was not necessary, in order to prove their title to the money, to place any reliance upon the wagering agreements; that it was necessary to show only that they deposited certain money with the defendant to be applied for their account, and that the defendant conceded that he held the money for their account. [2] The controversy, however, is not between the defendant and the respondents as claimants, but is between the latter and the plaintiff. The authorities stating the general rule observe that the defense of illegality is open to the parties to the contract and to those claiming under them. (See 13 Cor. Jur., p. 508, sec. 458.)
 In the present contest the plaintiff, a judgment creditor of the defendant, stands in the defendant's shoes, is a person claiming under the defendant, and therefore may resist the claims of the respondents to the money possessed by the defendant on any ground of illegality that the defendant might have urged. The defendant, under the general rule adopted in this state, could have urged illegality of the contracts here involved. None of the cases relied upon by the respondents is controlling. They are cases (see Catts v. Phalen, 43 U.S. 376 [11 L.Ed. 306]; Kearney v. Webb, 278 Ill. 17 [115 N.E. 844, 3 A.L.R. 1631]; Re Brown, 147 Kan. 395 [76 PaCal.2d 857, 116 A.L.R. 1012]; Matta v. Katsoulas, 192 Wis. 212 [212 N.W. 261, 50 A.L.R. 291, and cases cited in note, p. 293 et seq]. See, also, 27 Cor. Jur., p. 1079, sec. 343), which involve acts of fraud perpetrated by an agent or fiduciary as to which he will be held accountable, *440 or the deposit of moneys with an agent to be used for gambling purposes but which were not so used, or the deposit of property won by one party to an illegal contract with a third person for delivery to the other party to the illegal contract. For example, a bank will not be permitted to invoke the illegality of a contract between two individuals and thereby retain money which was the fruit of the illegal transaction and which was deposited by one of them for the account of the other. (Roselle v. Beckemeir, 134 Mo. 380 [35 S.W. 1132].) The present is not such a case. [3] Neither the plaintiff nor the defendant was a bailee within the meaning of the exception and the authorities relied upon by the respondents. The defendant, either as a bettor or a stakeholder, was a party to the illegal contracts, and as such was in no different position from the respondents. That is, the court will not lend its aid to extricate him or the respondents from the position in which they find themselves, but will leave both parties where it finds them.
 The respondents quote section 524 of the Restatement of the Law of Contracts, as follows: "Where money is deposited with a stakeholder by parties to a wager, either party can recover the money deposited by him even after the happening of the condition upon which it was agreed that the money should be paid to the other party. Under no circumstances can either party recover more from the stakeholder; and the stakeholder is discharged from all duty if he pays the winner of a wager before receiving notice of repudiation thereof by the loser." The "pocket supplement" to the Restatement containing the California annotations shows by citation of the decisions hereinabove referred to that that statement is not the rule adopted in this state. Furthermore, the statement is confined to facts different from the facts here shown, inasmuch as the defendant was both a stakeholder and a party to the wagering agreements.
 [4] In the proceeding before the trial court the burden was upon the respondents, third party claimants, to prove that their claims to the money were superior to the defendant's claim. (Sec. 689, Code Civ. Proc.) This they could not do without reliance upon the wagering agreements. That being the case, the respondents were not entitled to prevail and the court was required to leave the parties where it found them. (Berka v. Woodward, 125 Cal. 119, 127 [57 *441 P. 777, 73 Am.St.Rep. 31, 45 L.R.A. 420]; Butler v. Agnew, 9 Cal.App. 327, 332 [99 P. 395].)
 The foregoing considerations dispose of all the contentions on the appeal. The judgment is reversed with directions to the trial court to enter judgment denying any relief to the third party claimants.
 Edmonds, J., Carter, J., Moore, J., pro tem., York, J., pro tem., Curtis, J., and Gibson, C.J., concurred.
