after stating the facts, delivered the opinion of the court.
1. The principal question for determination is whether, in case land sold under a decree of foreclosure is in possession of a tenant holding under an unexpired lease made by the owner of the property subsequent to the execution of the mortgage, the * purchaser thereof is entitled to the rent, or the value ofThe use and occupation thu promiaoc from tbe d.av of sale, notwithstanding the tenant, iu accordance with the terms of-his, lease^ nas paid the rent in advance to his lessor. The defendant’s Oriel contains a discussion of the rights at common law of a mortgagor, mortgagee, and a tenant of the mortgaged premises; and it is insisted that under our statute a tenant in possession of property at the time of a judicial sale, holding under an onexpired lease, stands in the same position, and is entitled to the same rights, as the lessee of mortgaged property at common law holding under a lease executed prior to the mortgage. But *483we are not dealing with the rights of a mortgagee and a tenant of the mortgaged property, but with those of a purchaser at a judicial sale and one in possession, holding under an unexpired lease. The fact that in this particular case the purchaser happens to be the mortgagee is a mere incident, and has no effect on the question involved. In our opinion, the question for decision is plainly settled by the statute. Section 30?, Hill’s Ann. Laws, provides that a purchaser of land at a judicial or execution sale, from the day of sale until a resale or redemption shall be entitled to the possession, unless the same be in the possession of a tenant holding under an unexpired lease, in which case he shall be “entitled to receive from the tenants the rents or the value of the use and occupation thereof during the saíne period.” Under this statute purchaser is entitled either to the possession of the property, or to the value of tire use and occupanon thereof from the day of sale/until a resale or redemption. If at the time of the sale tbe property is not in possession of a tenant holding under an unexpired lease, he is entitled to the immediate possession; but, if it is in possession of such a tenant, he is then entitled to the rents, or the value of the use an occupation thereof, for the same time. No contract of a mort gagor made s chaser of the resulisTromthe principle that mortgaged premises is subject to the prior mortgage, and the interest acquired by the grantee or lessee therein is subject to, be defeated by a subsequent foreclosure and sale. In this üase the plaintiff’s mortgage was on record at the time the lease was made to the defendant, and he had at least constructive notice of the rights of the plaintiff thereunder, and must be held to have accepted his lease and paid the rent in advance with knowledge of the fact that in case of a foreclosure and sale the purchaser would be entitled to the rents from the day of sale. The defendant’s lessor was not entitled to the rent of the premises after the day of sale, and it therefore can be no defense to the defendant that he paid it to him, whether before or after that time. “If,” as said by the Supreme Court of California, “the' rights given himby statute. This necessarily! a subsequent lease or grant of *484law were otherwise, it would be in the power of the mortgagor to materially diminish the value of the mortgaged property as security for the debt for which mortgage was given by simply leasing it for a long period, and collecting the rent in advance, or by leasing it for such period for a nominal rent”: Harris v. Foster, 97 Cal. 292 (32 Pac. 246, 33 Am. St. Rep. 187). If the mortgagor or his successor in interest could, by leasing mortgaged premises and collecting the rent in advance, deprive the purchaser at the foreclosure sale of the value of the use and occupation during that time, there would be no limit to his right (in the premises, and he could make such a lease for any length of time he might think proper. To permit him to do so would practically be annulling the statute, and would be contrary to the interpretation of similar statutes by other courts: McDevitt v. Sullivan, 8 Cal. 592; Walker v. McCusker, 71 Cal. 594 (12 Pac. 723); Harris v. Foster, 97 Cal. 292 (33 Am. St. Rep. 187, 32 Pac. 246); Byers v. Rothschild, 11 Wash. 296 (39 Pac. 688). We are of the opinion, therefore,- that plaintiff is entitled to judgment against the. defendant for the rent of the rooms occupied by him from the day of sale.
2. As the amount sued for is less than $50, the judgment in favor of plaintiff, however, for costs and disbursements is erroneous. In an action of this kind the plaintiff is not entitled to costs unless he shall recover $50 or more (Hill’s Ann. Laws, § 549), and, unless he does recover judgment for that amount, the defendant is entitled to costs as a matter of course: Hill’s Ann. Laws, § 551.
The judgment appealed from will therefore be reversed as to the matter of costs, and the cause remanded to the court below, with directions to enter judgment in favor of the plaintiff for $20.32, as rent for the premises sued for, and in favor of the defendant for his costs and disbursements in the lower court. Reversed as to Costs.