This action was commenced in October, 1893. In the original complaint it was alleged, in substance, that the plaintiff is the owner in fee of the quarter section of land described in the complaint; that the defendant on the 13th day of November, 1888, unlawfully took possession of the land, and unlawfully withholds the possession from the plaintiff; that the rents, issues, and profits of the land during the period of defendant’s unlawful occupancy thereof were of the value of $2,000. Said complaint further alleged that the defendant claimed to be the owner of the land under a .certain deed of warranty executed and delivered to him by one James Milne on the 30th day of October, 1888, which deed was properly recorded, but it is alleged that said James Milne, when said deed was made and delivered to defendant, had no legal right to convey the land, and had no title thereto; that the pretended right to convey of said James Milne was based upon an attempted mortgage foreclosure sale of the land made on the 25th day of January, 1886, and pursuant to which sale a sheriff’s deed, dated November 22, 1888, was executed and delivered to Milne, and subsequently recorded; and that said attempted foreclosure sale was made by advertisement under a mortgage covering said land, which was executed and delivered on November 27, 1882, by the plaintiff and her husband, one Donald Finlayson, and which was given to secure the payment of a promissory note for $1,000, becoming due November 1, 1887, with interest payable annually, which note and mortgage were given to one Robert S. Gurd to secure a debt due to thg said Gurd.- The complaint further stated, in effect, that said foreclosure proceedings, including the sheriff’s deed, were illegal and wholly void because the notice of the sale was not published a period of 42 days prior to the date of sale, but that said proceedings, including the deed, being of record, were a cloud upon the plaintiff’s title to the land in suit. By said complaint the plaintiff prayed for relief as follows: For the recovery of the possession of the land, together with $2,000 as and for the value of the use thereof; that the court should by its judgment declare that the defendant had no right or title to the land, and that the plaintiff is the absolute owner thereof; that the said sheriff’s deed to James Milne, and said deed of warranty from Milne to the defendant, be adjudged to be illegal and void; and that the same be canceled of record. To these specific prayers for relief there was added a general prayer for relief in equity, and for plaintiff’s costs and disbursements. To this complaint a general demurrer was interposed for insufficiency, and the district court.sustained the demurrer. On appeal to this court the order sustaining the demurrer was overruled, and the case was in June, 1896, remanded for further proceedings. See Finlayson v. Peterson, 5 N. D. 587, 67 N. W. Rep. 953, 33 L. R. A. 532, 57 Am. St. Rep. 584. On September 28, 1897, an amended *48complaint was filed in the district court, which, in substance, embraced all the allegations of the first complaint, but omitted the allegation that the defendant unlawfully entered upon the land and ousted the plaintiff thereof. In the amended complaint the following facts not contained in the first complaint were, in substance, set out, viz.: That the supreme court had decided that the attempted foreclosure was abortive, and that it would follow from such adjudication that the two deeds based on the foreclosure conveyed no title to the defendant, save and except as, in equity, they operated as an equitable transfer.of the mortgage and mortgage debt and taxes paid by the defendant. This new complaint further alleged that the defendant, since taking possession of the land had leased the same to one Allison for a period of five years, viz., from 1890 to 1894, inclusive, and as and for a rental the defendant had received one-half share of the crops produced on the land during said rental period; that the plaintiff was unable to ascertain the precise aggregate value of said rental received by the defendant; that during the rest of said period of defendants’ occupancy of the land, which began in 1888, and had continued until the date of filing the amended complaint, the defendant had cropped the land in person; that plaintiff was unable to state the exact value of the use of the land while defendant was cropping the same, but plaintiff alleged, on information and belief, that it was of the annual value of $400 during such period of time; that, inasmuch as the plaintiff was unable to state definitely'the rents and profits arising from the land • while in defendant’s- possession, the plaintiff asked that the defendant account for the -same, and also show the amount of taxes which had been paid by the defendant and those under whom the defendant claimed. It was further averred that the rents, issues, and profits arising from the land had much more than met and discharged the mortgage debt and the taxes upon the land, and that there was a large sum due the plaintiff from defendant after discharging said incumbrance upon the land and the taxes. In this complaint the plaintiff asked for an accounting in equity, and that a judgment be entered fixing the balance as between the plaintiff and the defendant, and that, if it so eventuated, the plaintiff would pay any sum found to be due upon the mortgage indebtdness, and if, on the other hand, it was adjudged that the defendant was indebted to the plaintiff, that she have judgment against defendant for the amount thereof, and for such other relief as was just.
The defendant moved to strike the amended complaint from the files “upon the ground that the same set forth an entirely different cause of action from that contained in the original complaint.” In support of this motion, counsel contended that the original complaint stated a cause of action in ejectment, and that the amended complaint alleged a cause of action for an accounting in a court of equity; and counsel contend, under an established rule of practicé existing in the code states, as well as in the states having no code of civil procedure, that this is not permissible. There is good au*49thority for this proposition of law, and we shall, at least for the purposes of this case, assume its entire correctness as stated by counsel. We are therefore to consider whether the amended complaint is' obnoxious under this rule of practice. We.think it is not. It lies within the discretion of the district court, either before or after judgment, to allow an amendment of a pleading in furtherance of justice, if the proffered amendment does not “change substantially the claim or defense.” Rev. Codes 1895, § 5297. The question is, therefore, whether the facts averred in the amended complaint do substantially change the plaintiff’s claim or cause of action as stated in her original complaint. As this court construes the two pleadings, the plaintiff’s claim against the defendant, as presented in the two complaints, is substantially one and the same claim. It is certainly clear that a large and substantial part of the relief which a court of equity could lawfully grant the plaintiff under his first complaint could be granted with equal propriety upon the facts set out in the amended complaint. The facts pleaded in both complaints, if established, would ehtitle the plaintiff to relief in a court of equity as follows : First, to a decree quieting title in the plaintiff, and excluding the defendant from claiming title to the premises; second, to a decree canceling the foreclosure sale, and the certificate and deed issued pursuant t'o such sale; third, to a decree canceling the warranty deed from James Milne to the defendant, and, finally, to a judgment awarding the plaintiff the possession of the land. The facts pleaded in both complaints, without doubt, invoke the powers of a court of equity; and, being in a court of equity, that court would retain jurisdiction of the case for 'all purposes, including that of determining the rights of the parties with respect to the possession of the land, which right under both complaints was squarely in controversy. But the two complaints differ in this: In the first it was alleged, in terms, that the defendant took possession of <the premises unlawfully, and ousted the plaintiff therefrom; but this statement was qualified in the first complaint by an averment to the effect that the defendant claimed to be thé owner of the land under the foreclosure sale, and the deeds of conveyance executed pursuant to such sale. We think that these two statements, when fairly construed, amount only to the allegation that the defendant entered upon the land in good faith as owner, but that he was mistaken as to his ownership, because the foreclosure under which he claimed title was illegal and abortive. It was not alleged in the first complaint that the defendant obtained possession by force, nor is it claimed in any of the plaintiff’s pleadings that defendant obtained possession otherwise than peaceably. In the second complaint the allegation that the defendant entered unlawfully and ousted the plaintiff is omitted, and in lieu thereof the plaintiff alleges only that the defendant was in possession of the premises; and by this complaint the defendant did not *50attempt to characterize the defendant’s possession, or attempt to allege, in terms, whether the same was or was not lawful or wrongful; but, on the other hand, after stating the facts, the plaintiff prayed for an accounting, and for general relief in equity.
Thus far no substantial difference is developed as between the two complaints, except in this: in the the first complaint the plaintiff asks for damages for the value of the use in the sum of $2,000, while in the amended pleading the claim for damages is dropped, and a claim for an accounting for the net value of the use is substituted. But it seems clear to us that this feature of the relief asked in the second pleading differs only in form and in name from that denominated "value of the use” in the first complaint. In both complaints the plaintiff demanded of defendant a money compensation for the use of her land while occupied by the defendant. Our conclusion is, therefore, that the trial court properly denied the defendant’s motion to strike out the amended complaint. The allowance of the amendment was in furtherance of justice, and moreover, by filing the amended complaint the plaintiff made a valuable concession to the defendant, in this: that, upon the facts stated in the amended complaint, it was conceded by plaintiff that the net value of the use, as ascertained upon the accounting asked for, should be credited upon the mortgage debt then owed by the defendant to plaintiff. This equitable adjustment of the defendant’s claim as a creditor and holder of the mortgage debt was not tendered by the first complaint, and hence the amendment was highly advantageous to the defendant. The following cases will support our conclusions upon the motion: Homan v. Hellman, 35 Neb. 414, 53 N. W. Rep. 369; Newman v. Association, 76 Iowa, 56, 40 N. W. Rep. 87, 1 L. R. A. 659, 14 Am. St. Rep. 196; Emmett Co. v. Griffin, 73 Iowa, 163, 34 N. W. Rep. 792; Nye v. Gribble, 70 Tex. 458, 8 S. W. Rep. 608; Steamship Co. v. Otis, 27 Hun. 452. See, also, Anderson v. Bank, 5 N. D. 80, 64 N. W. Rep. 114.
On the 27th day of October, 1897, the defendant filed his answer to the amended complaint denying the plaintiff’s ownership of the land, and alleging that title to the premises vested in himself under the deed executed by James Milne to himself, and that defendant went into possession under said deed on or about the 13th day of November, 1888, and did so without notice or knowledge that the plaintiff had, or claimed to have, title to the land, and further alleged that at the time the defendant went into possession, and for years prior thereto, the said James Milne was in the peaceable and lawful posesssion of the land, and that Milne, when he conveyed the land to the defendant, was the owner in fee thereof, and was vested with a fee title under a quitclaim deed dated the 7th day of November, 1888, which was executed by Robert S. Gurd; that said Gurd was seised under two several tax deeds of the land made by the county treasurer of Grand Forks county and delivered to Gurd — one of said tax deeds bearing date October 3, 1883, and the other October 15, 1883,— which deeds were recorded. The answer further alleges that defend*51ant not only acquired a title in fee by his said deed from James Milne, but that defendant also acquired title to the note and mortgage described in the complaint. The answer further states that the plaintiff and her husband soon after executing said mortgage abandoned the premises and removed to the dominion of Canada, and that the plaintiff has never paid any taxes on the land, nor any part of the debt — principal or interest — secured by said mortgage; nor has the plaintiff or her husband ever asserted any claim or title to the land since they left the same, in 1883, until this action was commenced, and this despite the fact that plaintiff has had knowledge of the defendant’s possession, and has at all times acquiesced therein. The answer further shows that the defendant has paid the taxes on the land for the years 1889, 1890, 1891, 1892, and 1893, and that such payments of taxes were made in the belief that the defendant was the owner of the land. Defendant alleges as a counterclaim that the note and mortgage described in the amended complaint were severally assigned to the defendant, and that the defendant still owned the same, and that there was due and unpaid on said note, with interest, the sum of $3,250.63, which amount, the answer alleged, was due to the defendant. The answer further shows that said Robert S. Gurd, the mortgagee, paid divers sums and amounts of taxes on the land in the years 1883, 1884 and 1888; and it is averred that said taxes were so paid by Robert S. Gurd by reason of his interest in said real estate, and his lien thereon under and by virtue of said mortgage, and for which plaintiff was indebted to the said Gurd; that no part of the taxes has been paid, and that the claim therefor has been duly transferred to the defendant, and that there was then due defendant on account of said taxes the sum of $400; that after defendant had, as he supposed, acquired title to the land, he continued to pay taxes on the land from year to year, and did so believing that he was the owner of the land; and that the taxes paid by the defendant aggregated $238. The answer further states that he plowed and backset the land after his purchase thereof, and did so as the owner, but the value of said improvements was $400. In this answer the defendant asked for relief as follows: That the action he dismissed, and that title to the land be decreed to be in the defendant, and, finally, that the defendant have judgment against the plaintiff on his said several counterclaims.
The record shows that after the amended answer was filed the case slumbered for an additional period of about three years, and until the 16th day of November, 1900, at which date the defendant moved to dismiss the action. The grounds of this motion, briefly expressed, are that the cause of action had been changed from an action in ejectment to an action for an accounting; that in the amended complaint the plaintiff did not allege, in terms, that the defendant held the land in the capacity of a trustee, or that defendant ever accepted any trust in the land; and, finally, that before commencing the action the plaintiff had not demanded any accountig. This motion was denied, whereupon a supplemental complaint was filed, to which the *52defendant answered; but the last-named pleadings do not in any wise change the essential nature of the action, nor 'do more than enlarge the claim for relief. The supplemental complaint sets out, however, that on the 25th day of September, 1898, the defendant, while in possession of the land as trustee under the mortgage, acquired a tax title of the land from one M. F. Murphy, which was based on a tax sale made in 1894 for taxes for 1893.
Upon the issues thus framed the case was tried without a jury, and upon the 20th day of December, 1900, the trial court filed its findings, directing j'udgment to be entered in favor of the plaintiff substantially as prayed for in the complaint, whereupon j’udgment' was entered adjudging that the mortgage debt was fully paid out of the net issues and rents of the land while occupied by the defendant, and that after deducting the aggregate of the mortgage debt, with lawful taxes added, there was a balance due plaintiff from said defendant from said issues and rents in the sum of $1,361.31, for which amount, with costs of suit, judgment was entered. The judgment further directed that the mortgage and several deeds, including said tax deeds, should be held void and canceled of record, and that the title should be quieted in the plaintiff, and that possession should be surrendered to the plaintiff. From such judgment the defendant has appealed, and in this court asks for a retrial of all the issues involved.
Upon these pleadings the question is first presented whether the plaintiff or the defendant is vested with title. This question is not difficult of solution. Plaintiff alleges, and defendant also alleges, that plaintiff’s husband was vested with legal title when the mortgage in question was executed; and it is shown, and not disputed, that the husband conveyed his interest to plaintiff before this action commenced, and in the year 1884. It further appears that defendant acquired what he supposed was the legal title under a deed of warranty from the purchaser of the land at an attempted foreclosure sale made under said mortgage on the 25th day of January, 1886, which sale was followed by a sheriff’s deed. But before the action was tried in the district court on its merits, it had been finally determined by this court that the attempted foreclosure sale was illegal and whollv abortive. See Finlayson v. Peterson, supra. But it appears that, prior to the execution of said deed of warranty under which defendant claims title, the grantor, James Milne, who purchased at the attempted foreclosure sale, had received from the mortgagee, Robert S. Gurd, a deed of quitclaim of the land, whereby said Gurd had quitclaimed and granted to James Milne all his rights, both legal and equitable, in the land, and had particularly conveyed all the rights which he (Gurd) had acquired under the two tax deeds before mentioned, and which bear date, respectively, on the 3d and 15th days of October, 1883. The question is then presented whether these two tax deeds, or either of them, operated to convey title either to Gurd, Milne, or the defendant. We are entirely clear that they did not, and this for two reasons: First, it appears that the assessments *53on which both of said deeds depend for their validity were illegal and void, in this: that the land was not sufficiently described in the assessor’s return. The description was wholly void, under the rule laid down in Powers v. Larabee, 2 N. D. 141, 49 N. W. Rep. 724, and Powers v. Bowdle, 3 N. D. 107, 54 N. W. Rep. 404, 21 L. R. A. 328, 44 Am. St. Rep. 511. Hence the tax deed was inoperative as a conveyance. But aside from this fact, the deeds cannot stand as a conveyance in favor of the defendant and against the plaintiff, because when they were obtained by Gurd he was in the relation of a mortgagee, and, as such, was given permission by the terms of the mortgage to pay taxes on the land, and add the amount so paid out to the mortgage debt. It is well established that a mortgagee, under such circumstances, is estopped to acquire title as against the mortgagpr. Under such a state of facts, a trust relation arises, in which the mortgagee or his grantee becomes a trustee, and as such is not only debarred from acquiring title himself as against the trustor, but is under an obligation to pay the taxes, as a means of protecting the trust property as against a hostile title. The authorities cited below will fully sustain our conclusions upon this point, and as they have an equal bearing upon the tax title acquired by the defendant of M. F. Murphy by deed from Murphy dated September 15, 1898, we shall make no further reference to the tax titles, and shall rule that they do not operate to convey the title as against the mortgagor. See Cooley Tax’n, pp. 503, 504, and note 1; 15 Am. & Eng. Enc. Law (1st Ed.) p. 820, and note 3; Ward v. Matthews, 80 Cal. 343, 22 Pac. Rep. 187; Christy v. Fisher, 58 Cal. 256; Burchard v. Roberts, 70 Wis. 111, 35 N. W. Rep. 286, 5 Am. St. Rep. 148. We therefore hold that, the record shows that the plaintiff has never been devested of her legal title to the land in suit, and that defendant has never been vested with the legal title thereto.
But the .conceded fact remains that the defendant bought the land of James Milne, and took possession thereof, supposing himself to be the owner, on October 30, 1888, and has continuously cropped the land from that date, and until the action was tried. We have seen that, while the defendant has taken possession in good faith and peaceably, he cannot justify his possession as owner of the land; and, evidently anticipating this contingency, defendant has pleaded a counterclaim by his answer, whereby it is alleged that- defendant has purchased the mortgage and the mortgage debt, and that after the plaintiff removed from the land the defendant took possession thereof with the full knowledge of the plaintiff, and by her acquiescence. This fact is not controverted by the plaintiff either by proof or allegation. The mortgage embraces the following stipulation: “It is further expressly agreed that in the event of any failure to pay said principal or interest notes, or any part thereof, when due and payable, said second party, or his successors or assigns-, shall be, and is hereby, authorized to take immediate possession of said property, and to rent the same, and be liable to account to said first parties only for the net profits thereof.” It appears in evidence that *54Gurd took possession of the property and rented it to the defendant prior'to the foreclosure sale, and also that Milne was in actual possession at and for some years prior to the date of his deed to the defendant. From all of these .allegations and facts -it conclusively appears that the defendant .may well justify his act of taking possession by the terms of the mortgage itself, and also by the acquiescence of the plaintiff in his possession. In support of this possession it is admitted that the defendant is the owner of the debt, secured by the mortgage, and that the same, as well as the mortgage, has Deen transferred to the defendant, together with the claim of his assignors for any lawful taxes paid on the land' by them. It is true that defendant took possession in good faith, supposing himself to be the owner; and up to this time defendant, by his counsel, most strenuously objects to being placed in the category of a mortgagee in possession, and especially protests against the plaintiff’s contention that the defendant is a trustee of the premises, and in that relation must account for the net rents, issues, and profits arising from the land while occupied by him. But we are decidedly of the opinion that inasmuch as the defendant cannot justify his possession on the ground of ownership, nor at all, except in the relation of a mortgagee taking possession by consent after default and before foreclosure, he should be regarded, under well-established principles of law, as a mortgagee in posession, and, as such, a trustee accountable to the owner for net rents, issues, and profits.
It will readily be seen in this case that the question is not presented whether a mortgagee after default, or upon a sheriff’s deed based upon an abortive foreclosure, may, without consent, take peaceable possession of the premises, and maintain such possession as against the mortgagor or his assignees. In the case at bar there is an express consent in the mortgage, and it is, moreover alleged by the defendant, and not disputed, that the defendant took and held possession with plaintiff’s knowledge and by her acquiescence. Under such circumstances, the cases, whether based upon the old form of mortgage, or under the modern mortgagé, which is a mere lien, and not a conveyance of title, are practically unanimous to the effect that the defendant in possession cannot by any form of action be dispossessed until- the mortgage debt is paid. The cases which could be arrayed; in support of our conclusion upon this point are very numerous, but we shall cite only a' few which have been decided in states where, as in this state, a real estate mortgage is a.mere lien for security:. Madison Ave. Baptist Church v. Baptist Church in Oliver St., 73 N. Y. 82; Howell v. Leavett, 95 N. Y. 617; Hubbell v. Moulson, 53 N. Y. 225, 13 Am. Rep. 519; Moulton v. Leighton, (C. C.) 33 Fed. Rep. 143; Bryan v. Brasius, 162 U. S. 416, 16 Sup. Ct. 803, 40 L. Ed. 1022; Id. (Ariz.) 31 Pac. Rep. 519; Cooke v. Cooper, 18 Or. 132, 7 L. R. A. 273, 17 Am. St. Rep. 709; Townsend v. Thomson; 139 N. Y. 152, 34 N. E. Rep. 1100; Johnson v. Sandhoff, 30 Minn. 197, 14 N. W. Rep. 889; Holton v. Bowman, 32 Minn. 191, 19 N. W. Rep. 734; Hennesy v. Farrell, 20 Wis. 46; Brinkman v. *55Jones, 44 Wis. 498; Fee v. Swinglv. 6 Mont. 59, 13 Pac. Rep. 375; Spect v. Spect, 88 Cal. 437, 26 Pac. Rep. 203, 13 L. R. A. 137, 22 Am. St. Rep. 314. The case last cited is especially instructive, because the court in that case places a construction upon a section of the Code' of California identical in its terms with that embraced in § 4714, Rev. Codes 1899.
(89 N. W. Rep. 855.)
As has been said, an accounting was had in the district court whereby it was adjudged that the defendant had, prior to the accounting, received of and from the rents, issues, and profits of the premises, while in his possession, a net amount greatly in excess of the aggregate of the debt secured by the mortgage, principal and interest, together with the amount of the lawful taxes paid by the defendant and his predecessor, with interest on such taxes; and the trial court, in addition to other relief, gave plaintiff a money judgment for such excess. We have given careful consideration to the matter of the accounting, and the evidence in the record relating thereto, but we are satisfied that it will serve no useful purpose in this opinion to enter into a detailed analysis of this feature of the case. We are convinced that the accounting, as an entirety, is not unjust to the defendant; and, if it is faulty in a few particulars, this-fact is explained by the failure of the defendant to furnish the trial court detailed information, which, as a trustee, it was his duty to furnish at the accounting. Moreover, it is our opinion that there is no good reason for believing that another accounting, covering a period of 11 or 12 years of farminu operationá, would lead to a result more in conformity to the principles of justice than that already had. This action has been pending 8 years, and it is time that the plaintiff should be given possession of her freehold. The accounting already had does not include the year 1901, and the disposition of the present action is therefor made without prejudice to the right of the plaintiff to institute an action against the defendant to compel an accounting for that year.
The judgment of the trial court should in all things be affirmed, and it will be so ordered, provided, nevertheless, that the district court, pursuant to a stipulation of counsel filed in this court, is directed to deduct the sum of $300 from the total amount of the money judgment against the defendant as entered in the district court.
Young, J., concurs. Morgan, J., took no part in the above decision.