The learned counsel for the respondent attack the validity of the law above quoted [ch. 278, Laws of 1883] —first, as a violation of the rule of equality and as class legislation, in that it applies a different rule to actions brought by the owners of the particular lands mentioned in said chapter than is applied to the owners of other lands within the state; and, second, as a violation of sec. 9 of article I of the constitution of this state, and also of sec. 1 of the XIYth amendment to the constitution of the United States, which provides that “no state shall . . . deny to any person within its jurisdiction the equal protection of the laws.” Upon these questions the learned counsel for the respondent has submitted a very learned and able argument; but, after a careful consideration of the subject, we are not convinced that the law is a violation of any of the constitutional provisions above stated, or of any fundamental rule of right, so far as the law acts prospectively. The object of the statute is, undoubtedly, to protect those Avho claim a certain class of lands by patent from the state, and who, upon the faith of such patent, may have paid the taxes assessed thereon by the state while the same was held under such patent, against the claim of any other persons whose title is claimed to be better and paramount to the title under the state patent, and who have, in the mean time, failed to pay the taxes lawfully assessed thereon. The purpose of the statute is admitted to be a proper object of legislative action, and it is in itself a just and equitable statute, *469when applied prospectively; but it is claimed to be unjust, and beyond the power of the legislature, when attempted to be applied retrospectively.
It is argued that the legislation is class legislation, because it applies to only one tract of land, which was conveyed, or attempted to be conveyed, to the state by the county of Marathon. Upon its face the act is not so limited, but applies to all lands which may at any time have been conveyed by any county to the state, and by the state sold to any private person or persons. Whether there are in fact any other lands which come within the provisions of the act, except those conveyed by Marathon county, we are unable to say; but it is quite evident that the act covers all lands which have been heretofore so conveyed. The right of the legislature to protect those claiming lands under conveyance from the state, by statutes of limitation peculiar to the class of lands so conveyed, has never been disputed. The whole system of our laws fixing short acts of limitation, both in favor of and against the persons claiming under tax deeds, is based upon this right. The conveyance of lands referred to in the act of 18S3, by any county to the state, and by the state.to private persons, was, as the court may take judicial notice, for the purpose of collecting the taxes due the state which had been assessed upon the same.- It was an attempt on the part of the state and county to collect the taxes lawfully assessed upon said lands, and which the original owners had unjustly neglected and refused to pay. The patent from the state is in fact in the nature of a tax deed, and any act which might be passed for the protection of a person claiming under a tax deed, might with equal propriety be passed for the protection of those claiming under the patent from the state. The legislature of the state has repeatedly passed acts to protect claimants under tax deeds, which were local in their character, having reference only to lands in particular cities and villages. In many cases where *470the city authorities were authorized to sell and convey lands for the nonpayment of city or village taxes, special acts of limitation for particular cities or villages were enacted, and have been always upheld as a proper exercise of the legislative power. The fact, therefore, that the right to lands attempted to be patented is limited to lands in a particular locality, does not in itself render the law objectionable as being unequal and class legislation. Smith v. Ford, 48 Wis., 161, 162.
That the legislature has the power to compel a party attempting to avoid the title of a person claiming under a fax deed simply on the ground of irregularities, and not upon the ground that the tax is unequal and unjust, to deposit the amount of the taxes justly due upon the land at the time of the issuing of the tax deed, as well as those paid ifter such issue by the tax title claimant, has been sustained by this court in the following cases: Wakeley v. Nicholas, 16 Wis., 588, 593-4; Smith v. Smith, 19 Wis., 615; Finney v. Ackerman, 21 Wis., 268; Knight v. Barnes, 25 Wis., 352; Dayton v. Relf, 34 Wis., 86; Philleo v. Hiles, 42 Wis., 527, 531. That this may be required in a strictly legal action, as well as in an equitable one, was also determined by this court. Wakeley v. Nicholas, 16 Wis., 593, 594. In fact, the defense which is permitted only upon the deposit of the taxes which ought to have been paid, by the requirements of sec. 32, ch. 22, Laws of 1859 (sec. 1200, R. S. 1878), is a purely legal defense.
We cannot, therefore, hold ch. 27S, Laws of 1883, unconstitutional and void, simply because it requires the plaintiff to deposit the taxes which have been paid on the lands by the party claiming the same under a patent from the state, as a condition of his right to maintain his action, ’without substantially overruling the decisions of the court above cited. This court has also held that a plaintiff who brings an equitable action to avoid a tax deed for mere irregulari*471ties in the tax proceedings, as being a cloud upon his title, must tender or offer to pay the taxes properly due upon the land, on account of which the tax deed was issued. Hart v. Smith, 44 Wis., 213, 218, and cases there cited; Arnold v. Supervisors, 43 Wis., 627. There can be no doubt as to the power of the legislature to apply this equitable rule established by the courts as a condition to the right of a party to avail himself of his legal right of action to accomplish the same object sought by the equitable action. In fact, the power of the legislature has been exercised to enforce that rule of equity ever since the constitution was adopted, by requiring -the payment of such taxes as a condition of the recovery of the possession of the real estate in controversy, after his right has been established in an action at law. See secs. 3087, 3096, R. S. 1878; sec. 32, ch. 141, R. S. 1858; ch. 270, Laws of 1874; Davis v. Louk, 30 Wis., 308; Blodgett v. Hitt, 29 Wis., 169; Phoenix L. M. & S. Co. v. Sydnor, 39 Wis., 600.
So far, then, as the legislature had the power to require the plaintiff in this action to pay the taxes which had been assessed upon the lands in controversy, and which had been paid by the defendant or by those under whom he claims title, as a condition to the plaintiff’s "right to have possession of the lands delivered to him under the judgment of the court, we are of the opinion that it has the power to make the maintenance of his action depend upon his making a deposit of the money as required by ch. 278, Laws of 1883. We are also of the opinion that the legislature has not the power to impose new burdens upon the original owner which could not have been enforced against him, in some other manner than as required by said ch. 278, under the law as it stood previous to the enactment of said chapter. If there had been no law in existence before the act of 1883 was passed, by virtue of which the plaintiff could have been compelled to pay these taxes before he could *472recover the lands in question from the defendant claiming under the tax deed issued to the county of Marathon, then the legislature could not, by.its mere fiat, create a cause of action in favor of the tax claimant against the original owner; but if there was such a law in existence, then the requirement of the statute of 18S3, that a deposit of the taxes should be made as a condition of the maintenance of his action, was not the creation of a new cause of action or debt against the original owner and in favor of the tax claimant. The new law only goes to the remedy, and not to the right itself. At the time this law was enacted by the legislature, sec. 3096, R. S. 1878, had in substance been in force as a law of this state since 1849 (see sec. 3, ch. 107, R. S. 1849), many years prior to the levy of any of the taxes in controversy in this case, and sec. 3087, R. S. 1878, had been in force since 1874. If it be said that sec. 3, ch. 107, R. S. 1849, and sec. 32, ch. 141, R. S. 1858, wrnre limited to cases where the claimant had been in actual possession of the premises, and had made some improvement thereon, still the justice of the principle of enforcing the payment of taxes paid by the claimant and those under whom he claims, when in possession under a void or imperfect title, is clearly recognized by these laws. The reason for requiring the taxes to be refunded before the original owner would be let into possession after verdict in his favor, was not because the occupant under the imperfect title had in good faith made improvements on the lands to which he claimed title, but because the payment of the taxes was for the benefit of the real owner, and relieved him from the burden of paying the same. And when in the action of ejectment he recovers the lands, and damages for the use and occupation, equity and good conscience require that he should refund to the unfortunate occupier not only the value which has been added to the lands by actual betterments, but also such sums as he had expended in discharging the legitimate taxes as*473sessed thereon, and which were in fact a debt against the real owner of the lands. The difficulty, if there was any, under the old statutes of 1849 and 185S, of compelling the original owner or person having the better title to make compensation in all cases to the defeated party for the taxes paid by him and those under whom he claims, was clearly removed by sec. 3096, R. S. 1878; and it is quite evident from the notes of the revisers that in doing so no substantial change of the law was intended to be made by them, by the language made use of in that section.. Under the amendment of the ejectment act made by ch. 270, Laws of 1874, the original owmer who recovered in ejectment against a person claiming under a tax deed was subjected to the payment of all taxes paid by the defendant, as well as the taxes upon which the tax deed was based. The whole policy of the legislation of this state has been and still is to require the owner of real estate to refund the taxes to the person who has in good faith paid them for his benefit, either by a purchase of the lands at tax sale, or, if, relying upon the validity of a tax deed upon the lands, he has paid the subsequent taxes before sale, before he shall be permitted to possess himself of the land against such tax claimant. And when any law for that purpose has only a prospective action, no one claims that it is not an equitable and just law.
The only objection we find to the law of 1883 is that it is intended to be and is, by its terms, retrospective, and at the same time it imposes a penalty upon the original owner, by charging him with interest upon the taxes paid for his benefit, at the rate of twenty-five per cent, per annum from the day of payment. Previous to this enactment of 1883 there was no law upon the statute book which required the payment of such interest except to a limited extent under sec. 1200, R. S. 1878, and under ch. 270, Laws of 1874, as amended by ch. 305, Laws of 18S0. If a burden of this kind can be imposed upon the owner of real estate by a ret*474roactive statute,- then there would be no limit to the power of the legislature, and they might require the payment of such a percentage of interest upon the taxes paid as to work a complete forfeiture of his estate. It needs no argument or citation of authority to show that the legislature has -no power to impose such a penalty for the nonpayment of taxes to take effect retrospectively. It is, in fact, an attempt to create a debt against A. in favor of S. by a mere act of legislation.
While we are very clear that the legislature had not the power to compel the original owner to deposit the taxes with twenty-five per cent, interest added, as a condition of his right to maintain his action, we think it had the power to require him to make a deposit of the taxes paid with seven per cent, interest, in analogy to the law which requires the payment of such taxes and interest before execution can be had, after judgment in ejectment, under what is now sec. 3096, R. S. 1878. And, as it is clear the legislature intended to change the rule in actions for the recovery of the class of lands in controversy in this action, we think the statute may well be held valid as to the taxes and seven per cent, interest, and void as to the twenty-five per cent, interest.
We are also of the opinion that the statute which prohibits the issuing of a tax deed upon a certificate of sale for taxes, or the maintenance of any action thereon, after the expiration of six years from the day of sale in certain cases, and after the expiration of fifteen years in all cases, does not relieve the original owner from the payment of the taxes upon which such certificates were issued, if they are owned or held by the claimant under a tax deed, or by any person under whom he claims, before he can have execution upon a recovery in ejectment, under the provisions of sec. 3096, R. S. 1878. The language of the section is broad enough to .cover all taxes, no matter when they were paid, and it would seem that there was a clear intent to go back *475of all statutes of limitation by providing that, although in ordinary cases the owner can recover the rents and profits for only six years previous to the commencement of the action, yet he shall be allowed to set off against a claim for taxes paid and improvements made more than six years before the action was commenced, the rents and profits of the land enjoyed by the defendant previous to such six years.. This court, in the cases of Davis v. Louk, 30 Wis., 308, and Pacquette v. Pickness, 19 Wis., 219, held that the law as to the right to set off rents and profits for the time the defendant occupied previous to the six years, against a claim for taxes and betterments made previous to that date, was, as the statute of 1878 declares it to be, under the provisions of secs. 30-33, ch. 141, R. S. 185S.
As we think the defendant in the action at bar must be considered as holding his title under the county of Marathon, the state, and the intermediate grantees of the state, he would be, in the action of ejectment, under sec. 3096, R. S., entitled to have refunded to him all the taxes paid on the lands by the county, state, and his other grantors, before the plaintiff could have exécution, after deducting any judgment the plaintiff might recover for rents and profits, or for damages. So, under ch. 278, Laws of 1883, the court should have ordered the plaintiff to make a deposit of such taxes, with interest at the rate of seven per cent, from the date of payment, as a condition of his maintaining his action, there being nothing in the case tending to show that the taxes assessed and paid were not lawfully assessed and properly chargeable to the lands in controversy. For the reasons above stated we think the order appealed from should be reversed, and that the circuit court should enter an order requiring the plaintiff to make a deposit of the taxes, and legal charges for assessing and collecting the same, and interest at seven per cent., as suggested in this opinion, within such reason*476able time as the court shall fix, as prescribed in sec. 3, ch. 278, Laws of 1883.
By the Coiort.— The order of the circuit court is reversed, and the cause remanded for further proceedings according to law.