#### DELANEY v. MILLER.

(Supreme Court, General Term, Third Department.

May 8, 1894.)

Counterclaim—Contracts—Undertaking on Appeal.

An undertaking on appeal is a “contract,” within Code Civ. Proc. § 502, subd. 1, which provides that in an action on a contract which has been assigned, a demand against the party or assignee in favor of defendant may be allowed as a counterclaim.

Appeal from special term, Albany county.

Action by Peter A. Delaney against Charles Miller, Jr., on an undertaking given on appeal. From an interlocutory judgment sustaining plaintiff’s demurrer to a counterclaim set up in defendant’s answer, defendant appeals. Reversed.

Argued before MAYHAM, P. J., and PUTNAM and HERRICK, JJ.

Stanwix & Murray (Wm. T. Murray, of counsel), for appellant.

Stephens & Delaney (Peter A. Delaney, of counsel), for respondent.

MAYHAM, P. J.

This action- is brought upon an undertaking, signed by the defendant as surety, on an appeal from a judgment of the city court of Albany to the Albany county court, on the trial of which the appellant was defeated, and judgment entered against him for costs only, on which judgment execution was issued, and returned wholly unsatisfied. The respondent, in whose favor the judgment on appeal was entered, assigned the judgment to this plaintiff, who is an attorney of this court, and was the attorney for the respondent on the appeal, and claims in the complaint in *1060this action that he has not been paid for his services as attorney. The answer admits the execution of the undertaking, and denies all other allegations of the complaint. As a second defense, the answer alleges an indebtedness from the plaintiff to the defendant in the action which he seeks to counterclaim against the alleged liability on the undertaking in suit. To the separate defense and contention the plaintiff interposes this demurrer, upon the ground that it is insufficient in law upon the face thereof.

The .legal title to any right of action on this" undertaking was clearly in the respondent, against whom the appeal was brought, and for whose indemnity it was given; and while the attorney of the respondent had a lien for his costs against the judgment and all available security for its payment, yet, so long as the legal title to the bond remained in the respondent, an action at law could be maintained by her on such bond, and in such action, if prosecuted in her name, any valid defense to a recovery existing between the original parties to the undertaking might be interposed by the defendant. By the assignment to the plaintiff in this action, the right of the original obligee passed to him, added to which was his lien for services; but, until the value of such services were liquidated and ascertained, it could not, as matter of law, be said that they were sufficient in amount to equal the defendant’s liability on the undertaking, which was as well for damages as costs, and any valid defense as to any excess existing between the original parties would be good as against the assignee of the bond. It would seem to follow that any valid defense to the claim on the bond not covered by the plaintiff’s lien, which would have been available between the original parties to the undertaking, would not be demurrable if interposed as against the plaintiff, who holds as assignee.

We are thus brought to the consideration of the question as to whether an undertaking like the one in suit is a contract. Whether the counterclaim is allowable as pleaded in this case must, we think, be determined under the provisions of section 502 of the Code of Civil Procedure. Subdivision 1 of that section is as follows:

“If the action is founded upon contract which has been assigned by the party thereto, other than a negotiable promissory note, or bill of exchange, a demand existing against the party thereto, or an assignee of the contract, at the time of the assignment thereof, and belonging to the defendant in good faith before notice of the assignment-, must be allowed as a counterclaim to the amount of the plaintiff’s demand, if it might have been so allowed against the party or the assignee, while the contract belonged to him.”

The only question, therefore, for us to determine in deciding on the demurrer, is whether this action is founded upon a contract. The learned judge who sustained this demurrer at the special term put his decision upon the case of Furber v. McCarthy (Sup.) 7 N. Y. Supp. 613. In that case the defendant, who was sued on an undertaking given by him on an order of arrest, sought to counterclaim a note held by him against the obligee in the undertaking, and the court, by Van Brunt, J., held that the undertaking was not a contract, within the provisions of section 502 of the Code. In that decision the court relied upon the authority of McCoun v. Railroad Co., 50 N. Y. *1061176, and adopted the definition therein given of a contract, to be “a drawing together of minds until they meet, and an agreement is made to do or not to do some particular thing.” The opinion above referred to is in direct opposition to the decision of the general term in the second department in Atwater v. Spader, 12 N. Y. St. Rep. 506, where it was held—Dykman writing the opinion of the court— that, in an action upon an undertaking given on an order of arrest, the defendant might counterclaim an indebtedness to him from the obligee under the provisions of section 501 of the Code of Civil Procedure. This decision was not referred to by Van Brunt, J., and the two decisions of equal authority stand directly, opposed to each other. Under these circumstances, we are called upon to determine in this case the same question as to which they so radically differ. From a careful examination and analysis of sections 501 and 502, and the decisions bearing upon its interpretation, we are inclined to the opinion that an undertaking given on an ofder of arrest on an application for an attachment, or for an injunction, and all that class of undertakings given to indemnify a party in the progress of an action, may be regarded as contracts, within the meaning and intent of those sections. Clearly, an undertaking is an agreement to do an act, the doing of which is a matter of personal interest and advantage to the promisee or obligee therein; and while there is no consideration of benefit to the promisor or obligor, when he signs only for the accommodation of the plaintiff, there is clearly a consideration of harm to the promisee if the obligation is not performed. Such a consideration is deemed sufficient consideration to uphold a contract; and although the party to whom the obligation is given, and for whose protection it is made, may not be, and is not, a voluntary party to it, still, as in this case, he or his assignee may sue upon it, and it inures to his benefit. Lawrence v. Fox, 20 N. Y. 268. In Wickham v. Weil, 17 N. Y. Supp. 518, the FTew York common pleas at general term held that, in an action against sureties on an-undertaking given on an attachment, a counterclaim could be properly set up in the answer on the ground that such an undertaking was a contract, within subdivision 2 of section 501 of the Code of Civil Procedure. In this case, Pryor, J., in an able and exhaustive review of all of the authorities, including Furber v. McCarthy, supra, reaches the conclusion that an undertaking required by statute, and given in a legal proceeding in a civil action, is a contract which, when sued, upon, may be counterclaimed, It is true that it has been held in McCoun v. Railroad Co., 50 N. Y. 176, that an action on a bond for a penalty given by statute is not an action on contract. But there seems to be a manifest distinction between a bond given by statute for a penalty, and a bond given in a proceeding by one party to another to indemnify the party for whose benefit it is given from some injury that he may suffer by reason of the acts of the other party to the action. Coit v. Stewart, 50 N. Y. 17. In Taylor v. Root, *43 N. Y. 335, Woodruff, J., in discussing the right to interpose a counterclaim to an action on a judgment under a provision of the Code of Procedure substantially like the provision of the Code of *1062Civil Procedure in question, defines contracts to be of three lands,— simple contracts, contracts by specialty, and implied contracts; and he adds:

“A judgment is a contract of the highest nature known to the law. Actions upon judgments are actions on contract. The cause or consideration of the judgment is of no possible importance.’’

While this may not be an authority bearing directly upon the question of the bond under consideration, it is a plain indication that a counterclaim may be interposed in cases where the party is not voluntarily connected with the obligation which he seeks to enforce. We are of the opinion that the weight of authority is in favor of the contention that the bond in suit is a contract, as to which a counterclaim may be properly interposed by answer, and that the judgment on demurrer must be reversed. Judgment reversed, with costs of the demurrer and of this appeal to the defendant, on the payment of which within 20 days after notice of taxation of same, the plaintiff may reply to the answer.

PUTNAM, J., concurs. HERRICK, J., not acting.