delivered the opinion of the court.
1. The contention of plaintiff is that this action, being in the nature of replevin, is not subject to a counterclaim for damages, and upon that question we find there is some conflict in the authorities. See 34 Cyc. 1416. Section 73, B. & C. Comp., provides that the answer shall contain, among other things:
“(2) A statement of any new matter constituting a defense or counterclaim.”
Section 74 provides that “the counterclaim mentioned in Section 73 must be one existing in favor of defendant, and against a plaintiff, between whom a several judgment might be had in the action and arising out of one of the following causes: (1) A cause of action arising out of the contract, or transaction set forth in the complaint as the foundation of plaintiff’s claim; (2,) in an action arising on contract, any other cause of action arising also on contract and existing at the commencement of the action.” The earlier cases quite uniformly refused to permit a plea of set-off in an action of replevin; but at this time the rule seems to be greatly modified, being, however, much more liberal in some states than in others. Some courts permit the pleading of a counterclaim, and, if defendant prevails, allow judgment in his favor for the excess, if any: Deford v. Hutchison, 45 Kan. 318 (25 Pac. 641: 11 L. R. A. 257) ; McCormick Harvesting Co. v. Hill, 104 Mo. App. 544 (79 S. W. 745). But in both of these states and others, where the same rule is followed, by the terms of the statute equitable defenses may be pleaded at law. In Oregon, where the distinction between actions at law and suits in equity is still maintained (Zeuske v. Zeuske, *31355 Or. 65 [108 Pac 648]) equitable relief cannot be obtained in an action of renlevin. The action of replevin generally sounds in tort; at least it is so in case the possession of the property by defendant was obtained otherwise than by virtue of some contract, and probably in such a case no element of set-off would be available as a defense. Cobbey, Replevin, § 791; McCormick Harvesting Co. v. Hill, 104 Mo. App. 544 (79 S. W. 745) ; Deford v. Hutchison, 45 Kan. 818 (25 Pac. 641: 11 L. R. A. 257) ; Clement v. Field, 147 U. S. 467 (18 Sup. Ct. 358: 37 L. Ed. 244) ; Gardner v. Risher, 35 Kan. 93 (10 Pac. 584).
2. But, if the action is to recover possession of property, the right to which arises upon contract, such as, upon chattel mortgage,- which in terms authorizes the mortgagee to take possession upon default in payment of the debt secured, any matter tending to defeat plaintiff’s right of possession may be pleaded as a set-off, as plaintiff’s right, in such a case, being for the purpose of foreclosure, is not based on title, but right of possession ; and if there is no debt there is no right of possession in the mortgagee. This is recognized in Nunn v. Bird, 36 Or. 515 (59 Pac. 808), and Freeman v. Drummer, 50 Or. 287 (91 Pac. 1077). But to defeat the action the set-off must equal the debt. Cobbey, Replevin, § 791; Wells, Replevin, § 581.
Most of the cases discussing this question grow out of chattel mortgage or some other character of lien, and it seems that the same rule applies to cases in which the vendor retains the title until full payment of the purchase price, as in the case before us. In such a case, if the debt is canceled, his title is terminated without other act. This is recognized in Ames Iron Works v. Rea 56 Ark. 450 (19 S. W. 1063), and Cobbey, Replevin, §791.
3. The complaint here does not allege the contract out of which plaintiff’s right grew; but the answer sets up the facts showing that defendant’s possession was by *314virtue of a contract for the purchase of the engines, which, for the purpose of this demurrer, must be taken as true, and plaintiff cannot recover without proof of default by defendant. Therefore defendant is entitled to allege and prove any facts that will defeat plaintiff’s right to possession, such as payment of the debt or a counterclaim equal to it, provided it is such as may be pleaded under Section 74, B. & C. Comp.; but any set-off less than the whole amount due will be unavailing for that purpose, as plaintiff is entitled to -possession if any part of the price is unpaid.
There is practically no defense pleaded to plaintiff’s right to the 12x12 engine. The items of set-off relate to a breach of the contract for the 11x14 engine. Without determining whether defendant’s third item of set-off states facts sufficient to constitute a defense, in the face of the provisions of the contract that “a retention of the property forwarded, after ten days from shipment, shall constitute a trial and acceptance, be a conclusive admission of the truth of all representations made by or for the consignor, and void all its contracts of warranty, express or implied,” or whether the facts of the second and third defenses are sufficiently pleaded, it is plain that the whole amount of such damages is not equal to the purchase price of the 11x14 engine, $3,200, with interest to the date of the filing of the answer, viz., $3,615; the whole amount of damages claimed being only $3,234.22.
The demurrer was properly sustained. Affirmed.