Ladd, J.
Plaintiff, as its name indicates, is a national banking association and sues for itself and in behalf of its stockholders. The stockholders also are made party plaintiffs. The shares of stock were regularly assessed under Sec. 1322 of the Code in each of four successive years beginning *503with 1907 and taxes levied thereon and paid by the bank. On January 19, 1911, the statute mentioned was declared invalid for that it was in violation of Sec. 5219 of the revised statutes of the United States prohibiting any discrimination in favor of other moneyed capital in the hands of individual citizens of the state, which comes in competition with the business of national banks. First National Bank of Estherville v. City Council of Estherville, 150 Iowa 95. In virtue of this decision, neither the shares nor the capital of national banks were assessable under the laws of this state. On May 9, 1912, and after the taxes had been distributed to the several funds for which collected, the plaintiff bank for itself and stockholders made a written demand upon the board of supervisors to direct the county treasurer to refund the several sums exacted and collected by him as taxes levied as aforesaid on the shares of capital stock; and as such demand was rejected, this suit in mandamus was begun to compel the said board to so direct the treasurer. Plaintiff relies on Sec. 1417 of the Code, providing that “The board of supervisors shall direct the treasurer to refund to the taxpayer any tax or portion thereof found to have been erroneously or illegally exacted or paid with all interest and costs actually paid thereon.”
The defendant resisted on several grounds which will appear as we proceed.
1' megirtax'es: duty of supervisors. I. The manifest design of this statute is that the board of supervisors first ascertain whether the taxpayer is entitled to be reimbursed for taxes illegally or erroneously exacted and if so, that the treasurer be directed to repay the same from the several funds to which these have passed. Such was the interpretation given in Iowa Ry. Land Co. v. Woodbury Co., 64 Iowa 212, where recovery against the county was denied, and this decision was followed in Everly v. Jasper County, 72 Iowa 149. It is the duty of the treasurer only to repay from the particular funds into which the taxes have gone and, when necessary, to ascertain by computation the *504amount to be taken from each. District Township of Spencer v. District Township of Riverton, 56 Iowa 85. The result attained is the restoration of the moneys illegally or erroneously paid by the taxpayer, and each fund continues as though these had never been collected. The remedy is perfect.
2. Mandamos : refund of taxes : duty of boards of supervisors. II. The duty of the board of supervisors is equally explicit. Having ascertained that the taxes have beén illegally or erroneously exacted or paid, the statute prescribes precisely what shall be done, i. e., the board shall „ , direct the treasurer to refund them to the taxpayer. Such an order is essential to repay-x r * ment by the treasurer and to enter it, in a proper case, is the mandatory duty of the board of supervisors. That there is no adequate remedy at law sufficiently appears from the cases cited and as the contention is that the board of supervisors omitted a duty the performance of which the law enjoins, mandamus is the proper remedy. Section 4341, et seq., Code; Everly v. Jasper Co., supra; See Beecher v. County of Clay, 52 Iowa 140; The Dubuque & S. C. Ry. Co. v. Board of Supervisors, 40 Iowa 16.
illegal tax: voluntary pay* ment: duty to repay. III. The taxes were voluntarily paid as contended, but this furnishes no objection to refunding under this statute. Lauman v. Des Moines Co., 29 Iowa 310: Richards v. Wapello Co., 48 Iowa 507; Isbell v. Crawford Co., 40 Iowa 102.
4 taxation • payment?1'[e. covery. Nor is there anything in the argument that the decision declaring the taxing statute invalid should not operate retroactively. The statute was as vulnerable when enacted as when denounced as void in The First National Bank of Estherville v. City Council of Estherville, supra, and nothing can be found in State v. O’Neill, 147 Iowa 513, to the contrary. That the statute, though at all times void, had been unassailed up to that time does not render the previous exactions any the less illegal, but may excuse the plaintiff in acquiescing therein.
*505
5. Taxation : Illegal tax: duty to return : refinements to avoid.
*504The suggestion that the moneys paid ought not to be *505regarded as taxes within the meaning of the statute is without merit. They were levied and collected through the exercise of the taxing power of the state and to be used generally as other taxes. They were paid as such, and to hold that because illegally exacted moneys so paid are not contemplated as ‘taxes” in the statute quoted would involve a refinement of reasoning not to be indulged in. In referring to taxes as illegally exacted, reference necessarily is had to those which ought not to have been collected. Kehe v. Black Hawk Co., 125 Iowa 549, relied on, contains nothing to the contrary, especially as there was no assessment of property in that case. The point is not well taken.
illegal tax': duty to repay: mistake oí law. IV. Counsel argue that inasmuch as the taxes were paid under mistake of law, the suit cannot be maintained. That this is the general rule goes without saying. Ahlers v. City of Estherville, 130 Iowa 272. But See. 1417 of the Code heretofore quoted expressly dedares that if illegally or erroneously exacted . J or paid, the treasurer shall be directed to refund. Surely if the assessment of the property and levy of taxes thereon was contrary to law, because not authorized by a valid statute, the exaction of the taxes so levied would be illegal, and so regardless of the view thereof entertained by public officers.
In Dubuque & S. C. Ry. Co. v. Board of Supervisors, 40 Iowa 16, the taxes sought to be refunded had been properly levied but the plaintiff had paid them under the mistaken belief that it had title to the property taxed when in fact it belonged to another. In denying relief, the court, after saying that recovery might not be had but for See. 762 of the Revision, continued: “This section does not contemplate an error of judgment as to the law respecting the title to the land, committed by the taxpayer. It was not intended to protect him against errors or mistakes of law committed by himself but against errors and illegalities committed by the *506officers of the law to whom is entrusted the duties of assessing, levying and collecting taxes.”
In Kehe v. Black Hawk County, 125 Iowa 549, the amount for which Kehe would have been liable for taxes had he not withheld his property from taxation was settled by him with the tax ferret and paid to the county treasurer without an assessment having been made, and it was held that though the statute of limitations had run against a portion of it and payment might not have been enforced, still as payment was through no fault of the officers, but owing to an error on his part, the statute afforded him no relief. The precise point was decided in Lauman v. Board of Supervisors, 29 Iowa 310, where the court held that taxes paid on shares of the capital stock of a national bank should be refunded under Sec. 762 of the Bevision, in substance like the present statute, a previous decision, Hubbard v. Board of Supervisors, 23 Iowa 130, having declared statutes taxing the same invalid because inconsistent with provisions of the National Banking Act. The mistake of law which will not sustain an order for relief is that of plaintiff alone; the illegality or error which will sustain such relief must be that of the taxing officers; and if what they do appears to be illegal or erroneous, the statute in the plainest terms requires the board of supervisors to , refund taxes exacted or paid by reason thereof. The collection or receipt of taxes on property which the law did not subject Ito taxation was illegal and such as the statute quoted contemplates shall be refunded.
t. taxationerty°SiHegai tax: recovery. V. Counsel contend that because of having listed the bank stock with and furnishing the assessor the information exacted by Sec. 1322 of the Code without objection, the plaintiff is estopped from asserting the illegality of the taxes subsequently paid. That such is the. TO|e where the owner voluntarily lists taxable property for assessment and taxation appears from Slimmer v. Chickasaw County, 140 Iowa 448. But such a submission of property not taxable confers no authority on the taxing *507officers to assess or levy a tax thereon, and being without authority so to do, the taxpayer cannot be estopped by such listing from asserting such want of authority or the illegality of taxes levied and collected thereon. In such a ease, the taxing officers cannot be said to have been misled by what the taxpayer may have done, for they are chargeable with knowledge of the law and must be assumed to have been aware of the invalidity of the taxing statute. As a fact, however, all were laboring under a misapprehension in construing the statute as valid, else the shares of stock would not have been assessed, and this statute affords a remedy to those who aid the assessor and promptly meet the apparent demands of the public by providing for refunding them if afterwards they are found to have been illegal.
We are of opinion that as the property was not taxable the doctrine of estoppel ought not to be applied. The decree has our approval and is — Affirmed.
Deemer, C. J., Gaynor and Salinger, JJ., concur.