In October, 1918, the defendant, the A.L. Johnson Company, entered into a contract whereby it sold to one Hans A. Johnson a half section of land for a consideration of $11,200, $1,500 being paid in cash and the balance made payable by the delivery of one-half the crop for each year beginning with the crop for 1919. Under the contract the purchaser obligated himself to pay all taxes beginning with the taxes for the year 1919, and the contract contained the further stipulation that until delivery of one-half the grain to the vendor to be applied on the contract, the title to and ownership of all grain raised should remain in the vendor, and it was provided that the contract should not be assignable by the purchaser without the written consent of the seller. The purchaser entered into possession of the land under this contract, remaining in possession and farming it until 1925. In the fall of 1920 he assigned the contract to the Farmers and Merchants Bank of Leeds (hereinafter designated as the bank), the vendor assenting thereto and having no notice that the assignment did not convey to the bank absolutely all of the interest of the purchaser, but Johnson remained in possession as stated, farming the land under the direction of the bank. In the fall of 1923 the bank was closed as insolvent and was afterward placed in charge of the plaintiff Baird as receiver. In June, 1924, Johnson gave to the plaintiff, as receiver of the bank, his note for $823.80, payable on or before October 1, 1924, which was secured by a chattel mortgage on the crop to be grown in 1924 upon the land covered by the contract. It seems that during the year 1924 the vendor discharged a number of liens incident to the farming operations, such as for seed grain, for farm labor and for threshing, and in addition to this paid taxes for the years 1922, 1923, and 1924 amounting to $470.96. In the fall of 1924 the vendor, A.L. Johnson Company, received all of the crop grown that year of the value of $2,415.24. A controversy arose between the receiver of the bank and the Johnson *Page 295 Company regarding the contract and the crop of 1924. In the spring of 1925, while the parties to this controversy were interested in adjusting the claims based upon the contract, as well as the specific claims relating to the 1924 crop, the attorney for the vendor wrote to the attorney for the receiver suggesting that the receiver release all interest in the land and that neither party should by such release waive any right to the crop, the right to the crop to be determined "just as though that contract had not been canceled or surrendered." Some weeks later the attorney for the receiver enclosed the contract for surrender and cancellation with the understanding that it be accepted without affecting the claim of the receiver to the 1924 crop. The surrender and cancellation was referred to as being in accord with a mutual understanding and desire that the A.L. Johnson Company should have the use of the land for 1925, unhampered by any claim on the part of the receiver as to the crop for that year and with the understanding "that the question of the cancellation and surrender of this contract be out of the way." Soon after the surrender this action was begun.
In the complaint it is alleged that the defendant wrongfully and unlawfully took and converted the crop raised in 1924 to its own use to the damage of the plaintiff of $1207.62. It is further alleged that a fair compensation for the time and money expended in pursuit of the property is $200, and judgment is demanded for the sum of these two items. The defendant filed an answer and counterclaim, denying the conversion and setting up the contract under which the land had been sold and possession transferred to Johnson, the assignment of the contract to the bank, the subsequent control of the bank over the farming operations and the payment and discharge of the liens above referred to, including the taxes, by the defendant, and charged that the difference between the amount received from the grain raised on the land in 1924 and the amount credited on the contract, to wit, $1207.62, was advanced by the defendant out of its own resources and that all the payments and credits were made by and with the knowledge and consent of Hans A. Johnson. It also alleges the bankruptcy of the latter.
The matter was tried before the court without a jury, resulting in a judgment for the dismissal of the plaintiff's action. Upon this appeal the issues are defined as follows in inverse order: Is the counterclaim of the defendant proper, the action being for the conversion of grain *Page 296 and that portion of the counterclaim which is in dispute being based upon the payment of taxes for which the contract gave the defendant no lien on the crop? Second, may the plaintiff recover the sum of $150.00 as an amount agreed upon to be a reasonable attorney's fee for the recovery of the property converted?
Since the matters set up in the counterclaim offset the entire demand of the plaintiff to the share of the 1924 crop which would go to the receiver, there can be no recovery by the plaintiff if it was proper to allow these items and particularly the taxes. If, on the other hand, the items set up in the counterclaim are not allowable to the point of exhaustion of the plaintiff's interest in the 1924 crop, the judgment appealed from must be reversed. It is contended that the action, being in conversion, is for tort and that the counterclaim is based upon a contract which is not connected with the subject of the action, and that consequently it is not a proper counterclaim within § 7449, Compiled Laws of 1913. This section provides that a counterclaim is proper where it arises (1) "out of the contract or transaction set forth in the complaint as the foundation of the plaintiff's claim, or (is) connected with the subject of the action." It is said that the subject matter of the action is the conversion of the 1924 crop, while the counterclaim of the defendant is based on a claim for taxes. We are of the opinion that the appellant does not take a broad enough view of the action and of the statute. It is first to be observed that the plaintiff and appellant sets up in the complaint ownership of the grain which he then alleges was converted by the defendant. Manifestly, it would be proper for the defendant to justify the taking of the grain on the ground that it, and not the plaintiff, was the owner by virtue of the contract under which the grain had been raised. If the same contract should establish that the plaintiff was indebted to the defendant, it is difficult to see why the indebtedness may not be said to arise out of the contract or transaction set forth in the plaintiff's complaint as the foundation of his claim or why it would not be connected with the subject of the action. The contract assigned to the plaintiff, and upon which it must, perforce, rely for its ownership of the crop, obligates the plaintiff's assignor, and therefore the plaintiff, to pay all taxes levied or assessed upon the premises, and it provides that "Until the delivery of one-half of the grain as aforesaid during each and every year of this contract, thelegal title to and ownership *Page 297 of all of said grain raised during each year, shall be and remain in the first party." There is no allegation in the complaint to the effect that the plaintiff ever delivered one-half of the 1924 crop to the defendant or that the crop had ever been divided so as to vest title to the half claimed in this action in the plaintiff. There is merely the general allegation of ownership and right of possession. When this is put in issue by the answer the terms of the contract under which possession was enjoyed must necessarily be looked to in light of the evidence establishing performance to determine whether the plaintiff has sustained the burden of proof. He must succeed on the strength of his own title. Clearly, the contract under which the grain was raised and which is pleaded in the answer affords the foundation of the plaintiff's claim of ownership, and it is so connected with the subject of the action (regarding the grain as the subject) as to be inseparable from it. It goes to the very heart of it. Counsel for the plaintiff on the trial stipulated for the deduction from the value of one-half the grain all items paid by the defendant which, by operation of law and under the terms of the contract, were liens against the grain. In reality counsel were compelled to recognize the contract relations to this extent because of the direct bearing on the measure of damages. Force v. Peterson Mach. Co. 17 N.D. 220, 116 N.W. 84. But it is said that, inasmuch as the contract did not provide that the vendor should have a lien on the crop for the amount paid by him in discharge of the vendee's obligation to pay taxes, this claim is foreign to any issue regarding the crop. We can not so regard it. The obligation to pay taxes is expressed in the same instrument and is a vital part of the contract. In a litigation that draws in issue one vital provision of this contract certainly invites the adjustment of other rights claimed under it. A contrary holding would encourage unnecessary suits. The plaintiff here says, if the defendant has a claim against the receiver for taxes paid on this land, let it proceed by filing a claim, etc. At the end of another suit this might be determined, but that is not a reason for not determining it here. The code authorizes a cause of action to be embraced in a counterclaim when it is connected with the subject of the action, and we are of the opinion that the connection afforded by being embraced in the instrument upon which the plaintiff must rely is sufficient. The following from Ruling Case Law, which we have italicized to better indicate *Page 298 its applicability here, is, we believe, a sound expression of law (24 R.C.L. 844):
"The clear intention of the framers of the codes was that the court in one action should settle all matters in controversy relating to the contract or transaction which is the foundation of the suit. Any cause of action, therefore, whatever its nature, arising out of the cause of action alleged in the complaint, orconnected therewith, in favor of the defendant, and against the plaintiff, is a proper counterclaim. Any other construction would frequently defeat the ends of justice by preventing a full examination of the matter in controversy, where the rights of the parties were so dependent upon each other that they must necessarily be considered together to render a correct judgment.When the cause of action arises out of the transaction or isconnected with the subject of the action, it may be pleaded as acounterclaim without regard to its character, and it is only where the cause of action sought to be counterclaimed arises upon an independent contract that it becomes material that the cause of action so sought to be counterclaimed should be one on contract and existing at the time of the commencement of the action."
The Montana cases cited in the notes to the above text merit special attention.
In the case of Scott v. Waggoner, 48 Mont. 536, L.R.A. 1916C, 491, 139 P. 454, an action was brought for breach of the provisions of a hotel lease. The defendants, the lessees, filed a counterclaim, alleging that they had been wrongfully evicted by the lessors and that the latter had taken and converted personal property belonging to them. The contention was made that the counterclaim of the defendants was a cause of action in tort for the conversion of personal property and was, therefore, not a proper subject of counterclaim against the plaintiff's cause of action upon contract. The court, in a well considered opinion, held the counterclaim proper. (The Montana and North Dakota statutes are identical.) See Hanson v. Skogman, 14 N.D. 445, 105 N.W. 90.
In Kinsman v. Stanhope, 50 Mont. 41, L.R.A. 1916C, 443, 144 P. 1083, the action was for the conversion of an automobile by the mortgagee. The answer justifies the taking under the mortgage and embraces a counterclaim for the balance due on the purchase price. This was held to be a proper counterclaim. The following authorities will likewise be *Page 299 found to support the rule that in actions for tort, where it appears either in the complaint or the counterclaim that the plaintiff's primary right is referable to a contract with the defendant, a counterclaim arising out of the same contract may be interposed: Judah v. Vincennes University, 16 Ind. 56; Ritchie v. Hayward, 71 Mo. 560; Kamerick v. Castleman, 23 Mo. App. 481.
This subject has been well and exhaustively treated in Pomeroy's authoritative work on Code Remedies. The following extracts are from the third edition:
"Section 775. . . . It seems, therefore, more in accordance with the nature of actions and more in harmony with the language of the statute to regard the `subject of the action' as denoting the plaintiff's principal primary right to enforce or maintain which the action is brought, than to regard it as denoting the specific thing in regard to which the legal controversy is carried on. . . .
"Section 776. In respect to the phrase `connected with' the subject of the action, one rule may be regarded as settled by the decisions, and it is recommended by its good sense, and its convenience in practice. The connection must be immediate and direct. A remote, uncertain, partial connection is not enough to satisfy the requirements of the statute. The criterion proposed by the Supreme Court of Indiana in one of the cases cited is as certain and practical as the nature of the subject admits, and only needs to be known to be universally accepted. It is, that the connection must be such that the parties could be supposed to have foreseen and contemplated it in their mutual acts; in other words, that the parties must be assumed to have had this connection and its consequences in view when they dealt with each other. . . ."
"Section 777. . . . Undoubtedly, the codifiers and the legislature in drawing and adopting the first subdivision had in mind the doctrine of recoupment, and so framed the language that it should include cases of recoupment and all others, legal and equitable, analogous to it, — that is, all cases in which the right of action of the plaintiff and that of the defendant arise from the same contract. It describes, therefore, not only the special and infrequent classes of instances in which the plaintiff's claim is not technically on the contract, although a contract is set forth as its foundation, but also all other instances in which the plaintiff's action is strictly brought on the contract, while the defendant's *Page 300 counterclaim in both cases arises from the same contract. The central idea of this subdivision then is, that one and the same contract is the basis of both parties" demand for relief. . . .
"Section 788. (3) Cases in which Plaintiff's Cause of Action is for a Tort, and the Defendant's Counterclaim is in Form upon Contract. . . . I submit the following doctrine as correct on principle, and us derived from a true interpretation of the statute. Whenever the facts are such that an election is given to the plaintiff to sue in form either for a tort or on contract, and if he sues on contract the defendant may counterclaim damages for the breach of that contract, the same counterclaim may also be interposed when the suit is in form for the tort; the facts being exactly the same in both phases of the action, the counterclaim would clearly arise out of the real transaction which was the foundation of the plaintiff's demand. The term `transaction' refers to the actual facts and circumstances from which the rights result and which are averred, and not to the mere form and manner in which these facts are averred. Although there are decisions which repudiate this interpretation of the codes, and reject the liberal rule drawn from it, I think the doctrine thus stated is now approved and supported by the decided weight of judicial opinion as expressed in the more recent authorities:"
Of course, the above rule does not apply to counterclaims under the second subdivision of § 7449, Compiled Laws of 1913, so as to admit as a counterclaim any other cause arising on an independent contract in cases where the plaintiff has based his action upon a tort, the tort being one that the plaintiff might have waived had he elected to sue in contract. (The omitted portion of § 788, Pom. Code Remedies above; Allis-Chalmers Mfg. Co. v. Amenia Seed Grain Co. 54 N.D. 153, 209 N.W. 234.)
The plaintiff and appellant relies principally upon the case of Roney v. H.S. Halvorsen Co. 29 N.D. 13, 149 N.W. 688, in support of its contentions here. In that case it will be noted that the vendor of the land had apparently not retained title to the crop as here and the original taking was regarded as wrongful; also, that the principal ground of the decision was that by cancelling the contract the vendor had elected and lost all right to pursue the crops as unpaid purchase price. We can not regard the case as holding that in an action for conversion it is *Page 301 never permissible to allege by way of counterclaim a cause ex contractu. The propriety of a counterclaim under § 7449, Compiled Laws 1913, can not be tested by the distinction between tort and contract without ignoring the broader terms of the statute, to-wit: "transaction" and "subject of the action" and resorting to refinements of reasoning which militate against the liberal spirit of the code. See Pom. Code Rem. §§ 774 et seq. We are of the opinion that the counterclaim was proper.
It is also urged that the claim for the taxes paid can not be allowed because the contract had been surrendered and canceled before the action was brought. The record shows, but not very distinctly, the circumstances in which the surrender was made and the question of the right to the crop reserved. We can not say from the record, however, that it was not understood by the defendant that when pursued for the crop it might defend just as though the contract had not been surrendered. The trial court has found the surrender and cancellation to have been "without prejudice to the rights of either party," and in view of the record this must be taken to mean without prejudice to the right of the defendant to utilize a claim based upon the contract to reduce or extinguish the plaintiff's claim.
It follows that the judgment appealed from must be affirmed. It is so ordered.
BURR, BURKE, CHRISTIANSON, and NUESSLE, JJ., concur.