
393 P.2d 451 (1964)
74 N.M. 339
STATE of New Mexico ex rel. Joe CALLAWAY, State Treasurer, Plaintiff-Appellant,
v.
Jay M. AXTELL et al., Defendants-Appellees.
No. 7313.
Supreme Court of New Mexico.
March 9, 1964.
Rehearing Denied July 15, 1964.
*452 Earl E. Hartley, Atty. Gen., Oliver E. Payne, F. Harlan Flint, Asst. Attys. Gen., Santa Fe, for appellant.
Seth, Montgomery, Federici & Andrews, Melvin T. Yost, Santa Fe, J.D. Weir, Las Cruces, for appellees.
CARMODY, Justice.
The state appeals from the action of the trial court in sustaining a motion to dismiss its complaint.
The basic question at issue is: May a gratuity, paid by the state but subsequently determined to have been granted unconstitutionally, be recovered back from the recipient?
For a proper understanding of the case, it is necessary to briefly discuss State ex rel. Mechem v. Hannah, 1957, 63 N.M. 110, 314 P.2d 714. That case was an original proceeding in mandamus, wherein we held that ch. 22 of the Session Laws of 1957 was in violation of art. IX, § 14, of the Constitution of New Mexico. The particular act then before the court appropriated state funds, to be used in cooperation with the United States Department of Agriculture, to pay the state's share of a revolving fund which was utilized to pay for emergency hay and roughage certificates issued to livestock owners. In substance, the Hannah decision adjudged the statute to be unconstitutional because it attempted to donate public funds to private individuals who were neither indigents nor paupers. The Hannah case considered the same basic facts that are before us in the instant case. In that opinion, the same contract between the State of New Mexico and the United States Department of Agriculture with which we are here concerned is discussed in some detail. There is no need to repeat the pertinent provisions of the contract which are set out in Hannah, nor the provisions of the certificate which had to be executed before an applicant could receive hay or roughage. The only part of this instrument that is not mentioned in Hannah is the latter portion which might be termed a "sight draft." Its purpose was to allow the seller of hay or grain to be paid through the First National Bank of Santa Fe, after the farmer or rancher had received delivery of the hay or roughage claimed to be required. Thus it appears from the record that no funds were paid directly to the farmer or rancher, and that any state money was used together with matching federal funds to pay the seller of the feed. With this additional explanation, the reader *453 need only refer to the facts stated in Hannah, considering, of course, that in the instant case the question of the constitutionality of the 1957 act is not at issue.
From a practical standpoint, the real difference between Hannah and the case before us is that, in Hannah, the court refused to allow the expenditure of illegally appropriated funds, while here recovery is sought from those who benefited from the illegal expenditure of funds which had been properly appropriated. In this connection, it should be noted that the funds at issue here were appropriated by ch. 185 of the Session Laws of 1955, which was an act establishing a fund for general disaster relief, and its constitutionality is not here questioned.
In July, 1961, the attorney general, relying on Hannah, made demand upon appellees for restitution of the monies which they had received under the Cooperative Roughage Emergency Program. When restitution was not made, this case was filed. Appellees did not answer, but filed a motion to dismiss for failure to state a claim, and it is from the sustaining of this motion that the state appeals. The complaint alleged, in substance, that each of the appellees had received directly, or that there had been paid on their behalf to their benefit, certain stated sums of money, thereby allowing appellees to participate in the "hay program," and that the sums were paid by warrant from the office of the state treasurer either to or on behalf of each appellee, and that the payments were made from state and public funds without authority, under a void and unconstitutional act; that demands for restitution had been made and refused.
Prior to the hearing on the motion, it was stipulated that all the payments of the public funds sought to be recovered were paid out pursuant to authority of a prior legislative enactment, for a purpose which was subsequently declared to be unconstitutional in the Hannah case, but that none of the money was paid out under the act involved in the Hannah decision and that all the money was paid prior thereto.
The trial court, in its letter of decision, announcing its ruling on the motion to dismiss, stated that it felt bound by the decision in Territory v. Newhall, 1909, 15 N.M. 141, 103 P. 982, and that it had no choice but to follow the rule therein enunciated. The gist of the state's claim is that the state may recover back public monies paid under mistake of law, irrespective of the good faith of the payor and the payee. Appellees controvert this contention on the basis (1) that by judicial precedent (Territory v. Newhall), public monies, voluntarily paid in good faith and under mistake of law, may not be recovered absent fraud, duress, or mistake of fact, and (2) that this is particularly true where the payments or benefits were made pursuant to a prior legislative enactment for a purpose which was subsequently judicially held to be in contravention of the constitution.
It should be stressed that there is no attack here made upon the 1955 Act, it merely being claimed that the funds appropriated under that act were used for a purpose found to be unconstitutional after the expenditure of the funds. It must also be kept in mind that it appears from the pleadings and the stipulation that the appellees received a gratuity, not of the funds but only the benefit therefrom, under the cooperative agreement between the state and the federal government.
Territory v. Newhall, supra, was decided by the Supreme Court of the Territory in 1909. Although it does not appear in the New Mexico Reports, the decision was concurred in by a majority of the then justices. In substance, Newhall decided that "[a] voluntary payment, made with a full knowledge of all the facts and circumstances of the case, though made under a mistaken view of the law, cannot be revoked, and the monies so paid cannot be recovered back." In making this pronouncement, the court relied upon the few cases cited in the opinion, which involved payments made by individuals, not the state, and, in an apparent *454 effort to bolster the holding, referred to 30 Cyc. 1313, wherein the rule was stated that a voluntary payment, made under mistake or ignorance of the law but with full knowledge of all the facts, cannot be recovered back and that this applies to a corporation as well as to a natural person. In this pronouncement, the territorial court followed what was, at least at that time, considered to be the general rule of law as to the recovery of money paid under mistake of law by private individuals. However, the court apparently overlooked the fact that, even at the time of its decision, many courts made an exception to the rule with respect to public funds. This exception is noted in 30 Cyc. 1315, although this apparently was not called to the attention of the court. We would also observe that, some three years before the decision in Newhall, this court allowed recovery under the same facts as appeared in Newhall. See Hubbell v. Board of County Commissioners, 1906, 13 N.M. 546, 86 P. 430. Although the Hubbell opinion was the basis upon which the Newhall case arose, there is no explanation in the Newhall case as to why a different result was achieved.
We realize that appellees seriously urge that the Newhall case was followed in Staplin v. Vesely, 1937, 41 N.M. 543, 72 P.2d 7. Suffice it to say, however, that the Staplin case did not involve the payment of public funds and is not contrary to the rule herein announced.
Although the doctrine of stare decisis is one of the foundations of our system of jurisprudence, courts are not reluctant to overrule or modify prior decisions where it is clearly shown that they are erroneous. Stuart v. Pilgrim, 1956, 247 Iowa 709, 74 N.W.2d 212; Herald Publishing Company v. Bill, 1955, 142 Conn. 53, 111 A.2d 4; and Hanks v. McDanell, 1948, 307 Ky. 243, 210 S.W.2d 784, 17 A.L.R.2d 1.
In our judgment, the broad rule stated in Newhall is erroneous and the decision must be modified, though we should not be considered as casting any doubt as to the rule of law relating to the recovery of monies paid under mistake of law by private parties (that question in no sense being before us). However, the general rule is subject to an exception where public monies are involved. In this respect, the Newhall decision is modified. Public monies are trust funds belonging to the people, and must be reimbursed by the recipient if they are paid out illegally by a public official, even though in good faith; and this is particularly true in a case such as that before us, involving a donation or gratuity. There is no contention that any of the officials involved had motives other than the utmost good faith. Neither they nor the appellees knew at the time the funds were expended that the payment was illegal  this knowledge had to await the decision of this court in Hannah.
The rule simply stated is:
"Payments of public money by officials made under a mistake of law may be recovered."
5 Williston on Contracts, rev. ed., § 1590. Such a rule, although differently worded, is followed in practically every jurisdiction throughout the country. See 3 Corbin on Contracts, § 617, and cases cited in footnote 65; and Restatement of the Law, Restitution, § 46(a), and cases cited in the reporter's notes. It is of interest to note that approximately forty courts of last resort follow the rule, although in some cases it is not always applied under all circumstances. In at least nine jurisdictions, which had initially followed the rule of no recovery under mistake of law, the courts have found it necessary to either directly or impliedly overrule earlier decisions, in order that a state or subdivision may recover funds paid under mistake of law. See Aebli v. Board of Education, 1944, 62 Cal. App.2d 706, 145 P.2d 601; Hawthorne Park Dist. v. Seipp Princell & Co., 1936, 286 Ill. App. 599, 4 N.E.2d 117; Board of Com'rs of Huntington County v. Heaston, 1895, 144 Ind. 583, 41 N.E. 457, 43 N.E. 651; State v. Young, 1907, 134 Iowa 505, 110 N.W. 292; Inhabitants of City of Biddeford v. Benoit, 1929, 128 Me. 240, 147 *455 A. 151; County of Wayne v. Reynolds, 1901, 126 Mich. 231, 85 N.W. 574; State v. Weatherby, 1939, 344 Mo. 848, 129 S.W. 2d 887; Opinion of the Justices, 1961, 103 N.H. 508, 175 A.2d 396; and New York City Employees' Retirement System v. Eliot, 1935, 267 N.Y. 193, 196 N.E. 23. The recognition of the exception by the Missouri court (State v. Weatherby, supra, and cases cited therein) is of particular import because the Newhall case gave great weight to the older Missouri cases which had applied the general rule.
Actually, our research discloses that there is only one state which still fails to recognize the exception to the rule of non-recovery  this is Ohio (State ex rel. Dickman v. Defenbacher, 1949, 151 Ohio St. 391, 86 N.E.2d 5); although perhaps Florida should be placed in the same category (see Jefferson County v. Hawkins, 1887, 23 Fla. 223, 2 So. 362; and see Cary v. State, 1939, 138 Fla. 679, 190 So. 49, for a later affirmation of their rule). We do observe that there are some other jurisdictions where the exception is applied but which refuse recovery under certain circumstances. These cases will be discussed hereinafter, as they are the ones relied upon by appellees.
Having determined that public monies, paid under mistake of law, may be recovered, we proceed to appellees' alternative argument, this being, in substance, that appellees should not be required to refund the payments or benefits which were paid out under a valid legislative enactment but in a manner subsequently held to be unconstitutional. In essence, this contention is that even though the benefit was an unconstitutional one, as long as neither the state officials nor the donees knew at the time that it was illegal, the money cannot be recovered. On this particular subject there is little direct authority, although a few cases hereinafter mentioned point the way.
There are cases relied upon by appellees which, it is claimed, support their position, but we find them to be distinguishable. Thus, in Austin v. Campbell, 1962, 91 Ariz. 195, 370 P.2d 769, the court refused to allow an action by a taxpayer brought to recover reimbursement expenses paid to state legislators, the statute allowing the same having been declared unconstitutional. The case did not state that public money could never be recovered, but merely held that, in the particular instance involved, a cause of action was not stated. The Arizona court was undoubtedly moved in its decision by its consideration of the separation of powers provision under the state constitution.
In three cases arising in Tennessee, Roberts v. Roane County, 1929, 160 Tenn. 109, 23 S.W.2d 239; State for Use and Benefit of Lawrence County v. Hobbs, 1952, 194 Tenn. 323, 250 S.W.2d 549; and Bayless v. Knox County, 1955, 199 Tenn. 268, 286 S.W.2d 579, the court refused to order the repayment of certain salaries and fees which had been determined to be unconstitutional, on the basis that the services had actually been performed.
Wichita County v. Robinson, 1954, 155 Tex. 1, 276 S.W.2d 509, was also a case in which a service had actually been rendered.
State v. Village of Garden City, 1953, 74 Idaho 513, 265 P.2d 328, was a proceeding seeking to enjoin the operation of slot machines following a decision that a statute authorizing them was unconstitutional. The trial court, in addition to granting the injunction, had ordered the places of business closed. The supreme court affirmed, except that it refused to enforce the penalty of closing various places of business because it said no person should be penalized for operating under a statute which is later declared unconstitutional. The difference between a refusal to enforce a penalty for an operation thought to be valid and the requirement that a donation be refunded is too obvious to require discussion.
Tobin v. Town Council of Town of City of Sundance, 1933, 45 Wyo. 219, 17 P.2d 666, 84 A.L.R. 902, involved an illegal contract, *456 the same not having been let by competitive bidding. Half of the contract price had already been paid and the contractor sued for the balance. The town counterclaimed for the payment already made, on the basis of the illegality of the contract. The court refused to direct a refund of the monies already paid, because the defendant had retained the benefits it had received, although the court did refuse to grant judgment in favor of the contractor for the balance.
Arizona, Tennessee, Idaho, Wyoming and Texas all recognize the right of the state to recover payments made under mistake of law. Austin v. Barrett, 1932, 41 Ariz. 138, 16 P.2d 12; Roberts v. Roane County, supra; Ada County v. Gess, 1895, 4 Idaho 611, 43 P. 71; Tobin v. Town Council of Town of City of Sundance, supra; Day Land & Cattle Co. v. State, 1887, 68 Tex. 526, 4 S.W. 865; see Nunn-Warren Pub. Co. v. Hutchinson County (Tex.Civ.App. 1932), 45 S.W.2d 651, writ refused. Therefore, the cases relied on by appellees merely constitute a deviation from the rule as generally applied.
Appellees lastly rely on Missouri Utilities Co. v. City of California (C.D.Mo. 1934), 8 F. Supp. 454. Appellees do not claim that the case is directly in point, but rely strongly upon the language contained in the United States District Judge's opinion. Without going into detail, it would initially seem that the opinion does support the appellees. However, the case is really not a suit based upon the theory of recovery of money, and, even if it were, the court very pointedly notes that it is not discussing any form of a gratuity but rather the payment of money by the United States government received by the City of California upon very definite and onerous conditions which had been performed.
This latter case is apparently almost directly contrary to another United States District Court case, United States v. Hagan, Cushing Co. (C.D.Idaho 1939), 29 F. Supp. 564, in which it was held that the United States government could recover an amount of processing tax which had been paid under an unconstitutional act as part of the price of goods purchased. In this case, the court clearly held that the government is not bound by unauthorized payments by its officers under a misconstruction of the law. The opinion in the Hagan, Cushing Company case was on a motion to dismiss, and, unfortunately, was not subsequently ruled upon in the circuit court because, upon trial, the issues were determined adversely to the United States. See United States v. Hagan & Cushing Co. (9th Cir.1940), 115 F.2d 849. However, the theory announced by District Judge Cavanah is the same as that which was subsequently announced by the United States Supreme Court in United States v. Kansas Flour Mills Corp., 1941, 314 U.S. 212, 62 S.Ct. 232, 86 L.Ed. 159; see also United States v. American Packing & Provision Co. (10 Cir.1941), 122 F.2d 445, cert. den. 314 U.S. 694, 62 S.Ct. 364, 86 L.Ed. 555; Compare J.W. Bateson Co. v. United States (5th Cir.1962), 308 F.2d 510.
The decisions of several state courts have also reached results contrary to those announced in the cases relied upon by appellees. See Opinion of the Justices, 1961, 103 N.H. 508, 175 A.2d 396; T.J.W. Corporation v. Board of Higher Education, 1937, 251 App.Div. 405, 296 N.Y.S. 693; Ellis v. Board of State Auditors, 1895, 107 Mich. 528, 65 N.W. 577; Mobile County v. Williams, 1913, 180 Ala. 639, 61 So. 963; City of Demopolis v. Marengo County, 1915, 195 Ala. 214, 70 So. 275.
In any event, we would observe that the cases relied upon by the appellees mainly involved attempts, under laws found to be unconstitutional, to recover monies paid in good faith after the services had been rendered. The cases mentioned are distinguishable and cannot be compared with a situation in which there is an outright gift. Appellees argue that if funds received under laws subsequently determined to be unconstitutional must be refunded to the state, that it will, in effect, require every citizen to act at his own peril, even though he *457 will have no advance notice that the statute is unconstitutional. Appellees urge that this type of a rule would destroy the confidence of citizens. Although we have considerable doubt that the calamitous results contemplated will follow, we are not here called upon to determine what might be the effect in the various situations contemplated by the appellees. Naturally, laws are presumed to be constitutional, but appellees cannot be heard to complain when they were in no sense required to apply for the certificates. The gift was not forced upon them  they requested it.
There seems to be, as a part of appellees' argument, the underlying contention that inasmuch as they did not receive any money directly from the state, they therefore should not be required to refund anything. The answer is, of course, contained in Hannah, where we held the appropriation was unconstitutional, though it was for the same identical purpose as here. If the appropriation to the fund was invalid, so also are the disbursements made to the fund. Appellees received the benefit of the state's money in the fund, and whether it was "in cash or in kind" makes no difference. It was still an outright donation made in violation of the constitution.
We again reiterate that there is no question of the good faith of all the parties involved. We realize, as was said in Hannah, that, basically, the payments to the fund for the benefit of the ranchers and farmers was for the general benefit of the state; but, unfortunately, it was and is unconstitutional as a donation of funds to private individuals who are neither indigents nor paupers.
Appellees also assert certain matters in claimed defense of the action. As we understand, there is some claim of estoppel, change of position on the part of the appellees, or perhaps other equitable defenses. These are not included in the motion to dismiss, but matters of defense which may, of course, be set up by answer. As to whether or not these, or any defenses, are available as against the state in this particular proceeding, we decline to express any opinion.
The order of dismissal was improvidently entered and the case is reversed, with direction to the trial court to overrule the motion to dismiss and proceed in a manner not inconsistent herewith. It is so ordered.
COMPTON, C.J., and CHAVEZ, NOBLE and MOISE, JJ., concur.
