McCARTY, J.,
after the foregoing statement of the case, delivered the opinion of the court.
Appellant contends that the wagering on the rise and fall of stocks was not between plaintiff and defendants, as found by the court, but that the undisputed evi-*414deuce 1 shows exclusively that the illegal transactions pleaded as a defense were between plaintiff and Wendt & Co. We think appellant is right in his contention, and that the court erred in its findings on this point. The record shows that defendants received $2,060 from plaintiff as a marginal protection to Wendt & Co., who “took the buying side of the deal,” which deal was brought about, carried on, and finally consummated by plaintiff and Wendt & Co., through defendants, who acted as the agents of both parties. The defendants put up no money and took no chances pecuni-arily in the transaction. After the deal was closed, and Wendt & Co. had paid defendants the difference in the price of the stock represented in the transaction, and defendants had deducted the dividends and their commissions due them for their services, there was found to be due plaintiff the sum of $3,080.35, of which amount, plaintiff received from defendants $1,740', leaving a balance in their hands of $1,340.35 of his money. Therefore the important question involved in this case is, can defendants successfully plead as a defense the illegality of a deal between plaintiff and Wendt & Co., and which transaction has been closed, and the money paid over to defendants, who hold it merely as a depositary for plaintiff?
It is a well-settled rule that courts will not lend their aid, and enforce contracts which are illegal, or the 2 performance of which is against public policy. It is admitted that the contract for the sale of the stock by plaintiff, and the purchase of the same by Wendt & Co., was a wagering or gambling contract, and therefore illegal and void; but, as we have already observed, the transactions growing out of that contract were closed, and the money in question paid by Wendt & Co. to defendants, and was by them credited on their books to plaintiff, less their commissions. This action was not commenced to enforce the contract pleaded as a defense, but to recover money which is held on deposit by defendants for plaintiff, and to which they do not as*415sert any title; defendants’ sole defense being that, because a portion of tbe money in question was obtained from Wendt & Co. through a wagering contract which was illegal and against public policy, plaintiff ought not to be permitted to recover, and that they be permitted to retain that which they confess belongs to plaintiff. That is, they have pleaded an illegal contract which the evidence shows was entered into between plaintiff and. 3 Wendt & Co., to which defendants were not parties, except as agents, as hereinbefore stated, of the principal actors, to defeat a recovery for money which had been paid to them for plaintiff. When this money was paid to defendants for the plaintiff, the illegal contract pleaded by défendants was closed — had terminated — and a new obligation created, by which defendants became indebted to plaintiff, and their liability to pay plaintiff this money in no way depended upon the legality of the contract between plaintiff and Wendt & Co. The authorities almost uniformily hold that when an illegal contract has been fully executed, and the interest and differences of the parties to it adjusted and agreed upon, and the money arising therefrom deposited to the credit of one or more of the respective parties, such depositary cannot, when sued by the party or parties to whom the money is due, successfully plead the illegality of the contract or transaction through which the money was originally obtained. This doctrine is clearly stated in the case of Planters’ Bank v. Union Bank, 16 Wall. 483, 21 L. Ed. 473, as follows: “When an illegal transaction has been consummated; when no court has been called upon to give aid to it; when the proceeds of the sale have actually been received, and received in that which the law recognizes as having had value; and when this has been carried to the credit of the plaintiff — the case is different. The court is not there asked to enforce an illegal contract. The plaintiffs did not require the aid of any illegal transaction to establish their cause. It is enough that defendants have in their hands a thing of value that belongs *416to them.” In Brooks v. Martin, 2 Wall. 70, 17 L. Ed. 732, which was a case where a partnership, in violation of a United States statute, had been engaged in buying up soldiers’ land claims before the warrants for such claims were issued, it was held that, after the contract which was confessedly against public policy had been carried out, a partner in whose hands the profits were, could not refuse to divide them on the ground of the illegal character of the original contract. The court, in the course of the opinion says: “Does it lie in the mouth of the partner who has by fraudulent means obtained possession and control of all these funds to refuse to do equity to his other partner because of the wrong originally done or intended to the soldier? It is difficult to perceive how the statute enacted for the benefit of the soldier is to be rendered any more effective by leaving all this in the hands of Brooks, instead of requiring him to execute justice as between himself and his partner, of what rule of public morals will be weakened by compelling him to do so? The transactions which were illegal have become accomplished facts, and cannot be effected by any action of the court in this case.” The same question was before the Supreme Court of Washington in the case of McDonald v. Lund, 43 Pac. 348, and that court, in a well-considered opinion, in which many of the leading cases on this question were cited and reviewed, held that where parties had been engaged as a partnership in carrying on games of chance, and the business had been closed and a division of the profits agreed upon, and the plaintiff’s portion amounted to $431.25, the money being held by defendant, he (the defendant) could not, in a suit by the plaintiff to recover this amount, set up the illegal character of the business carried on under the original contract of partnership. The court said: “Again, this is not a case to enforce any illegal contract, but it is to assert title to money which was accumulated under such illegal contract. If the plaintiff here had brought an action against the. defendant for not complying with this contract in running these games, of course, it would fall within the rule *417claimed by the respondent; but here the real contract upon which he snes, it seems to ns, is a contract of deposit. Under the stipulated facts, the illegal transaction which these parties had agreed to pursue had ended . . . A determination of the amount of money due from the defendant to the plaintiff had been reached. It was agreed that the defendant owed the plaintiff the sum of money sued for, and that he was entitled to that amounts and the plaintiff’s portion was simply left with the defendant on deposit. . . . This distinction, viz., the difference between suing on or trying to enforce the illegal contract itself, and a suit to recover money which is admitted to be due, although it may have been obtained by prosecuting an illegal enterprise, has always been respected by the courts, from its announcement in the cases we have above cited up to the present time.” In the case of Floyd v. Patterson, 72 Tex. 202, 10 S. W. 526, 13 Am. St. Rep. 787, the court says: “When the plaintiff shows that the defendant has received of a third party money for his use, the law from the naked fact implying a promise, the case is made out, without going into illegal transaction, and the defendant will not be permitted to set up the illegality of the original contract in order to defeat a recovery. ” In 9 Cyc. 557, this doctrine is stated in the text with approval, as follows : “It results from this doctrine that, if money has been actually paid to an agent or to a partner, the illegality of the transaction of which the money was the fruit, or the fact that the firm -venture from which the profits have arisen was an illegal one, does not affect the right of the principal or partner to recover the money from the agent or copartner in whose hands it is. The ground taken is that, although the law would not have assisted the principal or partnership by enforcing the recovery of it from the party by whom it was paid, because the law will not aid the completion of an illegal contract, yet, when that contract is at an end, the agent or partner whose liability arises solely from having re*418ceived the money for another’s nse can have no right to claim it. . . . If one of the parties to an illegal and unenforceable contract, who has received profits under it, admits that a specified sum is due to the other party, it'has been held that the latter may maintain an action upon an account stated between them, or, if he has made a special promise to pay him, the action may be brought on that promise. ’ ’ The following cases uphold and declare this same doctrine: Peters v. Grim (Pa.), 24 Atl. 192, 34 Am. St. Rep. 599; Munns v. Donavan Com. Co. (Iowa), 91 N. W. 789; Farmer v. Russell, 1 B. & P. 296; Petrie v. Hannay, 3 Term, 418, 419; W. U. Telegraph Co. v. U. P. R. Co. (C. C.), 3 Fed. 423; Manchester R. Co. v. R. Co., 66 N. H. 132, 20 Atl. 383, 9 L. R. A. 689, 49 Am. St. Rep. 582; Buchanan v. Bank, 55 Fed. 226, 5 C. C. A. 83; Hatch v. Hanson, 46 Mo. App. 334; DeLeon v. Trevino, 49 Tex. 89, 30 Am. Rep. 101; Pfeuffer v. Maltby, 54 Tex. 454, 38 Am. Rep. 631; Gilliam v. Brown, 43 Miss. 641; Elder v. Talcott, 43 Ill. App. 439; Repplier v. Jacobs, 149 Pa. 167, 24 Atl. 194; Clark v. Brown, 77 Ga. 606, 4 Am. St. Rep. 98; McNaughton v. Haldeman, 160 Pa. 144, 28 Atl. 647.
We are of the opinion that the facts in this case, when applied to the foregoing principles of law, clearly establish plaintiff’s right to recover, and that the court erred in finding the issues in favor of defendants and dismissing the action.
The judgment is reversed, with directions to the trial court to proceed in accordance with the views herein expressed. Costs to be taxed against respondents.
BARTCH, C. J., and STRAUP, J., concur.