An agreed statement of facts filed on the trial before the justice of the peace was the basis of the finding of the district court that defendant in October, 1908, solicited, accepted, and took from various persons orders for the purchase by them and sale and shipment to them of intoxicating liquors from and by a certain brewing company in Kansas City, Mo., said orders being subject to the approval of said company, and that the liquors so ordered were to be shipped directly to the persons named from the place of business of said company. ■ Defendant’s motion for judgment in his favor, which was overruled, recited that the acts charged were not criminal under the law of this state at the time of their commission, and, further, that the statute of the state making such acts criminal is in violation of the Constitution of the United States as an interference with the clause thereof relating to interstate commerce and statutes on that subject passed by Congress. The acts with which defendant' was charged were in violation of the provisions of Code, section 2382, as amended by Acts 28th General Assembly, chapter 74 (Code Supp., section 2382), prohibiting any person from soliciting, taking, or accepting “any order for the purchase, sale, shipment or delivery of any (intoxicating) liquor.” In the case of State v. Hanaphy, 117 Iowa, 15, followed in State v. Bernstein, 129 Iowa, 520, decided, respectively, in 1902 and 1906, this statute was held unconstitutional, as in violation of the interstate commerce clause of the federal Constitution. In 1909 this court, relying upon the decision of the Supreme Court of the United States in the case of Delamater v. South Dakota, 205 U. S. 93 (27 Sup. Ct. 447, 51 L. Ed. 724), decided in 1907, reached the conclusion that its previous holding that the statute was in violation of the federal Constitution was *515erroneous, and expressly overruled the two cases in which that conclusion had been announced, and sustained a judgment enjoining the maintenance. of a place for carrying on the business of soliciting, taking, and accepting orders for the purchase, sale, and shipment of intoxicating liquors for and on behalf of a corporation located and doing business in another state as a nuisance. McCollum v. McConaughy, 141 Iowa, 172.
It will be noticed that the abts charged as against this defendant (and in fact also the filing of the information before the justice of the peace) were after the Supreme Court of this state had held the statute to be unconstitutional, and also after the decision of the Supreme Court of the United States in a somewhat similar case from South Dakota sustaining the validity of such a statute as against the contention that it was in violation of the federal Constitution, but prior to the action of this court in reversing its prior decisions in reliance on the later decision of the Supreme Court of the United States. The contention for defendant is that the decision of this court sustaining the constitutionality of the statute should not be given a retroactive effect, and defendant should not be punished for acts which according to the prior decisions of the Supreme Court of this state were lawful.
It is, of course, well settled that a statute which has been held unconstitutional either in toto or as applied to a particular class of cases is valid and enforceable without re-enactment when the supposed constitutional objection has been removed, or has been found not to exist. That was the holding in McCollum v. McConaughy, supra, and is not now questioned. See, also, Pierce v. Pierce, 46 Ind. 86. And the conviction below was proper, unless some benefit is to be given to defendant of the fact that, when the acts were committed, the latest announced decision of this court was to the effect that the statute was unconstitutional, and therefore not enforceable. It is only by *516analogy, applying the rule of precedent and not of adjudication, that the decision in one case becomes in any sense the law in another case. The analogy may be so complete that the reasoning of the one- case necessarily points out the conclusion to be reached in the other, and, if so, the court feels bound to bow to its previous decision, unless it is made to appear that it is so manifestly erroneous that it should be overruled. If overruled, its force as a precedent ceases, and the later decision becomes a precedent. The analogy, however, may be incomplete, and then it is for the court to determine in. the subsequent case whether the reasoning of the prior case is applicable under circumstances in some of which the cases are similar, and in others dissimilar. It is not the function of a court to lay down the law for future cases, but to announce the law for the case which it is deciding. . It is an important function of an appellate court to so announce its reasons for decision that they may be understood and applied with reference to subsequent cases which are likely to arise, but no court can attempt to anticipate by announcement what the law will be found to be in a case in some respects dissimilar which may subsequently arise. Therefore, as has often been said, there is no vested right in the decisions of a court, and, under the clause in the federal Constitution prohibiting any state from passing any law impairing the obligation of contracts, the Supreme Court of the United States has uniformly held that the change of decisions of a state court does not constitute the passing of a law, although the effect of such change is to impair the validity of a contract made in reliance on prior decisions. National Mut. B. & L. Ass’n v. Brahan, 193 U. S. 635 (24 Sup. Ct. 532, 48 L. Ed. 823); Central Land Co. v. West Virginia, 159 U. S. 103 (16 Sup. Ct. 80, 40 L. Ed. 91). And see Storrie v. Cortes, 90 Tex. 283 (38 S. W. 154, 35 L. R. A. 666); Swanson v. Ottumwa, 131 Iowa, 540; Lanier v. *517State, 57 Miss. 102. It is also quite clear that the change in the decisions of a court of a state does not violate the prohibition found in the same clause of the federal Constitution against the making of ex post facto laws.
From the conclusion that in a constitutional sense there is no vested right in' reliance on decisions of the court as precedent, and that one who is brought into court for a violation of law can not sustain himself on the mere plea that in some other case which he thought to be analogous the court rendered a decision which, if applied as he thought it would be applied, would result in exculpating him from wrong, it does not necessarily follow that the court can not take into account as a controlling consideration in reaching the conclusion as to the justice of a case that the party charged with wrongful conduct relied reasonably and in good faith upon decisions of the courts in determining whether a wrong was committed. The Supreme Court of the United States, while recognizing its general obligation to follow the decisions of the courts of the state in which a contract is made in determining its validity, has held that it will not recognize a change of rule in a state made by judicial decision where the effect of such change is to. render invalid contracts which according to the views previously expressed by the state courts. at the' time the contracts were made were valid. Gelpcke v. City of Dubuque, 1 Wall. 175 (17 L. Ed. 520); Thompson v. Lee County, 3 Wall. 331 (18 L. Ed. 177); Douglass v. Pike County, 101 U. S. 677 (25 L. Ed. 968); Center School Tp. v. State, 150 Ind. 168 (49 N. E. 961). In Muhlker v. New York & Harlem R. Co., 197 U. S. 544 (25 Sup. Ct. 522, 49 L. Ed. 872), the judges whose views on this point are expressed in the opinions filed were equally divided on the question whether one acquiring property in reliance on decisions of the courts of the state relating to his rights in an abutting *518street had. a vested right as against a' subsequent change of decision in the state courts, ^/fhese cases are cited, not as indicating any constitutional duty on the part of the courts of a state to protect a litigant in rights which he in good faith supposed he had already acquired by reason of previous decisions of the same court in other cases, but for the purpose of illustrating the extent to which a court may properly go in administering the law for the purpose of effectuating justice; that is, for the purpose of rendering such decision as shall appeal to intelligent and fair-minded people as right and proper. Courts have always taken such considerations into account in the enforcement of legislative enactments. Before there was any separate equity jurisdiction, and when the term equity was used as a mere synonym of equality and justice, the courts interpreted statutes with a view to their equity, and not merely in accordance with their strict terms; so that the case might be within the equity of a statute, although not expressly covered by it, and, vice versa, the statute might be held not applicable in its equity, although its strict terms covered the case. The term “equity of a statute'” has fallen into disuse since the establishment of a system of equity jurisprudence, but the courts have not ceased in either branch of their jurisdiction to give consideration to the general purpose of the lawmaker as furnishing a guide to intérpretation. See Dr. Hammond’s note in his edition of Lieber’s Hermeneutics, page 283. This again is but an illustration of the effort the court will properly make to do justice in a broad sense. In criminal cases, where the life or liberty of an individual is involved on one side, and the enforcement of law in the interest of the public welfare on the other, no private right of contract or property being imperiled by liberality of construction, the courts go further than in civil cases to recognize the common judgment of humanity as to what is right and just, and they allow *519many exceptions to statutory definitions of what shall constitute a crime. For instance, in this state, although there is no statutory recognition of a coverture as a defense on the part of a married woman for a crime committed in the presence of her husband, we have said that the common-law exception in that respect is applicable. State v. Fitzgerald, 49 Iowa, 260; State v. Kelly, 74 Iowa, 589; State v. Harvey, 130 Iowa, 394.
And -it is the general rule in all the states of the Union, even those in which the criminal law is codified, to recognize infancy and insanity as relieving from the punishment prescribed by statute for criminal offenses as they - were recognized at common law, although such defenses are not allowed under any express statutory provision. The assumption is that even the statutory criminal law is to be administered in accordance with the general principles of right and justice recognized in the common-law system. 1 Bishop, New Criminal Law, section 35. In the determination of the criminality of an act even under the statutory definition, the intent is a material consideration. It is the absence of criminal intent which constitutes the basis of the defenses of infancy, insanity and coverture. Ignorance and mistake are also recognized in the same category, but here enters a question of public policy. One who is bound to obey the law ought not to be allowed to say that he was ignorant of it. He may show as a defense that he was mistaken as to a fact which, if it had been as he supposed it to be, would have rendered his act lawful, but he can not say that if the law had been as he supposed it to be, his act would have been lawful and he should not be punished. This principle of public policy has become crystallized into the maxim, “Ignorance of the law excuses no one,” and as applied to the present case, it might well be said, if we followed this maxim, that defendant is not to be excused because he did not know the law, that is, did not know that the *520previous decisions of this court holding the statute which he was violating to be unconstitutional were wrong and the statute was in fact valid and operative. As between conflicting rights, we might well refuse to allow any impairment of so well settled a principle, and hold that parties act at their peril as to what the law shall be decided to be. But as already indicated, in a criminal case there is no such imperative obligation, for after all the punishment of crime is a matter of public concern only and we think that it would strike any reasonable and fair person ,as manifestly unjust that one should be adjudged criminal in having done an act not morally wrong, bnt only wrong because prohibited by statute, that is, an act malum prohibitum and not one malum in se, relying upon the decisions of the highest court in the state holding such statute to be wholly invalid because in excess of the power of the Legislature to enact it.
In this connection it is to be noticed that the decisions of courts as to the constitutionality of a statute stand on somewhat different ground than those relating to the common law or the interpretation of statutes, as .applied to particular cases. The function of determining whether a statute is invalid because in excess of the legislative power is one peculiar to our system of government, and unknown in other jurisdictions in which the common law prevails. It is true that such an adjudication is made •in a particular case. Although the power to be investigated is that of the legislative department itself which can not be a party so as to be bound by any judicial decision, nevertheless the courts discuss such question when it arises, and decide the matter not only for the purpose •of determining the rights of particular parties, but with reference to the effect of the decision upon the law of the state. A statute unconstitutional properly remains on the statute books as a part of the written law, but those who are bound to obey the law may, we think, reasonably *521take into account the decisions rendered by the courts in the exercise of their peculiar function of passing upon the constitutionality of the statutes in determining what the law of the state really is. To the ordinary mind it would smack of absurdity to say that defendant ought to have known that the statute was constitutional, and would in case he violated it be enforced against him, although the Supreme Court of the state had fully considered the validity of the statute as against the claim that it was unconstitutional, and had unanimously held that it was in excess of state legislative power as to its entire subject-matter, and therefore invalid. Under such circum- ■ stances, it is plain that there should he some relief to defendant from punishment, for the very purpose of punishment is defeated, if unreasonably and arbitrarily imposed. Eespect for law, which is the most cogent force in prompting orderly conduct in a civilized community, is weakened, if men are punished for acts which according to the general consensus of opinion they were justified in believing to be morally right and in accordance with law. If we should sustain the conviction, we would do so in the belief that the case was one in which executive clemency ought to be exercised. But is it quite fair to throw upon the executive the responsibility of relieving from punishment on account of the very nature of the act committed which is made apparent to this court, and its nature as being innocent or guilty appears to depend upon the effect to be given to the decisions of this court? We think we would be shirking our responsibility if we should leave it to the executive to do what we believe to be manifest justice in this case, and should stigmatize the-defendant with a conviction for crime when as it appears he was innocent of any real wrong. We think the real question as to the guilt of defendant is to he settled by referring to the doctrine of criminal intent, which has always been held to be of the essence of a crime. 1 Bishop, New *522Ori.min.al Law, sections 205, 285-291b. And justifiable ignorance or mistake has always been taken into account in' determining the criminality of the act. 4 Blackstone, Commentaries, 27; 1 Bishop, New Criminal Law, sections 292-312; Regina v. Prince, L. R. 2 C. C. 154. Bor reasons already pointed out, mere ignorance of law does not excuse, and even ignorance of fact which the statute expressly or impliedly makes it the duty of one acting in reference to the subject-matter regulated by the statute to know and with reference to which he is required to act at his peril will not excuse him. But even as to these strict rules there are pecessary exceptions. If a mistake of fact is due to mistake of law, so that it appears there is no guilty mind, punishment should not be imposed. Rex v. Hall, 3 Carr. & P. 409 (14 E. C. L. 635); Regina v. Reed, 1 Carr. & M. 306 (41 E. C. L. 170); People v. Powell, 63 N. Y. 88; People v. Husband, 36 Mich. 306; Commonwealth v. Stebbins, 8 Gray (Mass.) 492. And no matter how stringently the statute may impose the duty of knowing the facts on which the defendant has relied in a course of conduct that is prohibited, save under certain prescribed conditions, the common-law exceptions which relieve on account of lack of criminal intent due to infancy, insanity, coverture, or necessity are recognized. State v. Cutter, 36 N. J. Law, 125; The Brig William Gray (U. S. C. C.), 1 Paine 16 (Fed. Cas. No. 17,694). These cases are cited not as directly in point for the solution of our present difficulty, but as illustrations of the fact that courts must, especially in the administration of the criminal law, make exceptions in the interest of justice and public policy to rules which it is very essential to maintain in ordinary cases. An exception to the rule that every one is required to know the law is justified, we believe, when, as to the validity of a statute on constitutional grounds, a person has relied upon the expressed *523decisions of the highest court in his state. We do not believe such exception to be against public interest, but rather in the furtherance of justice. This question seems not to have often arisen so as to have been considered in courts of last resort, but we have support in the conclusion we have reached in the cases of State v. Bell, 136 N. C. 674 (49 S. E. 163), and State v. Fulton, 149 N. C. 485 (63 S. E. 145).
That our conclusion in this case may not be misapprehended and relied upon in support of propositions to which-we have no disposition to yield consent, we desire to emphasize the following controlling conditions. This is a criminal case, and therefore involves no conflicting claims as to contractual or property rights. The defendant may be presumed to have acted with knowledge of the fact that the statute now invoked as rendering illegal an act not otherwise wrongful or immoral had been expressly held by this court in cases prosecuted under public authority to be unconstitutional because in excess of legislative power.
The judgment of the trial court is reversed.