On March 28, 1932, the defendant, C.A. Hamilton, commenced an action for the foreclosure of a real estate mortgage against the plaintiffs in this suit aided by a writ of attachment. The defendant Hamilton furnished an attachment bond on which he was the principal and the defendant, Eddie Kipp, signed the bond as surety.
In the foreclosure suit the defendant Hamilton obtained a deficiency judgment against the plaintiffs herein in the sum of $1,319.90 in July, 1932, and on November 7, 1933, the plaintiffs brought this suit on the attachment bond for damages against the defendants for wrongful issuance of the writ.
The defendants filed an answer and counterclaim.
In the counterclaim the defendants pleaded the deficiency judgment that the defendant, C.A. Hamilton, had obtained against the plaintiffs and prayed that any amount that might be found due the plaintiffs by reason of any wrongful suing out of the attachment be credited on or set off against the said deficiency judgment.
The plaintiffs demurred to the counterclaim of the defendants on the following grounds; (1) that the counterclaim does not arise out of the contract or transaction set forth in the petition nor is it connected with the action declared upon by the plaintiff, (2) that subdivision 3, Code section 11151, requires that the counterclaim shall be in favor of all the defendants instead of one of the defendants.
The district court sustained the demurrer and defendants appeal.
[1] Referring to the first ground of the demurrer, it is not necessary that a counterclaim arise out of the transactions set forth in the petition or be connected with the subject of the action. Code section 11151; Dolan v. Buckley, 197 Iowa 1363, 199 N.W. 302.
[2] Referring to the second ground of the demurrer, Code section 11151, subsection 3, provides that a counterclaim may be "any new matter constituting a cause of action in favor of the defendant, or all of the defendants if more than one, against the plaintiff, or all of the plaintiffs if more than one", etc.
[3] Under this provision the cause of action arising out of new matter or matters independent of the contract sued upon must be in favor of all the defendants against all the plaintiffs or the parties must resort to separate actions. In this case the *Page 779 counterclaim is not a cause of action in favor of both defendants against the plaintiffs. The deficiency judgment, which is the subject of the counterclaim, is in favor of the defendant Hamilton, the principal defendant.
We have held, however, in the case of Reeves v. Chambers,67 Iowa 81, 24 N.W. 602, 603, that Code section 11151, subdivision 3, has reference only to the principal defendants in an action and does not apply where a principal and surety are sued jointly.
In the case of Reeves v. Chambers, supra, the court states in construing Code section 2659, subdivision 3, (now section 11151):
"It must be conceded that the counterclaim is not a cause of action in favor of both the defendants and against the plaintiff. But Job Chambers is not primarily liable upon this bond. He is a surety, and it is his right to demand that the property of his principal shall be exhausted before resorting to his property to collect any judgment that may be recovered upon it. It is a fundamental rule that a surety may set up any defense which would be available to his principal. * * * the policy of our laws is to avoid circuity of actions. If the counterclaim cannot be pleaded in this action, and if it is a valid and meritorious claim, the ruling of the court below would require the principal to bring another action against the plaintiff, recover a judgment against him, and collect that judgment, and allow a judgment to go against him on the injunction bond. * * * The position of the surety is such that the principal should be allowed to defeat recovery on the bond if he can." See also Corbett v. Hughes,75 Iowa 281, 39 N.W. 500; Dolan v. Buckley, 197 Iowa 1363, 199 N.W. 302.
Subdivision 3, section 11151, not applying to the facts of this case, the district court erred in sustaining the plaintiffs' demurrer to the defendants' counterclaim and the case must be and is reversed. — Reversed.
PARSONS, C.J., and KINTZINGER, ANDERSON, HAMILTON, DONEGAN, and RICHARDS, JJ., concur. *Page 780