182. In no case can an action be maintained to enforce an illegal agreement.
183. Where an agreement has been executed in whole or in part by the payment of money or the transfer of other property, the court will not generally lend its aid to recover it back. The rule is that the court will not lend its aid to a party who, as the ground of his claim, must disclose an illegal transaction. This rule is subject to exceptions as follows, where the action is brought, not to enforce the agreement, but in disaffirmance of it:
(b) Where the parties are not in pari delicto, the one who is less guilty may recover what he has parted with, as
(1) Where the party asking relief was induced to enter into the agreement under the influence of fraud or strong pressure.
(2) Where the law which makes the agreement unlawful was intended for the protection of the party asking relief.
184. A broker, or other agent, employed to carry out an illegal transaction, cannot recover compensation, reimbursement, or indemnity in respect to the transaction, if he was privy to the principal's unlawful purpose.
185. No recovery may be had upon a quantum meruit or quantum valebant for benefits received under an illegal contract.
It is a well-settled rule that in no case will the court lend its aid to the enforcement of an illegal agreement. Further than this, if the agreement has been executed, in whole or in part, by the payment of money or transfer of property, the court will not, as a rule, entertain an action to recover it back.35 The rule is necessary on the ground of public policy. "The objection," said Lord Mansfield in a leading case, "that a contract is immoral or illegal, as between plaintiff and defendant, sounds at all times very ill in the mouth of the defendant. It is not for his sake, however, chat the objection is ever allowed, but it is founded in general principles of policy, which the defendant has the advantage of, contrary to the real justice as between him and the plaintiff; by accident, if I may so say. The principle of public policy is this: 'Ex dolo malo non oritur actio.' No court will lend its aid to a man who founds his cause of action upon an immoral or an illegal act. If, from the plaintiff's own stating or otherwise, the cause of action appears to arise ex turpi causa, or the transgression of a positive law of this country, there the court says he has no right to be assisted. It is upon that ground the court goes; not for the sake of the defendant, but because they will not lend their aid to such a plaintiff. So, if the plaintiff and defendant, were to change sides, and the defendant was to bring his action against the plaintiff, the latter would then have the advantage of it; for where both are equally in fault, 'potior est conditio defendentis.' " 39 As we have said, therefore, a party to an illegal agreement cannot, under any circumstances, come into a court of law or equity and ask to have his illegal objects carried out; nor, as a rule, can he ask the court to relieve him from the effect of his agreement. He cannot set up a case in which he must necessarily disclose an illegal purpose as the groundwork of his claim.37 This rule is expressed in the maxim, "In pari delicto potior est conditio defendentis;" that is to say, where the parties are equally in fault the condition of the defendant is the better. The law, in such a case, will leave the parties where it finds them.38
35 Harriman v. Northern Securities Co., 197 U. S. 244, 25 S. Ct. 493, 49 L. Ed. 739. See -Contracts," Dec. Dig. (Key-No.) § 138; Cent. Dig. §§ 6S1-700.
36 Holmart v. Johnson, 1 Cowp. 341. See, also. Frost v. Gage, 3 Allen (Mass.) 560; Shenk v. Phelps, 6 I11. App. 612; Jameson v. Carpenter, 68 N. H. 62, 36 Atl. 554; Winchester Electric Light Co. v. Veal, 145 Tnd. 506, 41 N. E. 334, 44 N. E. 353; Crichfleld v. Paving Co., 174 I11. 466, 51 N. E. 552, 42 L. R. A. 347; Todd v. Ferguson, 161 Mo. App. 624, 144 S. W. 158. See "Contracts;' Dec. Dig. (Key-No.) § 188; Cent. Dig. §§ 681-700.
37 Begbie v. Sewage Co., L. R. 10 Q. B. 499; Barclay v. Pearson  2 Ch. 154; Scott v. Brown  2 Q. B. 724; Frost v. Gage, 3 Allen (Mass.) 560; Emery v. Candle Co., 47 Ohio St 320, 24 N. E. 660, 21 Am. St. Rep. 819; Hill v. Freeman, 73 Ala. 200, 49 Am. Rep. 48; Haynes v. Rudd, 102 N. Y. 372, 7 N. E. 287, 55 Am. Rep. 815; Gotwalt v. Neal, 25 Md. 434; Roman v. Mali, 42 Md. 513; Bartle v. Coleman, 6 Wheat 475, 5 L. Ed. 309; Miller v. Marckle, 21 I11. 152; Myers v. Meinrath, 101 Mass. 366, 3 Am. Rep. 368; St. Louis, V. & T. H. R. Co. v. Railroad Co., 145 U. S. 393, 12 Sup. Ct. 953, 36 L. Ed. 748; Singer Mfg. Co. v. Draper, 103 Tenn. 262, 52 S. W. 879; Minzesheimer v. Doolittle, 60 N. J. Eq. 394, 45 Atl.I11 Where persons are engaged in an unlawful transaction, the court will not entertain a suit for an accounting in respect to the profits thereof. Jackson v. McLean (C. C.) 36 Fed. 213; McMullen v. Hoffman, 174 U. S. 639, 19 Sup. Ct 839, 43 L. Ed. 1117; Craft v. McConoughy, 79 I11. 346, 22 Am. Rep. 171; Morrison v. Bennett 20 Mont 560, 52 Pac. 553, 40 L. R. A. 158; Atwater v. Manville, 106 Wis. 64, 81 N. W. 985. But if money has been actually paid to an agent for the use of his principal, the legality of the transaction of which it was the fruit does not affect the right of the principal to recover it out of the agent's hands, on the ground that, though the law would not have assisted the principal by enforcing the recovery of it from the party by whom it was paid.
Where, however, the contract sought to be enforced has no direct correction with the illegal act, but is merely collateral to it, so that the plaintiff does not require the aid of the illegal act to establish his claim, he may recover.89
There are some exceptional cases as stated in the black-letter text, in which a man may be relieved from an illegal agreement. These will be treated more fully.