The opinion of the court was delivered by
Dunbar, J.This was an action for treble damages under the statute for wilfull trespass, in cutting and removing timber, without lawful authority on the part of respondent, from the land of appellant. After the commencement of the action the appellant caused a writ of attachment to be issued against the property of respondent. The writ was issued and levied on the property of respondent, who at once filed a motion to dissolve the same. The motion was sustained on the ground that the writ was unlawfully issued. Thereafter respondent made answer to the complaint both by denial and affirmative pleas, and concluded his answer with a cross-complaint for damages by reason of the levy of the dissolved attachment. The appellant moved the court to strike the cross-complaint for the reason that the same was immaterial, irrelevant, and incompetent, and an improper joinder of causes of defense, and because the matter therein contained, if true, was prematurely pleaded as a cause of defense or a cause of cross-action. This motion was denied, whereupon appellant demurred to said cross-complaint for the reason that it appeared therefrom that the matter therein stated did not constitute a counterclaim to *652plaintiff’s action. This demurrer was also overruled by the court. Reply was made to the affirmative matter of the answer and cross-complaint, and the cause tried by a jury. Objection was made by appellant to the introduction of any testimony on behalf of respondent under his cross-complaint, which objection was overruled. Respondent obtained judgment on his cross-complaint, from which judgment this appeal is taken.
It is necessary to notice only the first four assignments of error: (1) That the court erred in dissolving the writ of attachment; (2) in granting the motion to strike the word “feloniously” from the complaint; (3) in denying the motion to strike the cross-complaint from the defendant’s answer; (4) in overruling the demurrer to respondent’s cross-complaint.
The question to be determined under the first assignment is whether the affidavit in attachment charged the defendant with a felony, or whether it fell within the provisions of §§7108 and 7109, Bal. Code, or of § 7141, of the same Code. The first statutes mentioned are the statutes defining grand and petit larceny. Section 7141 provides:
“If any person shall wilfully cut down, destroy, or injure any standing or growing tree upon the lands of another, or shall wilfully take or remove from any such lands any timber or wood previously cut or severed from the same, or shall wilfully dig, take, quarry, or remove from any such lands any mineral, earth, or stone, such person, upon conviction thereof, shall be punished by imprisonment in the county jail not less than one'month nor more than one year, or by fine not less than fifty nor more than one thousand dollars.”
Without entering into a lengthy discussion of this proposition we are satisfied that it was the intention of the law*653makers to provide in the section above quoted an exclusive punishment for the violation of the provisions of said section, and that to that extent it superseded or repealed §§ 7108 and 7109. This disposes of the second assignment, viz., the alleged error of the court in striking the word “feloniously” from the complaint.
The next two assignments may be considered together, as they raise exactly the same legal proposition. The question is whether under the provisions of the Code a counterclaim for damages arising out of the issuance of an attachment can be pleaded in answer to a complaint in the original action, where the attachment has been dissolved. Section 1912, Bal. Code, provides that the answer of the defendant must contain, first, a general or specific denial of each material allegation of the complaint; second, a statement of any new matter constituting a defense or counterclaim. Section 1913 is as follows:
“The counterclaim mentioned in the preceding section must be one existing in favor of the 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: (1) A cause of action arising out of the contract or 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 on contract, any other cause of action arising also on contract, and existing at the commencement of the action.”
It is evident that the counterclaim in this case did not arise on contract and was not a cause of action arising on contract, and existing at the commencement of the action. Therefore it cannot fall within paragraph 2. It was not a cause of action arising out of the contract or transaction set forth in the complaint as a foundation of the plaintiff’s complaint, and, if it is authorized by the statute at *654all, it is so authorized by the concluding sentence of § 1, viz., “or connected with the subject of the action.” The meaning of the statute is not entirely clear, and there is some little conflict of authority in the construction of similar statutes, though we think the conflict is more seeming than real when the cases are closely scrutinized.
In a very brief case — Reed v. Chubb Brothers, Barrows & Co., 9 Iowa, 178 — it is held, that where the affidavit for attachment and the bond are filed and the writ sued out at the commencement of the action, if the writ is wrongfully sued out, any damages sustained by the defendant therefrom constitute a claim held by him at the commencement of the suit in such a sense that it may be set off against plaintiff’s demand in the same action. But that, if the attachment bond is filed and the writ of attachment issued after the action is commenced, such claim for damages cannot be pleaded by way of set off in the principal suit. This is the only case we have been able to find which goes to this extent.
Peiser v. Cushman, 46 Tex. 35, cited by respondent, seems to be a miscitation, and we have been unable to find it. •
In Waugenheim v. Graham, 39 Cal. 169, one of the cases relied upon by respondent, the syllabus is to the effect that, when the plaintiff has unjustifiably and illegally sued out a writ of attachment in the case, and thereby inflicted a great injury upon the defendant, the damages arising therefrom furnish the ground for a cross-complaint in the action; and such is the statement of the judge who wrote the opinion. But an investigation of the case itself shows that the decision in reality will not sustain respondent’s contention in this case. In that case the court held against the contention that the counterclaim was properly pleaded, but said:
*655“In order to avoid any misapprehension on another trial, we are not to he understood as deciding that under proper pleadings on the part of the defendant it would not he competent for him to prove that the plaintiff violated his contract hy prematurely suing out his attachment, seizing the saw mill and other property, and thereby wrongfully preventing the defendant from fulfilling the contract for the delivery of the lumber. If the money due to the plaintiff was paid in lumber, to be delivered within a specified time, and if the plaintiff, in violation of the contract, sued out an attachment before the expiration of the time and seized the defendant’s saw mill and other property, whereby he was disabled from performing the contract, and from which he suffered. other damage, we think this would constitute a valid counterclaim under Section 47 of the Practice Act, the first subdivision of which defines a counterclaim as 'a cause of action arising out of the transaction set forth in the complaint or answer as the foundation of the plaintiff’s claim or defendant’s defense, or connected with the subject of the action.’ ”
So that it will be seen that this is an entirely different proposition from the one under discussion in this case. It doubtless is a case in point explaining what is meant by the expression “connected with the subject of the action,” and is in line with a class of cases cited by Mr. Bliss in his Code Pleadings, §§ 370, 371; as where, in an action to recover the rent stipulated in a lease, the defendant was allowed to present a counterclaim based on a breach on the part of the plaintiff of other provisions in the same lease. Orton v. Noonan, 30 Wis. 611. So, in an action upon the .implied agreement to pay for work and labor, the defendant may counterclaim the damages suffered from a breach of the implied agreement that the work shall be skillfully done. Eaton v. Woolly, 28 Wis. 628. And in Hay v. Short, 49 Mo. 139, it was held that in an action for rent due upon a verbal lease the defend*656ant might show that the plaintiff, by the terms of the lease, agreed to build a certain fence, and counter-demand damages arising from his neglect to build it. Innumerable cases of this kind are presented in the books. But we do not think that the damages claimed by reason of the issuance and levy of the attachment could be said to be in any way connected with the subject of the action. The subject of the action in this case was trespass, and it is difficult to see how damages arising from the execution of a process issued by a court could be in any manner connected with the trespass alleged to have been committed by the defendant. The only object or office of an attachment is to establish a lien on the property of the defendant for the purpose of securing the fruits of the judgment, if one should be obtained; and no action for damages could be commenced on the attachment bond until after the discharge of the attachment, and the cause of action could, therefore, not have existed at the time of the commencement of the original action. To permit a counterclaim of this kind would be to permit a tort occurring after the commencement of an action to be pleaded as a counterclaim to the cause of action originally pleaded. We do not think that, under the most liberal construction, the counterclaim upon which the judgment in this case was obtained should have been received as an answer to the allegations of the complaint, and the court therefore erred in not sustaining the demurrer to the same.
The judgment will be reversed, and the cause remanded, with instructions to sustain the demurrer to defendant’s counterclaim.
Fullerton, C. J., and Hadley, Mount and Anders, JJ., concur.