Although there is some difference of opinion on the subject, it is safe to say that in some cases of illegal agreements, at least, if they are not mala in se, but merely mala prohibita, a locus pœnitentiae remains, and that, while the illegal object has not been carried out by performance of the agreement, money paid or yet, when that contract is at an end, the agent, whose liability arises solely from having received the money for another's use, can have no right to retain it. Tenant v. Elliott, 1 Bos. & P. 3; Farmer v. Russell, Id. 295; Mc-Blair v. Gibbes, 17 How. 236, 15 L. Ed. 132; Brady v. Horvath, 167 I11. 610, 47 N. E. 757; Hertzler v. Geigley, 196 Pa. 419, 46 Atl. 366, 79 Am. St. Rep. 724; Hardy v. Jones, 63 Kan. 8, 64 Pac. 969, 88 Am. St Rep. 223. In Brooks v. Martin, 2 Wall. 70, 17 L. Ed. 732, among other cases, the principle was applied so as to allow one member of a firm formed for the purpose of illegal transactions to recover from the other member his share of the profits. See, also, in support of this doctrine, State v. Railroad Co., 34 Md. 344, at page 365; Bonsfield v. Wilson, 16 Mees. & W. 185; Haacke v. Knights of Liberty, 76 Md. 429, 25 Atl. 422; Daniels v. Barney, 22 Ind. 207; Peters v. Grim, 149 Pa. 163, 24 Atl. 192, 34 Am. St Rep. 599; Portsmouth Brewing Co. v. Mudge, 68 N. H. 462, 44 Atl. 600; McDonald v. Lund, 13 Wash. 412, 43 Pac. 348; Andrews v. Association, 74 Miss. 362, 20 South. 837, 60 Am. St. Rep. 509. There is certainly little reason in the distinction, and other cases have refused to recognize it. Vandegrift v. Vandegrift, 226 Pa. 254, 75 Atl. 365, 18 Ann. Cas. 404; McMullen v. Hoffman, 174 U. S. 639, 19 Sup. Ct 839, 43 L. Ed. 1117 (limiting, if not overruling, Brooks v. Martin, supra). One sued on an implied contract for services rendered may under a general denial show an express contract and it is immaterial that such express contract was unlawful. Stewart v. Thayer, 170 Mass. 560, 49 N. E, 1020. See "Contracts," Dec. Dig. (Key-No.) § 138; Cent. Dig. §§ 681-700.
38 Howson v. Hancock, 8 Term R. 575; Perkins v. Savage, 15 Wend. (N. T.) 412; Burt v. Place, 6 Cow. (N. T.) 431; Johnson v. Berry, 20 S. D. 133, 104 N. W. 1114, 1 L. R A. (N. S.) 1159. See "Contracts," Dec Dig. (Key-No.) § 138; Cent. Dig. §§ 681-700.
39 Electrova Co. v. Spring Garden Ins. Co., 156 N. C. 232, 72 S. E. 306, 35 L. R. A. (N. S.) 1216. See "Contracts," Dec. Dig. (Key-No.) ( 138; Cent. Dig. §§ 681-700.
goods delivered under it may be recovered.40 "It best comports with public policy to arrest the illegal proceeding before it is consummated." 41 In a leading English case on this point the plaintiff had made a fictitious assignment of goods to a third party, to defraud his creditors, and the defendant, with a knowledge of the circumstances, had taken a bill of sale of the goods from the assignee, and afterwards, though the plaintiff demanded them back, had caused them to be put up at auction and sold. Nothing further had been done in respect of the fraud contemplated against the creditors, and the plaintiff was allowed to recover, on the ground that, as the illegal purpose was not carried out, there was a locus pœnitentiŠ. "If money is paid," it was said in that case, "or goods delivered, for an illegal purpose, the person who has so paid the money or delivered the goods may recover them back before the illegal purpose is carried out; but if he waits until the illegal purpose is carried out, or if he seeks to enforce the illegal transaction, in neither case can he maintain an action." 42
So, also, in a case where persons had each deposited money with another on a wager, and one of them, after a decision of the wager against him, but before the money was paid over, demanded it back, he was allowed to recover.43
40 TYLER v. CARLISLE, 79 Me. 210, 9 Atl. 356, 1 Am. St. Rep. 301, Throckmorton Cas. Contracts, 297; Barclay v. Pearson,  2 Ch. 154; Clarke v. Brown, 77 Ga. 606, 4 Am. St. Rep. 98; Peters v. Grim, 149 Pa. 163, 24 Atl. 192, 34 Am. St. Rep. 599; Skinner v. Henderson, 10 Mo. 205; Adams Exp. Co. v. Reno, 48 Mo. 264; Souhegan Nat. Bank v. Wallace, 61 N. H. 24; Wassermann v. Sloss, 117 Cal. 425, 49 Pac. 566, 38 L. R. A. 176, 59 Am. St Rep. 209; Stansfield v. Kunz, 62 Kan. 797, 64 Pac. 614. But see Knowlton v. Spring Co., 57 N. Y. 518. See "Contracts," Dec. Dig. (Key-No.) § 138; Cent. Dig. §§ 6S1-700.
41 Stacy v. Foss, 19 Me. 335, 36 Am. Dec. 755. See "Contracts," Dec. Dig. (Key-No.) § 138; Cent. Dig. §§ 681-100.
42 Taylor v. Bowers, 1 Q. B. Div. 291. See, also, Spring Co. v. Knowlton, 103 U. S. 49. 26 L. Ed. 347; Gowan's Adm'r v. Gowan, 30 Mo. 472. The principle of Taylor v. Bowers, supra, as well as its application, was questioned in Kearley v. Thomson, 24 Q. B. Div. 742, 746. See "Contracts," Dec. Dig. (Key-No.) §138; Cent. Dig. §§ 681-100.
43Hampden v. Walsh, 1 Q. B. Div. 189. And see Fisher v. Hildreth, 117 Mass. 558; Bernard v. Taylor, 23 Or. 416, 31 Pac. 968, 18 L. R. A. 859, 37 Am. St Rep. 693; Lewis v. Bruton, 74 Ala. 317, 49 Am. Rep. 816; Weaver v. Harlan, 48 Mo. App. 319; McDonough v. Webster, 68 Me. 530; McAllister v. Hoffman, 16 Serg. & R. (Pa.) 147, 16 Am. Dec. 556; TYLER v. CARLISLE, 79 Me. 210, 9 Atl. 356, 1 Am. St. Rep. 301, Throckmorton Cas. Contracts, 297; Stacy v. Foss, 19 Me. 335, 66 Am. Dec. 755; Wheeler v. Spencer, 15 Conn. 28; House v. McKenney, 46 Me. 94; Shannon v. Baumer, 10 Iowa, 210; Hodson v. Terrill, 1 Cromp. & M. 797; Hastelow v. Jackson, 8 Barn. & C. 221; Martin. v. Hewson, 10 Exch. 737; Strachan v. Stock Exchange  2 Q. B. 329;
On the other hand, if the illegal object has been effected by the mere deposit of the money or goods, they cannot be recovered. And it seems that, if the illegal contract has been performed in part, there can be no recovery.44 In an English case the defendant had agreed with the plaintiff to go bail for him for a specified time if the plaintiff would deposit with him the amount of the bail as an indemnity against his (plaintiff's) possible default, the defendant undertaking to return the money at the expiration of the specified time. Before the time had expired, the plaintiff sued for the money, on the ground that the agreement was illegal, and that he was entitled to rescind it. It was held that the illegal purpose was effected when the public lost "the protection which the law affords for securing the good behaviour of the plaintiff;" for, as it was said, "when a man is ordered to find bail, and a surety becomes responsible for him, the surety is bound, at his peril, to see that his principal obeys the order of the court. * * * But if money to the amount for which the surety is bound is deposited with him as an indemnity against any loss which he may sustain by reason of his principal's conduct, the surety has no interest in taking care that the condition of the recognizance is performed." 45
So, also, where a person placed money to the credit of a corporation to give it a fictitious credit in case of inquiries, the money to be returned to him at a specified time, and he sued to recover the same after the company had gone into liquidation, he was not allowed to recover, because "the object for which the advance was made was attained as the company continued to have a fictitious credit till the commencement of the winding-up." 46
Pabst Brewing Co. v. Liston, 80 Minn. 473, 83 N. W. 448, 81 Am. St Rep. 275; Falkenberg v. Allen, 18 Okl. 210, 90 Pac. 415, 10 L. R. A. (N. S.) 494. In many states by statute persons who have lost money by gambling may, under certain circumstances, recover it back. In some states by statute any money betted or staked is forfeit. Ferguson v. Yunt, 13 S. D. 120, 82 N. W. 509. In some by statute a stakeholder on notice must return it. Turner v. Thompson, 107 Ky. 647, 55 S. W. 210. See "Gaming," Dec. Dig. (Key-No.) § 26; Cent. Dig. §§ 13, 57-61.
44 Keasley v. Thomson, 24 Q. B. Div. 742; Ullman v. Association, 1G7 Mo. 273, 66 S. W. 949, 56 L. R. A. 606; Anson, Cont. (8th Ed.) 219. See "Contracts;' Dec. Dig. (Key-No.) § 1S8; Cent. Dig. §§ 681-700.
45 Herman v. Jenchner, 15 Q. B. Div. 561, overruling Wilson v. Strugnell, 7 Q. B. Div. 548. Otherwise where an agreement to indemnify the signer of a bail bond against loss is not against public policy. Maloney v. Nelson, 12 App. Div. 545, 42 N. Y. Supp. 418; Moloney v. Same, 158 N. Y. 351, 53 N. E. 31. See "Contracts;' Dec. Dig. (Key-No.) § 188; Cent. Dig. §§ 681-700.
46 In re Great Britain Steamboat Co., 20 Ch. Div. 616. See "Contracts," Dec. Dig. (Key-No.) | 138; Cent. Dig. §§ 681-700.