This action was brought by respondent to recover $1,500 with interest and attorney’s fees' on two promissory notes given to him by appellants. The answer admits the execution, delivery and nonpayment of the notes, *474and as an affirmative defense sets up a counterclaim against respondent, alleging that before the giving of said notes respondent and appellants had been partners in the ownership of a certain “incompleted irrigation ditch, ditch right and right of way,” and that as a part of the transaction which resulted in the giving of said promissory notes respondent and appellants entered into a written agreement whereby respondent sold to appellant “all of his right, title and interest in and to said incompleted irrigation ditch, ditch right and right of way.” That subsequent to such conveyance, in violation of said agreement and without the consent of appellants, respondent went upon said ditch right of way and began the construction of a small ditch thereon and continued thereon until restrained by an order of the district court, and so constructed said ditch upon said right of way as to make the construction of appellant’s ditch much more expensive than it otherwise would have been and to cause appellants to do a large amount of additional work in constructing their ditch to their damage in the sum of $800. Respondent demurred to said counterclaim on the ground that it did not state facts “sufficient to constitute a counterclaim in favor of defendants and against this plaintiff, more particularly and specifically in that the matters alleged as constituting said counterclaim are matters sounding in tort and not in contract, and therefore not a defense to plaintiff’s cause of action.” Said demurrer was sustained and thereupon judgment was entered against appellants as prayed for in the complaint. The appeal is from the judgment.
The three specifications of error made by appellants go to the ruling of the court in sustaining the demurrer to the counterclaim. -
C. S., sections 6694 and 6695, read in part as follows:
“C. S., § 6694. The answer of the defendant shall contain :
“1. A general or specific denial of the material allegations of the complaint controverted by the defendant.
*475“2. A statement of any new matter constituting a defense or counterclaim. .... ”
“C. S., § 6695. The counterclaim mentioned in the last section must be one existing in favor of a 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 of action:
“l.,A cause of action arising out of the transaction set forth in the complaint as the foundation of the plaintiff’s claim, or connected with the subject of the action.
“2. In an action arising upon contract; any other cause of action arising also upon contract and existing at the commencement of the action.”
It is clear from the record that the facts set out in appellant’s answer constitute a counterclaim and the court erred in sustaining the demurrer thereto. Appellants had a right to show, if they could, damages arising out of the acts charged against respondent and to have the amount of damages shown, not exceeding $800, set off against the promissory notes sued on by respondent. (Wollan v. McKay, 24 Ida. 691, 135 Pac. 832.)
Under C. S., sec. 6696, after this action was brought by respondent, the only means by which appellants could have asserted their claim for damages against respondent was by a counterclaim in this action. Failing to so assert their claim, they could not have maintained a separate action thereafter for such damages. The judgment is reversed and the cause remanded. Costs to appellant.
Budge, McCarthy and Lee, JJ., concur.