after stating the case: While the plaintiff, in his complaint, prayed for the judgment to which we think he was legally entitled, instead of a mandamus, if the contract *63with the city had been valid, yet his cause of action was not properly conceived, and he cannot recover the $600 which he subscribed and paid because the contract with the city was broken by it, as it was void, being against public policy and founded upon an illegal consideration. For the same reason, the third issue was immaterial, as constituting the basis for affirmative relief, in behalf of the defendants. The enhancement in value of plaintiff’s properly by the erection of the city hall on the site designated in the contract cannot be used as a counterclaim, as the city can gain nothing, either directly or indirectly, by the illegal transaction. It surely cannot benefit in any way by a void contract, for when it is determined that the transaction was invalid, any increase in value of the plaintiff’s property becomes a mere incident of the erection of the building at that place and the case stands the same as if the contract had not been made and what the city did was merely a voluntary act on its part. There is nothing, therefore, to support the claim for an allowance because of the enhancement, for the reason already stated and for the reason hereafter assigned for denying relief to the plaintiff.
The form of the issues indicates that the court proceeded in the trial upon the theory that the contract was valid, and had been broken, and for this reason submitted tlie third issue, whereas the case should have been tried upon the opposite idea, that the contract was void and that no question of damages or other question which presupposed the validity of the contract, such as the .enhancement in value of plaintiff’s property, was presented. While the third issue was not material in the respect indicated, it is material in another respect, as will hereafter appear. If the contract was void, and plaintiff is not by his relation to the transaction, prevented from recovering, it follows that he would be entitled to judgment, as for money had and received to his use, or for money paid upon a consideration which has failed or upon a condition, compliance with which cannot be enforced, which practically *64amounts to tbe same tiling. For tbe same reason as that just given, plaintiff’s prayer for a mandamus, or coercive process, was properly denied. This sufficiently disposes of all preliminary matters and brings us to tbe consideration of the real issues involved.
Tbe case naturally resolves itself into two questions, which require discussion: First, was tbe contract against public policy, or based upon an illegal consideration, and therefore void ? Second, tbe plaintiff being a party to tbe illegal transaction, if it was illegal, is be in a position to ask for a return of tbe money, or is be debarred of a recovery, being in pari delicto f
Tbe statute provides that tbe authorities of a townj whether commissioners or aldermen, shall make such orders for tbe disposition or use of its property as tbe interest of tbe town may require. Revisal, section 2916. Judge Dillon, referring to tbe general duty of municipal officers, with respect to tbe affairs which they have in charge, says: “Powers are conferred upon municipal corporations for public purposes ; and as their legislative powers cannot, as we have just seen, be delegated, so they cannot without legislative authority, express or implied, he bargained or bartered away. Such corporations may make authorized contracts, but they have no power, as a party, to make contracts or pass by-laws which shall cede away, control, or embarrass their legislative or governmental powers, or which shall disable them from performing their public duties. The cases cited mark the scope and illustrate the application of this salutary principle in a great variety of circumstances, and, for the protection of the citizen, it is of the first importance that it shall be maintained by the courts in its full extent and vigor.” 1 Dillon Mun. Corp. (4 Ed.), section 97, p. 156. It will be seen, therefore, that public office in a city is a public trust to be administered for the equal benefit and advantage' of all the citizens of the municipality and the governing body will not be per*65mitted to contract at any time so as to deprive itself of the free exercise of its judgment and discretion in providing for what may afterwards turn out to be the best interest of all citizens alike, and especially will it not be allowed by an obligatory agreement to discriminate in favor of one citizen or class of citizens as against another entitled to equality of privilege and benefit, even for a valuable consideration. It must at all times retain freedom of judgment, so that its decisions will be influenced only by a regard for the public welfare. We take it that any contract by - which it should be attempted to prevent the city authorities from deciding impartially on a matter affecting the general welfare would be unenforcible. If public trustees or officers may by contract divest themselves of any portion of the essential powers intrusted to them, they may just as well alienate all of them, though by degrees, and thus eventually abdicate the exercise of every governmental function. Such agreements are therefore contrary to the true principles upon which society is founded and subversive of all well-regulated government. These propositions would seem to be self-evident. “All agreements for pecuniary considerations, to control the business operations of the government, or the regular administration of justice, or the appointment to public offices, or the ordinary course of legislation, are void as against public policy, without reference to the question whether improper means are contemplated or used in their execution. The law looks to the general tendency of such agreements, and it closes the door to temptation by refusing them recognition in any of the courts of the country.” Tool Co. v. Norris, 2 Wall., 45; Cameron v. McFarland, 4 N. C., 299; Wharton on Contracts, section 403. The leading case of Martin v. Mayor, 1 Hill (N. Y.), 546, is one in which the principle was applied and where it appeared that for a consideration, public trustees agreed with a lot owner to make certain improvements which they refused to do. The court held that they might *66decline to go forward with the improvement on the ground that it was injurious or unprofitable to the public and that in this respect they enjoyed a discretion which individuals have no power to control and the trustees no power to part with. It was further said: “To allow that commissioners of streets and highways may bind themselves by contract to sub-serve the interests of individuals, would be a clear violation of public policy. They are officers of. municipal corporations or quasi corporations, and in respect to the laying out of streets and highways are primarily bound to consult the interests of the community at large.” The doctrine there enforced was that a contract will not be sustained which tends to restrain or control the judgment of public officers, which must always be impartial. But all promises of individuals to pay a portion of the expenses of public improvements do not necessarily fall within the principle and may not be void. The validity of the particular contract will depend of course upon whether it has the evil tendency to influence the officer in the discharge of his public duty by trammelling his judgment in matters about which he should be left free to act as the public interest alone may dictate or require. This is the vitiating element and if the agreement has that tendency in the eye of the law, it makes no difference what is the actual motive in the particular instance or how pure it may be. In the case of W. S. E. Society v. Philadelphia, 31 Pa. St., 175, the rule was said to rest upon the ground that a corporation, acting for the benefit of others, has no power to enter into a contract which would prevent it from performing its public duties and that this restriction upon the power of a corporation to make such contracts is nothing more or less than the application of the familiar principle which avoids the contracts of individuals when they are detrimental to the public’s rights. This identical question was fully considered by a court of exceptional ability in Gale v. The Village of Kalamazoo, 23 Mich., 344, in which Cooley, C. J., for the court, *67said: “If a municipal corporation can preclude itself in tliis manner from establishing markets wherever they may be thought desirable, or from abolishing them when found undesirable, it must have the right also to agree that it will not open streets, or introduce water for the supply of its citizens, except from some specified source, or buy fire-engines of any other than some stipulated kind, or contract for any public work except with persons named; and if it might do these things, it is easy to perceive that it might not be long before the incorporation itself, instead of being a convenience to its citizens, would have been used in various ways to compel them to submit to innumerable inconveniences, and would itself constitute a public nuisance of the most serious and troublesome description. Individual citizens, looking only to the furtherance of their private interests, might in various directions, engage it in permanent contracts, which, while ostensibly for the public benefit, would impose obligations precluding further improvements and depriving the town prospectively of those advantages and conveniences which the municipality was created to supply, and without which it is worthless. Eor if the village might bind itself to one market house, for ten years, it might do so for all time to come; and if it might agree that improvements and convem iences of one class might be confined by contract to one quarter of the town, a reckless or improvident board might agree with a greedy or unscrupulous proprietor of town lots, that all improvements of every description should be so located or made as to conduce to his benefit, irrespective of the general good. It will not do to say of such a contract that it must be assumed to have been reasonable in view of the actual condition and wants of the village, and of its probable growth and future needs. Indeed it is impossible to predicate reasonableness of any contract by which the governing authority abdicates any of 'its legislative powers, and precludes itself from meeting in the proper way the emergencies that may arise.” *68Tbe court concludes that the village had incurred no liability to the plaintiff by its breach of the contract, as it was void, being against public policy. We have quoted liberally from the opinion in that case, not only because the personnel of the court entitles its judgments to the greatest respect, but because the proposition is stated in concrete form and sustained by most cogent reasoning and apt illustration. We do not ignore the fact that there the contract involved the idea of permanency in the location of the market house, but the court attached no special importance to that feature, but decided the case rather upon the ground that if the agreement was held to be valid, the town commissioners would be deprived of the exercise of that judgment and discretion in the premises so essential to the public welfare. In our case the promise that the buildings shall remain near the plaintiff’s property is, it seems to us, necessarily implied by the nature of the contract, for it could be of little or no benefit to him if they could be removed at any time, even if such a course were practicable. The principle of that ease is applicable here, and the closing words of the court, as quoted by us, clearly so indicate. The question is fully discussed in Fuller v. Dame, 35 Mass. (18 Pick.), 472, in which Chief Justice Shaw, with his accustomed learning and ability, presents most satisfactory reasons and unanswerable arguments in condemnation of such agreements and proves their invalidity to a demonstration. He argues that it is not a satisfactory excuse to say that when the agreement was entered into, the officers or trustees had come to the opinion that the location in question was the best for the interests of the public, and for the interests of the corporation. Such an opinion might be changed by new views and new offers. Upon all these questions the influence of the promise of separate and distinct advantage, deprived the officers of the power of exercising a free, disinterested and unbiased judgment. Any influence from any quarter, created by the promise of a sum of mouey, *69to induce them so to contract, and to yield to particular terms, with a view to benefit separate and individual interests, operated as an injury to the public and rendered the contract void. The confidence of the people in the proper transaction of business by its officials could only be safely reposed under the belief that they will fairly exercise their best and unbiased judgment upon the question of fitness, without being influenced by extraneous considerations, having no connection whatever with the accommodation of the public. The conclusion is thus substantially stated: It is obvious that if one large landholder may make a valid, conditional promise to pay a large sum of money to a stockholder, or influential citizen, on condition that a work of great public improvement may be so fixed as to enhance-the value of his estate, all other landholders may make like promises on similar conditions, and public works, which should be conducted with a view to the public interest, and to the just rights of those who make advances for the public benefit, would be in danger of being overlooked, and sacrificed in a mercenary conflict of separate local and private interests. We regard the reasons advanced in that ease as conclusive of the question and find that the courts and text writers have generally adopted the same views. “A contract will not be sustained which tends to restrain or control the unbiased judgment of public officers, ir being contrary to public policy and void as abdicating a public function.” Ingersoll on Pub. Oorp., 310. The powers conferred upon officers of cities to be exercised for the public good in making improvements demanded by public convenience are continuing and inalienable. 2 Dillon Mun. Corp., (4 Ed.), section 685. “This power the city cannot refuse to exercise when public necessity or convenience demands that it shall be done, nor can it be allowed to excuse its failure in this particular upon the ground that it has by contract deprived itself of the right to act.” Louisville City Railway v. City of Louisville, 71 Ky., 417; Gas Co. v. Columbus, 5 *70Ohio St., 65; New Haven v. Railroad, 62 Conn., 257; Indianapolis v. Gas Co., 66 Ind., 404; McKeesport v. Railway, 2 Penn. Sup. Ct. Rep., 242; Milhau v. Sharp, 27 N. Y., 611; Matthews v. Alexandria, 68 Mo., 119. The court, in Mayor v. Bowman, 89 Miss., 682, said: “Even if we suppose the city to have legislative power and control over the liquor license, which it clearly has not, it was not competent for the board to bind the city by a contract taking away the legislative discretion; nor would the exercise of its legislative discretion in violating the terms of the contract subject the city to the payment of damages or a penalty. The authorities on this point are clear, but the reason of the thing is enough.” The question has frequently arisen in the establishment of railroad depots. Railway companies are quasi public corporations and it has been said that the public have an interest in the location of their depots, the public convenience and accommodation being involved. “It is in recognition' of the paramount duty of railway companies to establish and maintain their depots at such points and in such manner as to subserve the public necessities and convenience, that it has been held by all the courts, with very few exceptions, that contracts materially limiting their power to locate and relocate their depots are against public policy, and therefore void.” People v. Railway, 130 Ill., 175. “It seems to be universally well settled that contracts undertaking to obligate a railroad company to establish its depot exclusively at a particular point, are void as against public policy.” Railroad v. State, 31 Fla., 508. Oases and text books to the same effect can be cited numerously. We give only a few of them. Railroad v. Ryan, 11 Kan., 602; Railroad v. Seely, 45 Mo., 212; Railroad v. People, 132 Ill., 559; Railroad v. Marshall, 136 U. S., 393; Railway v. Louisville, supra; Holladay v. Patterson, 5 Oregon, 177; Marsh v. Railroad, 64 Ill., 414; Greenhood on Public Policy, 319; 2 Beach Mod. Law of Contracts, section 1517.
*71When a contract belongs to a class which is reprobated by public policy, it will be declared illegal though in that particular instance no actual injury may have resulted to the public, as the test is the evil tendency of the contract and not its actual result. 15 A. & E. Enc. (2 Ed.), 934. We must not be understood as holding that in no conceivable case can a citizen contribute to the expense of erecting a public building. We can easily imagine circumstances where such contributions might be lawful, and proper to be considered in determining the best location for the public, but the donation of money must not be the inducement to the selection of a site apart from the public interests concerned. Oases which strongly approve the doctrine by which the particular contract in this case is condemned and in which the authorities are reviewed at length, are Woodman v. Innes, 27 Am. St. Rep., 274, and Elkhart Co. Lodge v. Crary, 49 Am. Rep., 746.
This court has recently had under consideration in Glenn v. Commissioners, 139 N. C., 412, a question very similar to the one now presented. The plaintiff in that case alleged that the defendants had contracted to maintain a public bridge over a river at a certain point on his lands for the considerations set forth, and that they were about to abandon the bridge and erect a new one at another place on the river not far away. He sought to enjoin the defendants from constructing the other bridge. This court held that the discretion of the commissioners could not be thus controlled or coerced. The reasons for this conclusion are fully stated by Mr. Justice Connor in the opinion of the court delivered by him. Citing Bridge Co. v. Commissioners, 81 N. C., 491, the court says: “The essential .powers of government, conferred for wise and useful purposes, should remain undiminished and unimpaired in the legislative body itself and pass in full force to its successors. When a contract undertakes to alienate any of these it is inoperative, and as no right *72vests, so no obligation is created under it.” Tbe two cases are not distinguishable in principle. The court would be fully as reluctant to give the plaintiff relief in the case at bar as it was in the case cited, because here it is expressly alleged that the money was paid for the purpose of inducing the defendant to erect the building’s near the plaintiff’s lands sc that the latter would be enhanced in value. This was virtually inducing them to part with a discretion which should have been exercised in behalf of the public and not of the plaintiff.
This brings us to the consideration of the next question, whether the contract being void as founded upon an illegal consideration, the plaintiff can recover the money he has paid in part execution of the same. With reference to this subject certain rules may be taken as settled. The law gives no action to a party upon an illegal contract, either to enforce it directly or to recover back money paid on it after it has been executed. Webb v. Fulchire, 25 N. C., 485; Warden v. Plummer, 49 N. C., 524; 15 Am. & Eng. Enc. (2 Ed.), 997. The rule rests upon the broad ground that no court will allow itself to be used when its judgment will consummate an act forbidden by law. The maxim is ex dolo malo (or ex turpi causa) non oritur actio, and the kindred one is in pari delicto potior est conditio defendentis. In such cases the law leaves the parties where it finds them. When parties are in pari delicto in respect to an illegal contract, and one obtains advantage over the other, a court will not grant relief (Wright v. Cain, 93 N. C., 296), and when they have united in an unlawful transaction to injure another or others or the public, or to defeat the due administration of the law, or when the contract is against public policy, or contra bonos mores, the courts will not enforce it in favor of either party. York v. Merritt, 77 N. C., 213, Ibid, 80 N. C., 285; King v. Winants, 71 N. C., 469; Pinckston v. Brown, 56 N. C., 494; Sparks v. Sparks, 94 N. C., 532. Chief Justice Smith *73said for the court in the last case: “But the principle is that such an agreement will not be enforced at the instance of either party, not that what may have been done in carrying out its purpose will be undone by the court. It will not. assist when its aid is asked, or in other words, its provisions' ‘will not be enforced in this court’ — a court exercising equitable functions. The rule that refuses to compel the execution of such a contract, for similar reasons, refuses to relieve from the consequences of what the parties have done under it, in giving it full effect.” The rule is departed from when there is inequality of condition as between the parties, or one of them has come under the subjection of the other, or has been induced by oppression, imposition, undue influence or improper means, to make the contract, in which case he is not equally at fault with the other. While in delicto, he is not in pari delicto, but stands, as it were, in vinculis. Pinckston v. Brown, supra; 15 Am. & Eng. Enc. (2 Ed.), 1004. When the contract is executory, the court will not enforce it, and when executed, will not set it aside as against one party at the instance of the other. We need not decide nor inquire whether, when money is paid on an illegal contract, the aid of the court can be successfully invoked for its recovery, though the other party refuses to perform any part of the agreement, so that it is wholly executory on his side. There is conflict of authority upon this question. Ibid, 1001; 1 Page on Contracts, section 526; Greenhood on Public Policy, p. 80; Spring Co. v. Knowlton, 103 U. S., 49; Knowlton v. Spring Co., 57 N. Y., 518; Kearley v. Thompson, L. R., 1 Q. B. Div., 742; White v. Bank, 22 Pick., 181; Wald’s Pollock on Contracts (3 Am. Ed.), 502. We have seen that he may recover where there has been any unfair advantage taken or any imposition practiced. Webb v. Fulchire, supra.
But it must not be supposed from what has been said, that in order to deprive a party of the right to repudiate an illegal *74contract and to recover money already paid thereon, it is necessary that the illegal transaction should have been fully executed, as it is quite sufficient for that purpose that there has been a partial fulfillment of the illegal undertaking by the party against whom the action is brought for the recovery of the amount so paid to him. 15 Am. & Eng. Enc. of Law (2 Ed.), 1007. We believe that the law writers and the courts are fairly well agreed upon that proposition. Kearley v. Thompson, L. R., 1 Q. B. Div., 742; Knowlton v. Spring Co., 57 N. Y., 518; Ullman v. Fair Asso., 167 Mo., 273; Wald’s Pollock on Contracts (3 Am. Ed.), pp. 502, 507; Hooker v. DePallos, 28 Ohio St., 251. Especially should this be the law where the party who has thus partially performed the contract in return for the money received by him from the plaintiff cannot be put in statu quo, which is the case here. Lord Justice Fry, in Kearley v. Thompson, supra, for the court, said: “We hold, therefore, that where there has been a partial carrying into effect of an illegal purpose in a substantial manner, it is impossible, though there remains something not performed, that the money paid under the illegal contract can be recovered back.” Chief Justice Coleridge, Lords Esher, Bowen and the other eminent judges who sat with them, fully concurred in this view. This has been generally accepted as the correct rule, even by the courts which hold that money paid on an illegal contract, may be recovered back where the contract is wholly executory on the other side or as to the defendant. The principle should certainly apply to our case, in which it appears that the defendant has substantially performed the contract in part and cannot be restored to its original position and that the plaintiff has received a benefit which is not only substantial, but fully commensurate with the amount he has paid on the contract. While he loses the right to have the unexecuted portion of the contract performed, he does not by any means depart from the court *75empty banded. Having received an equivalent for bis money in tbe increased value of bis property by tbe placing of tbe city ball where it is, be has no just ground to complain. We find no error in tbe conclusion and judgment -of tbe court upon tbe verdict.