delivered the opinion of the court.
The certificate of agreed facts shows the case to be as follows :
In May, 1888, James G-. Field, late Attorney-General of Virginia, whose term of office had expired on the 31st day of December, 1881, applied to the Auditor of Public Accounts for $1,498 for fees alleged to be due him in cases prosecuted during his term in his official capacity, and which had not been paid him. These fees had not been collected during the term of office of the said James G. Field, because the fifth section of chapter 161 of the Code of Virginia, by which they were once authorized, had been repealed before the commencement of his term, and it had been provided in the act repealing the said fifth section, which was approved April 4, 1877, that the salary of the attorney-general should be $3,500 annually, and that he should not receive any fees, perquisites, or rewards whatever in addition to the salary aforesaid for the performance of any official duty; and this act was amended by an act approved March 12, 1878, so as to provide that “the attorney-general shall receive the sum of twenty-five hundred dollars annually for his services, and shall not be entitled to any farther compensation therefor,” which act was approved during his term of office. It being thus provided that the attorney-general should have no fees out of the public treasury other than his salary, they were not drawn by him during the term of his incumbency as attorney-general. But' during his said term, in May, 1878, one C. Thon was convicted in the hustings court of Richmond city of a penal offence, and, upon writ of error here, that judgment was affirmed, and a fee of $20 was taxed in the costs in this court, as is provided by the thirteenth section of chapter 181 of the Code. Thon thereupon made a motion to correct the taxation of the costs here and to strike out the fee of $20 taxed in the costs against, him upon the ground that the law which provided this fee for the attor*28ney-general had been repealed, and that, under the acts cited above of April 4, 1877, and March 12, 1878, the attorney-general was not allowed to receive any other compensation than his salary. This case lingered on the docket of this court until May, 1883, when it was submitted for decision. This court held in that case that, while the attorney-general was not allowed to have any other compensation out of the public treasury, he was entitled to this fee taxed in the costs by the law if recovered from the opposite party by the State; that the second section of chapter 161 of the Code, which directed the clerk, on the final determination of any cause in any court mentioned in that section (this court being so mentioned therein) in which the attorney-general appeared for the State, to certify to the auditor of public accounts the fee of the attorney, which should be paid out of the public treasury, had been repealed, but that the thirteenth section of chapter 181 of the Code, which 'directed the fee to be taxed in the costs in any case, had not been repealed nor amended; that, under that section, the costs must be taxed as heretofore; and denied the motion to correct the taxation of the costs in that case, and was of opinion that the act of March 12, 1878, which was revisory of the salaries of all State officers, provided a salary for the attorney-general, and provided that he should receive no other compensation therefor, referred only to salaries to be paid out of the treasury of the State, and not to fees of officers such as that; that section 11 of chapter 160 of the Code provided that an attorney should be entitled to a fee to the amount which the clerk is authorized to tax in the bill of costs in any suit or for any service as such attorney; and that the sixteenth section of chapter 181 of the Code provided that in a case wherein there is judgment on behalf of the Commonwealth for costs, there shall be taxed in the costs the fees of attorneys and other officers for sendees, etc., as ¿/'such fees or allowances were paid out of the treasury, and that this fee should be paid to him by the sheriff or other officer who may receive said *29costs, unless such person had previously received payment thereof, in which case it should be paid into the treasury. The court said, further, in that case: “ The laws requiring such fees to be taxed for the Commonwealth in any case have never been repealed or amended, and are now in force. He [the appellant Thon] has the costs to pay, whether the fee goes into the treasury of the Commonwealth, or to the attorney-general. The laws directing the fee to be taxed in the costs for the Commonwealth, and that the same shall be paid to the said attorney, have never been repealed. We are of opinion that the amendment to the law, fixing the salary of the attorney-general, does not refer to nor affect this fee to be taxed in the coosts, and that, being so taxed, is to be paid to the attorney-general as the law directs in ease of all attorneys on the winning side in any case.” Thon v. Com., 77 Va. 289.
As soon as this decision was rendered in this case, the then attorney-general, F. S. Blair, who stood in a like relation to this subject, and made a similar and successful demand upon the auditor of public accounts, (Blair v. Marye, 80 Va. 485,) informed the then ex-attorney-general that fees were due him at the treasury, and that he came down to Richmond and demanded of the auditor $1,498, a sum made up of $20 fees in this court and $8 fees in the circuit court of Richmond, only' $92 of which had ever been paid into the treasury, upon the ground that Thon’s Case had decided that these fees should be paid out of the treasury of the State, as directed by section 5 of chapter 161, which had been repealed. There is no justification in Thon’s Case for any such contention. The repeal of the fifth section of chapter 161 was expressly mentioned in Thon’s Case, and it was not held in that case that such fees should be paid out of the State treasury, but the contrary. That case treated only of fees taxed in the costs, and collected of the defeated party for the benefit of the successful party. That case concerned only the fees taxed in the costs under the laws of this State, and the question was whether such fee could *30lawfully be taxed in the costs and collected of the unsuccessful party, and the question to whom it belonged having been so taxed and collected. In deciding that the defeated party must pay this fee, and that it should be paid to the attorney when so collected, the court gave no intimation, and could give none, concerning fees never collected, and still less did it hold anything concerning the payment by the Commonwealth of additional fees and allowances to the attorney-general out of the public treasury. These sums, then, were demanded by the defendant in error, and paid to him out of the treasury of the State, without any lawful authority. Indeed, there can be no real controversy over that question, as the law expressly provides that the attorney-general shall not receive any other allowance out of the treasury than the salary provided by law. And the defendant in error, having drawn the sum of $1,406 out of the treasury of the State illegally, upon what principle could the Circuit court of Richmond hold that he should not be required to pay this money back at the suit of the Commonwealth ?
The auditor paid the money as the agent of the State, without any authority in the law. He is authorized to pay nothing-out of the treasury of the State except in pursuance of law. It is not necessary, for the purposes of this action, that there should have been any bad faith in the transaction, and it is not claimed by the counsel for the State that there was any such bad faith. The defendant received money from the plaintiff to which he had no lawful claim whatever. "When money has been illegally extorted from an agent in the course of his employment, the principal may recover it back, and the agent may maintain the suit from the authority of the principal, and the principal may recover it back, as proving it paid by the .agent. “Indeed,” says Mr. Story, “if an agent pays money for his principal, by mistake or otherwise, which he ought not to have paid, the agent, as well as the principal, may maintain an action to recover it back. H an agent pays money under a *31mistake of fact for his principal, the latter may recover it back from the party who has received it, and if the money he paid under a mistake as to the legal obligation of his principal, it may be recovered back.” Story, Ag. §§ 398, 435. As was said by Lord Mansfield, in Stevenson v. Mortimer, Cowp., 806, when a man pays money by his agent which ought not to have been paid, either agent or principal may bring an action to recover it back.
In the case of U. S. v. Bartlett, Davies, 9, the court said: “ The act of the agent is not considered as the act of the principal, except when it is within the limits of his authority. But in this case the authority of the agent, and his instructions, are found in the public laws, which the defendants, like all Other persons, are hound to know. There is therefore no pretence for saying that the act of the agent is binding on the principal, unless it is fairly within the limits of his authority.” And again: “ But, however it may he when the money is paid by the supposed debtor, no case that I am aware of has gone so far as to .decide that- an unauthorized payment by an agent, from an erroneous opinion of the legal obligation of his principal, shall he binding on the principal, and that he cannot recover back money thus unduly paid.”
In the case of Ex parte Moulton v. Bennett, 18 Wend., 586, Chief Justice Uelson, speaking of an attorney who had demanded illegal fees from his client, who had paid them under a mistake as to his obligation to do so, and after saying that the attorney had honestly claimed them, said: “ This, however, by no means determines his title to them. It exempts him from blame. He still has money in his hands, the property of another. He has claimed and received it for professional services of a party who owed him nothing for those services, and to whom he had no right to charge them. So far as respects the duty or obligation to refund, it seems to me to he as strong and binding as if the fees had been dishonestly exacted. As an abstract question of property, there is no difference.
*32“I lay out of the case the technical maxim of the law, ignorantia juris non excusat, as not applicable to attorney and client, or attorney and party, in respect to claims for professional services, founded upon statute regulations. The profession and privileges of an attorney give color to such a claim, and the means of enforcing it which do not belong to laymen, nor enter into the business or ordinary dealings of men. The reason of the rule does not apply. To allow him to set up the maxim, volenti non fit injuria, • in such a case, and intrench himself behind it, conceding they have been exacted without law, would he disregarding the principle, spirit, and purpose of the numerous statutes on this subject.” And we think it would he disregarding our laws to allow either the auditor in paying, or the counsel for the State in receiving illegal fees, to find refuge behind any such principle. To pay the salary fixed by law to any public officer, or to pay any fee, perquisite, or allowance, prescribed by law to any person is a purely ministerial duty; and the auditor cannot pay an illegal fee nor pay an illegal amount to any person, either more or less than the law prescribes, without being liable himself to an action therefor. Allen v. Com., 83 Va., 94. And a person receiving any such illegal fee or allowance is liable to an action to recover it hack on the part of the State or the authorized agent of the State. And in this there is no hardship if the rights of all are to he equally respected, and no sound objection can be urged thereto. All must be supposed to know, and must be bound by the® public laiv, and no advantage should he allowed to any person because he has violated the law of the land, or gained, however honestly, an illegal allowance.
In the case of Dew v. Parsons, decided in the court of king’s bench in 1819, reported in 2 Barn. & Ald., 562, it was decided that when a sheriff claimed a larger fee than he was entitled to by law, and the attorney paid it in ignorance of the law, held, that the latter might maintain money had and received for the excess paid above the legal fee, or might set off the *33same in an action by the sheriff against him. See the opinions of Abbott, C. J., and Holroyd and Best, JJ.
"We think the sum of $1,406 was illegally paid to the defendant in error by the auditor, and received by the defendant in error without authority of law, and that the commonwealth is entitled to recover the same back in this action. And we think the circuit court of Bichmond city erred in rendering; judgment for the defendant, and the said judgment is reversed' and annulled; and such judgment will be rendered here as the said circuit court of Bichmond city should have rendered.
Fauntleroy, J., dissented.
Judgment reversed.