ICellam, P. J.
The controlling question in this case is whether the lien of an agister for the feeding and pasturing of stock, received from the mortgagor in possession, takes precedence over the lien of a chattel mortgage upon the same stock, given and filed in the register’s office, as provided by law, prior to such feeding and pasturing. Respondent makes the preliminary objection that the complaint does not state a cause of action, nor show the plaintiff entitled to any relief, or to resist defendant’s claim for a lien, for the reason that plaintiff’s interest, if he have any, in the property involved, depends entirely upon the terms of a chattel mortgage, which are not pleaded, or set out in the complaint, except as an exhibit thereto, and so not entitled to be considered. Under the rule approved and adopted by a majority of this court in Aultman v. Siglinger, 2 S. D. 442, this would probably have been good ground for demurrer to the complaint. Defendant, however, did not demur, but answered upon the merits and went to trial, when the chattel mortgage was offered in evidence and received without objection. Under these circumstances, the defendant cannot in this court for the first time take advantage of this defect in the complaint, which was plainly amendable, and which was in fact fully covered by evidence received without objection. Johnson v. Burnside, (S. D.) 52 N. W. Rep. 1057. Comp. Laws, § 54.86, under which defendant’s lien is claimed, is as follows: “Any farmer, ranchman, or herder of cattle, tavern keeper, or livery stable keeper, to whom any horses, mules, cattle or sheep shall be intrusted for the purpose of feeding, herding, pasturing, or ranching, shall have a lien upon said horses, mules, cattle or sheep for the amount that may be due for such feeding, herding, pasturing, or ranching, and shall be authorized to retain possession of such horses, mules, cattle or sheep until the said amount is paid: provided, that these provisions shall not be construed to apply to stolen stock.” The undisputed facts upon which this controversy must be determined are that on the 1st day of May, 1888, the owners of the stock involved made and delivered to plaintiff’s assignor a chattel mortgage on the same, which was duly filed in the office of the register of deeds of the proper county, June 30, 1888; and that on the 12th day of May, 1889, the mortgagors, still in *293possession, left the stock with, defendant to be fed and taken care of; that, without any knowledge on the part of plaintiff or his assignor, defendant kept and fed said stock, and had not been paid therefor when this action was commenced by plaintiff to get possession of the same under his said mortgage. Thus is squarely presented the question of priority between the two liens. When defendant took this stock to pasture, he took it knowing (for the filing of the mortgage notified him) that plaintiff had a mortgage upon it to secure an indebtedness not yet due. Comp. Laws, § 4380. He knew that such mortgage constituted an existing lien upon such stock at the time he took it to pasture. Section 4357. He knew that plaintiff had a right, whenever he might choose to do so, to take possession of the stock for the mortgage of which he had notice so provided. He knew, for the said section 4358 so declares, that “no person whose interest is subject to the lien of a mortgage may do any act which will substantially impair the. mortgagee’s security.” He knew that- to just the extent that another charge was put upon the property prior to plaintiff’s mortgage his security would be impaired. He knew that, under the law and the terms of the mortgage, the mortgagors were entitled to the possession of the stock, and that in reason, and according to custom, the mortgagors so in possession would be expected to care for and feed them. For the purpose of determining his right in this matter, he knew all these facts as well as though he had been personally and actually informed of them at the very time he took the stock. He was under no obligation to take them. We do not, therefore, discover any equitable grounds upon which his lien ought to be preferred to that of the mortgagee. The plaintiff had done everything required of him to establish his lien upon the property, and to give notice thereof to defendant, long before defendant’s claim accrued, and it would be manifestly unfair, under such circumstances, to postpone his claim to that of defendant. The common-law lien of the innkeeper on the baggage of his guest is justified on the ground that he is under obligation to receive and provide for such guest, but the innkeeper has no lien upon baggage brought by'his guest if he knows that such baggage does not belong to the guest, — that he has no right to subject it to such *294lien. Johnson v. Hill, 3 Starkie, 172; Broadwood v. Granara, 10 Exch. 417; Grinnell v. Cook, 3 Hill, (N. Y.) 485. And so the artificer’s lien rests upon the fact that his skill and labor have imparted an additional value to the chattel upon which the lien is claimed. But the case of an agistment, does not fall within that principle, and so the agister has no lien at common law, and this is the very reason given for the absence at common law of an agister’s lien. Jackson v. Cummins, 5 Mees. & W. 342; Wallace v. Woodgate, 1 Car. & P. 575. But, in every case where the workman’s lien has been held superior to the interest of another prior in point of time, it has been placed upon the ground that the circumstances justified the inference that the one in possession had an implied agency to subject the property to such lien. We think it could be sustained upon no other ground. Hiscox v. Greenwood, 4 Esp. 174; Hammond v. Danielson, 126 Mass. 294; White v. Smith, 44 N. J. Law, 105; Hollingsworth v. Dow, 19 Pick. 228; Clark v. Hale, 34 Conn. 398; Kirtley v. Morris, 43 Mo. App. 144; Meyer v. Berlandi, 39 Minn. 438, 40 N. W. Rep. 513. And so a shipwright may have a lien ás against a prior mortgage, for repairs upon a vessel, but this is both upon the ground that such repairs enhance the value of the ship, and the further, and it seems to us the better, ground, that it was presumably the intention of all parties that the vessel should be kept in a proper state of repairs to continue its earning capacity, and so the party in immediate possession may fairly be presumed to have authority to order such repairs. Williams v. Allsup, 10 C. B. (N. S.) 417; Scott v. Delahunt, 5 Lans. 372.
It appears from the record that the mortgagors were themselves farmers and stockraisers. In the absence of any suggestion to the contrary, the inference is a fair one that the mortgage was given and taken with the understanding that the mortgagors should keep and look after the mortgaged stock according to the well-known custom in such cases, at their own expense, and not at the expense of the stock or the mortgagee. Right here we quote from the opinion of the court in Howes v. Newcomb, (Mass.) 15 N. E. Rep. 125, where the same question was presented as in this case: “It should be kept in mind that the purpose of a mortgage is to furnish security, and that the property is usually left with the *295mortgagor for Ms convemen.ce, with, an understanding that nothing shall he done or permitted by him to impair the security. An agreement which will defeat the purpose of the transaction should not be inferred or implied against a mortgage without cogent evidence. A mortgage of horses given to secure the performance of an act in the distant future is wortMess if the mortgagor may create a lien upon them.by putting them out to be boarded.” The statute under which the above case was decided provided that “persons having proper charges due them for pasturing, boarding, or keeping horses or other domestic animals brought to their premises, or placed in their care by or with the consent of the owners thereof, shall have a lien,” etc. It was held that the mortgage lien was superior. Many of the states have statutes giving liens to agisters, but they are so dissimilar in terms that few of the cases can safely be used as authorities, except as to the principles involved.
Sargent v. Usher, 55 N. H. 287, came up under the following statute: “Any person to whom any horses, cattle, sheep, or other domestic animals shall be intrusted to be pastured or boarded shall have a lien thereon for all proper charges due for such pasturing or board, until the same shall be paid or tendered.” It was held that an agister to whom were intrusted for keeping, by the mortgagor, mortgaged horses, acquired no lien on them superior to that of a prior recorded mortgage, but that the lien of the mortgage would prevail. In Indiana, under a statute providing that “the keepers of livery stables, and all others engaged in feeding horses, cattle, and hogs, and other live stock, shall have a lien upon such property for the feed and care bestowed by them upon the same,” etc., such lien is held inferior to that of a chattel mortgage previously made and recorded. Hanch v. Ripley, 127 Ind. 151, 26 N. E. Rep. 70. And so in Michigan, under a statute giving a mechanic a lien for the value of his labor and skill, and authorizing him to retain possession of any article to wMch such labor and skill had been applied until such charges were paid, it was held that such lien was subordinate to that of a prior chattel mortgage, and that such mechanic’s lien would attach oMy to the mortgagor’s equity of redemption. Denison v. Shuler, 47 Mich. 598, 11 N. W. *296Rep. 402. The same law also gives a livery stable keeper a lien for the keeping and care of animals intrusted to kirn, and authorizes him' “to retain possession of the same until such charges are paid;” but in Reynolds v. Case, (Mich.) 26 N. W. Rep. 838, where the livery stable keeper refused to surrender possession of a horse to a prior mortgagee until his charges for keeping the horse were paid, the court said: “The lien for the keep of the horse could not prevail over a valid prior chattel mortgage, and plaintiffs were not obliged to tender the amount of such claim for keeping the horse before they were entitled to his possession.” The Vermont statute is nearly identical with that of Massachusetts, supra, and in Ingalls v. Vance, 18 Atl. Rep. 452, it was held that the agister’s, lien for keeping stock brought to him by the mortgagor did not displace or supersede that of the prior mortgagee; but it was after-wards held by the same court in Ingalls v. Green, 20 Atl. Rep. 196, that, after the sale of the mortgaged property under the mortgage, the officer so selling should pay such agister’s claim out of the surplus funds, if sufficient, which was equivalent to saying that the agister had a lien upon the mortgagor’s interest in the stock, which seems, to us just what he should have. The Nebraska statute is: “When any person shall procure, contract with, or hire any person to feed and take care of any kind of live stock, it shall be unlawful for him to gain possession of the same by writ of replevin or other legal process, until he has paid or tendered the contract price or a reasonable compensation for taking care of the same;” and it was held that the lien of a previously executed and recorded chattel mortgage was superior to that of an agister for keeping and feeding the mortgaged stock at the instance of the mortgagor. Bank v. Lowe, 22 Neb. 68, 33 N. W. Rep. 482. In McGhee v. Edwards, (Tenn.) 11 S. W. Rep. 316, under a statute giving a livery stable keeper a lien for the keeping of horses “the same as the innkeepers’ lien at common law,” it was held that the lien of a recorded chattel mortgage takes precedence over that of a livery stable keeper for feeding a: mortgaged horse subsequent to the giving and recording of the mortgage. The doctrine of these cases seems to be that the chattel mortgage is a means and form of security authorized by law, that when the mortgagee has done *297everything required of him by the law to perfect and establish his security, and give notice thereof to the world, it ought not to be compromised or defeated by putting before it, as a superior lien, the claim of another afterwards incurred, and without his knowledge or consent; and that, in the absence of any clearly expressed intention by the legislature that such later charge should constitute a paramount lien, the courts ought not to make it so. When the statute gives a "lien” it does not necessarily mean a first lien. — a lien displacing all existing liens. Miller v. Anderson, 1 S. D. 539; Hanch v. Ripley, supra; Easter v. Goyne, (Ark.) 11 S. W. Rep. 212.
Against the foregoing we find only the two opposing cases of Smith v. Stevens, 36 Minn. 303, 31 N. W. Rep. 55, and Case v. Allen, 21 Kan. 217. In the former case the court suggests, in answer to the apparent hardship of making the earlier lien subordinate to the later, that the mortgagee knew when he took his mortgage that the mortgagor could and might subject it to another lien which would be paramount to and destroy it pro tanto; but to us it seems more fairly to meet the situation of the parties to say that when the agister took the stock to pasture he knew that plaintiff then had an existing lien upon it. Filing his mortgage was just as efficient as actual notice would have been. The inquiry of the Indiana court in Hanch v. Ripley, supra, seems quite pertinent: “Had the appellant had actual notice of the appellee’s mortgage, and in the face of such notice had he taken the property to keep, what plausibility would there be in his claim to superiority of lien? What equity would there be in such a claim? None whatever.” In the later case of Meyer v. Berlandi, 39 Minn. 438, 40 N. W. Rep. 513, the Minnesota court, in referring to Smith v. Stevens, supra, says: The opinion rests “upon the doctrine of agency — authority implied from the circumstances — from the mortgagee to the mortgagor to create a lien for such a purpose.” So that, to adopt the broad rule that the lien of the agister upon stock intrusted to his care by the mortgagor in possession is superior to that of the prior recorded mortgage, the court must first hold, as matter of law, that the circumstance that the mortgagor is left in possession is sufficient in every case to support the conclusion of agency. What would be the effect, then, if the mortgagee expressly notified the *298agister that he refused to consent to the mortgagor’s placing the stock in his hands to be subjected to the cost of their keeping, for the reason that the mortgagor had in Ms mortgage agreed to keep them at his own expense, and that he was entirely able to do so? Would the court still feel authorized to assume “an agency implied from the circumstances,” and infer consent of the mortgagee when it was expressly proved that he did not consent?
Fully agreeing with the Minnesota court that the agister’s lien, as against the prior mortgagee, must depend upon his consent, we think upon principle the true rule is that Ms lien, first established as required by law, can only be displaced when his consent or authority, express or implied, is affirmatively shown, and that a fact, like the retention of possession, which would not be received as competent evidence even tending to show authority to charge or affect the mortgagee’s interest in the property in any other way, cannot reasonably be taken as conclusive evidence of his consent that the property be subjected to the agister’s lien. Such consent may, of course, be shown by circumstances; but to show it requires something more than the simple fact of leaving the property in the mortgagor’s possession, for that is the general and almost universal custom, while for the mortgagor in possession to place such property out to be boarded or taken care of is unusual and exceptional; and, when the mortgagee simply does whai is usually done in such cases, he ought not to be taken as thereby consenting in advance that the mortgagor may do what is usually not done in such cases. In the other opposing case, (Case v. Allen, supra,) in the course of his opinion, Judge Brewer makes the inquiry: “Can he who has promised that the property shall, to the extent of its value, be security to the mortgagee for a certain debt, subsequently cast upon it a lien which shall take precedence of his prior contract, and to that extent diminish the value of the mortgagee’s security?” He concludes that he can, and so gives the agister’s lien precedence. It seems to us that in this state such conclusion would be against Comp. Laws, § 4858, which provides that “no person whose interest is subject to the lien of a mortgage may do any act which will substantially impair the mortgagee’s security.” We have hesitated a little over the' following words *299in said section 5486, which, gives the lien: “And shall he authorized to retain possession of such horses-, * * * until the said amount is paid;” but we conclude that this section was not intended to touch the matter of priority of different liens, for that was beyond the power of the legislature to disturb, (Meyer v. Berlandi, supra,) but simply to give a lien, as between the parties to the contract of agistment and their privies. The succeeding section (5487) throws light on the intention and meaning of said section 5486. It recognizes the impropriety of attempting to authorize or allow one person to subject the property of another to a lien, by providing that such lien shall not ensue unless the party so intrusting such stock to the agister is the owner thereof; that is, the power to incumber depends upon and is measured by ownership. The mortgagors could subject this stock to defendant’s lien as agister to the extent that they owned the same. While in this jurisdiction the mortgagor of personal property retains the title, and is in a general sense the owner of the mortgaged property, still, in respect to his right or power to subject it to- liens, he is really owner to the extent of his interest only. The right of possession is an incident to the right to a lien, and the agister may retain possession against everybody as to whom he has a superior lien. His lien is not superior to that of the prior mortgagee, and so he may not retain possession as against him. It is observable that the statute under which the Michigan cases, supra, were decided in favor of the priority of the mortgage lien, and the right to possession under it, has the same provision authorizing a retention of the property by the livery stable keeper, or agister. The principle of those cases which hold that the chattel mortgage remains the precedent lien seems right to us; while to hold that the mortgagee, who has exactly and in good faith met every' requirement of the statute, which undertakes to secure and establish his lien upon and interest in the property covered by his mortgage, may be supplanted and undermined without any fault or negligence upon his part, seems an encroachment upon the fundamental lights of property. Our conclusion is that where there is nothing in the evidence to show that the mortgagee consented, either expressly or impliedly, that the mortgaged property should be taken *300care of by another, and the expense charged against the property, the lien of the chattel mortgage continues superior and paramount to that of the agister, and that the fact that the mortgagor retains possession is not necessarily sufficient evidence of such consent. The trial court having definitely charged the jury otherwise, the judgment is reversed, and the case remanded for a new trial.
All the judges concurring.