
    Peter A. Delaney, App’lt, v. Charles Miller, Jr., Resp’t.
    
      (Supreme Court, General Term, Third Department,
    
    
      Filed May 8, 1894.)
    
    Pleadings—Counterclaim—Undertaking on appeal.
    An undertaking on appeal is a contract within § 503 of the Code.
    Appeal from an interlocutory judgment sustaining plaintiff’s • demurrer to a counterclaim set up in the answer.
    
      Stanwix & Murray ( Wm. T. Murray, of counsel), for appl’t; Stephens & Delaney (PeterA. Delaney, of counsel), for resp’t.
   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 this 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 defence to any excess existing between the original parties would be good as against the assignee of the bond. It would scein to follow that any valid defense to the claim on the bond not covered by the plaintiff’s lien, which wrould have been available between the original parties to the undertaking, would not be " demurrable if interposed as against the plaintiff, who holds as assignee.

Wo 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 § 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 asssigned 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, therefor, for us to determine in deciding on the demurrer, is -whether this action is founded upon a contract. The learned judge whb sustained this demurrer'at the special term put his decision upon the case of Furber v. McCarthy, 27 St. Rep. 294; 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 § 502 of the Oode. In that decision the court relied upon the authority of McCoun v. N. Y. C. & H. R Railroad Co., 50 N. Y. 176, 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 t'o do some particular thing.” Thé opinion above referred to is in direct opposition to the decision of the general term in the second department in Atwater v. Spader, 12 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 § 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 §§ 501 and 502, and the decisions hearing upon its interpretation, we are inclined to the opinion that an undertaking given "on an order 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, 43 St. Rep. 155; 17 N. Y. Supp. 518, the Flew 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 § 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. N. Y. C. & H. R. 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, 4 Keyes, 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 Civil Procedure in question, defines contracts to be of three kinds, —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 béaring 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 opinion that the weight of authority is _ia favor of the contention that the bond in suit is a contract, as to which a counterclaim majr 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.  