(after stating the facts). As the plaintiff took the note under an assignment made after its maturity it passes into his hands, subject to all the infirmities and defences to which it was exposed when held by 'the assignor.
' It is an established principle governing the law of contracts, that they will not be enforced when resting upon a consideration against good morals, public policy, or the law, common and statutory, and it is expressed in the maxim ex turpi causa, non oritur actio. This vitiating result follows, when the illegal purpose enters into, and forms a part of an entire indivisible consideration. King v. Winants, 71 N. C., 469. If it be the basis of several stipulations, some legal and some illegal, the whole contract is infected and rendered void. Lindsay v. Smith, 78 N. C., 328.
*441Ad illustration of the rule is afforded, in the case of a sheriff having final process in his hands, and finding property subject to seizure, in the possession of the judgment debtor, to which a third party makes claim. An indemnity given the officer for proceeding to levy and sell, in the bona fide purpose of contesting the validity of the opposing claim, is effectual for his protection, while such indemnity given by the claimant to induce the officer to forbear, and not proceed with the execution, would be inoperative. The distinction is, that in one case, the security is given in furtherance of official duty; in the other, in obstructing its performance.
“An agreement to induce a public officer to omit the performance of his duty is void.” Chitty on Contracts, 221. A contract to indemnify a sheriff for doing that which he ought to do, is good; a contract to indemnify him for- doing that which he ought not to do, is void. Blackett v Cressop, 1 Lord Ray, 278, Plowden 64. Denson v. Sledge, 2 Dev. 136 — opinion of Toomer, J. 141.
In Pearson v. Fisher,. 1 Car. L. Rep. 72 (460), the sheriff was held to be personally liable for not proceeding to sell a slave, which he had levied on as the property of the judgment debtor, and which had been surrendered, upon the finding of a jury summoned by him to try the title, that the slave belonged to the son of the debtor, it appearing on the trial that the slave was liable to seizure and sale, and the plaintiff had tendered to the officer an indemnifying bond, in ease he made the sale. To same effect is State v. Tatom, 69 N. C., 35. The reasons for the difference are these :
Unless.the officer will sell, the plaintiff cannot test the validity of the asserted opposing claim to the property, and thus a fraudulent instrument might be made the means of defeating the execution of any practical results, as if it were bona fide and effectual. It is true, in equity, he may have relief without sale, by a decree declaring the claim fraudulent, and directing a sale, but the creditor has an equal right to proceed at law, and *442subject the debtor’s property, which he has fraudulently attempted to transfer to another, to the satisfaction of his judgment. In case of real doubt, the Sheriff may require an indemnity before proceeding to incur a personal responsibility, and if refused, decline to act. And so, when having several executions against the same debtor, some of the plaintiffs will, and some will not give the indemnity when demanded, the officer may apportion the fruits of his action among those of the first mentioned class, to the exclusion of the others. Deney v. White, 65 N. C., 225. The subject is fully treated in a recent work— Murfree on Sheriffs, chapter 13, §§580 to 635, inclusive — where the legislation of the different States is set out and explained, rendering its further discussion needless. The cases cited in the argument, 2 Chitty on Contracts, 999 ; Foster v. Clark, 19 Pick., 329 ; Shotwell v. Hamlin, 23 Miss., 156, when carefully examined, will not be found at variance with the general doctrine, and if they were, .would not be allowed to overrule the adjudications of this Court, based as we believe, upon sound reasoning and correct principle.
Now in the application of the principle to the facts of the present case.
The execution had been levied upon personal property as belonging to the debtor. It had been before advertised for sale, and bond taken for its delivery at the time and place of sale. The Sheriff’s deputy was resisted by the defendant when he took possession for the purpose of selling. A third party asserted a title to the property under a mortgage deed. Upon receiving information from the deputy, the Sheriff came, and after some negotiation, he and the defendant came to an agreement, by which the defendant was to pay a certain sum in money, and give his note for the balance of the judgment. The note in suit was given in consideration of the agreement, and upon condition that it should not be paid, unless the Sheriff was amerced for dereliction of official duty, and he was subsequently amerced and has paid the same.
*443It is most manifest to us, that this transaction was wholly unauthorized, and entirely repugnant to official duty. Its very and sole purpose, was to protect him in disregarding its requirements and violating the mandate of the law. He might, under these unexpected circumstances, have foreborne further action, until he could obtain indemnity from the plaintiff. But instead of this, he surrenders the property, undertakes to compromise and settle the plaintiff's demand, and then seeks to secure his own immunity, in a bond to reimburse what he may have to pay for not performing the mandate in the process directed to him. The illegality is so apparent as to require no further elucidation. Sharp v. Farmer, 4 D. & B., 122; Blythe v. Lovingood, 2 Ired., 20; Covington v. Threadgill, 88 N. C., 186.
It must be declared that there is error in the ruling. The judgment must be reversed, and a judgment here entered upon the facts found for the defendant.
Error. . Reversed.