If the land in dispute was really the subject of entry and grant, that of course puts an end to the case, and renders it needless to consider any of the other points made. We will therefore consider that branch of the case first.
To be the subject of entry under the statute, lands must be such as belong to the state, and such as are vacant and unappropriated. Bat. Rev., ch. 41, § 1. If then any one of the many grave objections, urged by defendant against the validity of the state’s title under the contract of 1862, be well founded, so that the land did not, in fact, “belong to the state,” that very circumstance placed it beyond the reach of the statute, and forbade its being acquired by the defendant in the manner attempted. And besides, lands that have been once granted by the state to individual citizens, that is, cut off from the undefined public domain and appropriated to private uses, do not become vacant, within the meaning of the statute, simply because the state may in seme way again acquire them, and fail to put them to *591any special use; or, as in this case, after having used them for a time, should wholly abandon them.
This was the reasoning of the court in Hoover v. Thomas, Phil., 184, with reference to lands that had been confiscated, and with still greater force does it apply to lands actually purchased by the state, and paid for at improved values.
It is not to be supposed that the legislature intended that lands, under such circumstances as these, should be subject to private appropriation and entry, at any moment when their actual use might be discontinued, and at the insignificant price fixed by law for the vacant and unimproved lands of the state.
The lands of delinquent tax-payers,,bid in for the state, did become immediately subject to entry, and so continued to be, until the act of 1872, which ceded them to the board of education. But this was by virtue of the express provision of the statute of 1798, and the very fact that any necessity for such a statute, at all existed, tends strongly to confirm us in the opinion that the construction given to the one now under consideration, is the true one.
Our conclusion therefore is, that in no point of view could the land in controversy be the subject of lawful entry, at the date of defendant’s grant; and being for land not thus subject, that instrument is void, and may be objected to in the pending action.
The rule is well established, that where the land entered is both vacant and subject to entry, objection can only be taken to the grant in some direct proceeding looking to that end ; for in that case, it is not void, but only irregular and voidable. But if the land be not vacant, or, if vacant, not the subject of lawful entry, then the grant is void, and advantage may be taken of it in any action, in which the title to the land becomes involved. Hoover v. Thomas, supra.; Harshaw v. Taylor, 3 Jones, 513; Lovinggood v. Burgess, Busb., 407.
*592As to the estoppel insisted on : It is notorious that grants are always issued at the instance of the grantee, and upon his suggestion that the land is vacant. The state does not warrant it to be so, or the liability of the land to entry. Nor is it any fraud in the state to grant land which is not so liable; on the contrary, the statute on the subject declares it to be a fraud on her to procure a grant from her under such circumstances. And moreover, the state being a sovereign, is never estopped, but may always show the truth of any transaction undertaken in her name.
It cannot be denied, and we do not understand it to be denied in the argument, that the contract entered into in 1862, between the quarter-master and the owner of the land, was unlawful, so unlawful that no court owing allegiance to the government under which we live, would lend its aid to any party who participated in the guilt thereof. There is no principle better established, than that it is the duty of every court to withhold its countenance from every contract, or other act, the direct object or probable tendency of which, is injurious to good morals or contrary to public policy, and especially from one that tends to subvert the political institutions of the country, or endanger the public safety.
Much ingenuity and very great learning were displayed at the bar by counsel on both sides of the case, in discussing the question, whether the maxim ex turpi causa, non oritur actio, could be made to apply to a contract to which the state was a party. As there is another principle involved, which in our-opinion controls the case, it is not necessary that we should consider that question, further perhaps than to say, that in the case of the state, it would be more a question of constitutional power to contract, than of integrity of purpose. Within the scope of her power to act, as limited only by the two constitutions under which she exists, her will is *593the law, and her policy the true policy, at least so far as concerns the courts which sit under and by virtue of her authority. Anything beyond this, undertaken in her name, is void, not because of the imputation of immorality or im-policy to it, but solely because of its being ultra vires.
But apart from every question of unlawfulness growing out of its tendency and purpose, that contract was illegal and void at the election of the state, because of the entire absence of authority in the officer who made it, to bind her to it. Acting as she must necessarily do through-her officers and agents, her safety imperatively demands that her specific instructions should be observed, and only such authority exerted in her name, as is conferred by law.
Under the law of this state, there is but one power that can appropriate the public money, or authorize any conversion of the state’s property, and that one is the general assembly of the state; and any officer, who, having the state’s money or other property in his charge, applies it to any purpose without the sanction of that branch of the state’s government, is guilty of a breach of duty, however honestly it may be done — as doubtless it was done in this instance, without the least thought of private gain, and only in obedience to what was supposed to be the lawful commands of his superior in office. We have searched the statute-books in vain, (even those belonging to those unsettled times), for a law, or the semblance of a law, emanating from any source, which authorized the purchase of the land in suit, for the state, by any one or for any purpose; or for a sanction given to it by that power •which alone could sanction it.
It is not disclosed in the record how the quartermaster became possessed of the bonds, which were given and accepted by the owner of the land in exchange for it, nor is it material that we should know, since he held them pro-*594fesedly for the state and as her agent, and the other contracting party so understood it, and so consented to deal with him — thus participating in, and becoming equally responsible for, the misapplication of the state’s property. She, too, (the other contracting party,) was bound to know the law, and to take notice of the officer’s lack of authority.
Under such circumstances, the general rule of a court of equity would be, that the principal whose funds had thus been improperly converted, might have his election to call for the original fund, holding the property into which it had been converted, as a security for it; or to follow it in its converted form. Cook v. Tullis, 18 Wall., 332; Cooper v. Landis, 75 N. C., 526; Beam v. Froneberger, Ib., 540; Younce v. McBride, 68 N. C., 532. Such we say would be the general rule. Is there any just reason why this should be made an exceptional case ? We frankly own, we can detect nothing in its circumstances which would justify such a course. It is true, the state’s property in the hands of her officer, and which was as we have seen misapplied, consisted of the bonds of the Confederate government. But there can be no room for any distinction, in principle, between them and the treasury notes that were issued by the same authori'y. To say nothing of the decisions of this court, the supreme court of the United States has repeatedly held that the Confederate treasury notes, when recognized by the parties as money, and dealt with in the ordinary course of business, disconnected with any purpose, directly, to be attained by putting them in circulation, constituted in themselves consideration sufficient to support a contract, either executed or executory. The same principle must hold good in the case of its bonds, when treated as property and accepted under similar circumstances. The existence of that power as a nation was no more intimately connected with, or its ability to resist the authority of the United States dependent upon, the one class of instruments than the other.
*595Neither should she be excluded upon the ground thatthe land was intended to be put to an unlawful use. The principle upon which the courts refuse their aid in such cases is this: No court will lend assistance to one who founds his cause of action upon an illegal act, to which he was himself a party. As soon as the court perceives that the action proceeds ex turpi causa, and that the plaintiff’s hands are polluted, it withholds its aid — not out of any consideration for the defendant, but because it will not, on the score of example and public policy, give countenance to such a plaintiff.
But to put this principle into operation in any particular case, it must appear that the very party, who is seeking aid from the court, participated in the unlawful purpose. Indeed, it is said, that the very test of its application is, whether the plaintiff can establish his case otherwise than through the medium of an illegal transaction, to which he was himself a party. If he can, there is no policy of the law which closes the door of the courts against him. How is it then with the plaintiff in this action ? So far as seen, no stain is upon her garments. In no way known to her law, or in. which she was capable of declaring "her will, did she authorize any contract to be made in her name for the land in dispute. The officer who made it, as well as he who directed it to be made, was utterly without authority to commit her to it. Can it be said, under circumstances such as these, that she is in pari delicto, and underserving a hearing in the courts of the country? On the other hand, the owner of the land not only consented to its sale for an unlawful use, but accepted the state’s property from an agent unauthorized by law to part with it. To apply the rule of exclusion in such a case would be, to overlook the very principle upon which it is founded, and would besides do violence to another principle, (equally well founded in good morals and sound policy,and of universal application,) which. *596declares, that “ as against an innocent party, no one shall set up his own iniquity as a defence.”
The defendant being a purchaser without value and with full notice of all the facts of the case, stands in the shoes of his vendor, and can make no defence which she could not, and in his hands the land is subject to the same equity in favor of the state, as it would be in hers. That equity, according to the election of the state as declared in this action, is to follow the fund in its converted form, and take the land.
The judgment of the superior court is reversed, and judgment upon the case agreed rendéred in this court, that the plaintiff recover the land of the defendant.