It appears that the contract for convict labor in the state prison, under which the work in question was done, violated the provisions of the act in relation to state prisons, passed May 11, 1835, and that upon the certificate of the attorney-general, whose duty it was, by the subsequent act of 9th April, 1842, to examine all the then existing contracts for convict labor, the contract between the parties to this suit was rescinded on the ground that it did violate the provisions of the previous law. This rescission was the act of the agent of the prison under the direction of the prison inspectors, without the consent of the other contracting parties, the defendants below.
The question then is, whether, after rescinding the contract, the agent of the prison can recover for the labor performed under it, anterior to the time of the rescission ?
By the terms of the contract the labor was to have been paid for monthly at the end of each month; and the action is brought upon an implied assumpsit, for several of such monthly payments. The contract, however, appears to have been resorted to upon the trial, in order to fix the price or value of convict labor, and to show that, by its terms, each month’s earnings constituted a distinct demand, and might be the subject of an action. In this respect the contract which was here made differs from those of a hiring for a definite length of time, where the contract is entire, both as to the period of service and the payment, and where performance to the end of the period agreed upon is a condition precedent to any right of action, although the amount of compensation may happen to be fixed at a certain specified rate *297per day or per month. Such were the circumstances in McMillen v. Vanderlip (12 John., 165), Reab v. Moor (19 John., 337), and in other cases of that class.
Notwithstanding the contract was put an end to in the manner above mentioned, the respondent’s counsel insists that it is not to be considered an illegal contract because no evidence was given of the existence of such facts as are required to bring it within the prohibition of the 7th and 9th sections of the statute of 1835; that the opinion of the attorney-general did not make it illegal, but only caused it to be annulled.
It is a sufficient answer to this argument to say, that the contract has been pronounced illegal by the proper officer of the state; and upon the ground that it violated the provisions of existing laws, it has been annulled. The state, and its agents or servants acting in this matter, are therefore estopped from making any question on the subject, or from denying that the contract was malum prohibitum at the time it was entered into, and also at the time it was rescinded by them. The illegality consists in applying the labor of the convicts in such a way as to teach them the trade or business of “ manufacturing hats in all its branches.” The employers expressly stipulating “ to instruct said convicts in said trade of hat manufacturing”—hats being articles of which the chief supply for the consumption of the country is not imported from foreign countries. The work about which the convicts were employed was, therefore, unlawful, and it is for the wages of such work that this action is brought. If the action had been brought upon the contract during its existence, or while it remained executory, there can be no doubt that a successful defence might have been made, provided it was proved that the contract was illegal; and at the expiration of the five years, if anything remained due for labor performed under it up to that time, it is equally clear, upon such proof being made, that no action could have been sustained as upon an executed contract. In pari *298delicto, potior est conditio defendentis, is the rule of the courts in all such cases. (2 Com. on Contracts, 109.)
This action, it is true, proceeds upon the ground that the contract has been disaffirmed, that is, it has been brought after the contract was rescinded; but it is a mistake to say that it proceeds in disaffirmance of the contract. On the contrary, it rather affirms the contract, for it claims exactly what the contract was intended to give. The plaintiff seeks to have the full benefit of the contract, though in a form of action a little different. The case is not, therefore, within the principle of those cases where actions have been sustained to recover back mone;y paid or property parted with, as the consideration for a void contract which has failed, or one which is capable of being set aside or disregarded; nor .is it within the principle of the cases of The Utica Insurance Company v. Kip (8 Cow., 20), and of King v. Brown (2 Hill, 485), relied upon by the respondent’s counsel. In the first the action was sustained to recover back the money lent because the loan was not unlawful, though the securities taken upon the loan were such as the company had no authority to take—indeed were prohibited from taking— and were, therefore, unlawful. (Beach v. Fulton Bank, 3 Wend., 583.)
In the other case (King v. Brown), the plaintiff was allowed to recover for work which he had performed for the defendant, though the work was to have gone in payment for land which was to have been conveyed to him by the defendant under a contract void by the statute of frauds. The true principle, says Nelson, Oh. J., in that case, is “that the contract being void and incapable of enforcement in a court of law, the party paying the money or rendering the service in pursuance thereof, may treat it as a nullity and recover the money, or the value of the services, under the common counts. This is the universal rule in cases where the contract is void for any cause not illegal, if the defendant be in default.”
*299In the case in hand, the contract was not merely void, it was illegal; at least it is so to be regarded for the present purpose: and to allow the plaintiff to recover in this case is, in my judgment, virtually to allow an illegal contract to be enforced.
Ruggles, Ch. J., and Jewett, Paige and Gray, Js., concurred in the above opinion;
Gardiner, J.The contract, in this case, was entire; but the agent had a right of action against the contractor at the end of each month for the amount earned by the convicts according to the price fixed by the agreement. But the plaintiff could not rescind the special contract, and recover upon the common counts. The agreement was not wholly performed by the plaintiff, and could not, in the nature of things, be performed until the expiration of the whole period stipulated. A farmer hires a laborer for a year, at $10 per month, payable at the end of each month. The laborer works two months and abandons the employment of his master altogether,—in other words, rescinds the contract on his part—and sues for his wages. He must recover, if at all, upon thé special contract, and upon the stipulation for monthly payments as an independent covenant. He cannot by his own act, without cause, put an end to the contract, and then ask the court to imply an assumpsit in his favor. (12 John., 168.)
If the contract in this case was rescinded without cause, the plaintiff cannot recover. If for the cause suggested by the attorney-general in his opinion, then the agreement was against public policy, as settled by an act of the legislature and expressly prohibited by the statute. No cause of action can arise from an undertaking prohibited by statute, whether the contract is malum in se or malum prohibitum. Two persons enter into a contract to smuggle goods: the law will *300not imply a contract in favor of either in any matter growing out of the transaction.
I think the judgment erroneous.