The appellants seek a reversal of a portion of the judgment appealed from upon the ground that the counterclaim allowed by the trial court and deducted.from the award was illegal and unauthorized; that this action is simply to enforce the award of the commissioners in condemnation proceedings, and the law in s,uch a case does-not permit deductions for counterclaims or demands of .any character-which may exist in favor of the railroad company; but, if a counterclaim were permissible in such an action, the assumed counterclaim does not come within the provisions of the Code of Civil Procedure-upon the subject, and that in no event could this counterclaim be allowed, because it appeared, upon the trial of this action, that the taxes-claimed to be unpaid were not valid liens upon the condemned premises, and the plaintiff had not committed any breach of his contract,, and consequently no damages had accrued to the defendant.
We will first consider the objection raised as to the taxes. The-findings of the trial court as to the validity and extent of the taxes, and that Read had committed a breach of his contract, and that the-defendant was not in default are sustained by the evidence. Many *1011objections appear in the brief of the learned counsel for the appellants as to the validity of the taxes and the procedure to enforce their collection, but it is difficult to see how we can pass upon this question upon this appeal. The trial court found:
“That a fact litigated upon the trial of said issues [the proceeding for the appointment of commissioners] was as to whether or not the said railway company or said Read had broken the said contract and was in default in respect to carrying out its provisions; that the decision of the said court necessarily involved the decision that John J. P. Read, the plaintiff in this action, had failed to carry out the provisions of his contract with the said railway corporation; that the said decision necessarily involved the further fact that there were taxes which were valid liens and incumbrances upon the said land at the date of making the said contract, to wit, on the 31st day of May, 1883; that the said order appointing commissioners in tifie said condemnation proceeding was never appealed from.”
These findings seem to be supported by the evidence, and it would seem that the failure of Bead to appeal in that proceeding, which the statute permitted him to do, concludes us here, and is res adjudicata upon the question of taxes.
In the proceeding to take these lands by condemnation, the special term of this court did not act as a court of limited jurisdiction, and, the jurisdiction having been acquired, the proceeding cannot be attacked collaterally in this action. In re New York Cent. & H. R. R. Co. (for the appointment of commissioners to appraise lands) 64 N. Y. 60, 62, and cases cited; Allen v. Railroad Co., 15 Hun, 80.
The judgment entered by the appellants’ attorney contains the following provision:
“The sale directed by this judgment is to be made subject to all taxes and assessments which have become liens subsequent to February 21, 1884, and no part of the moneys arising on the sale is to be applied to the payment of those or any prior taxes or assessments, or to redeem the property from any sales for taxes or assessments.”
In the condemnation proceeding money was set apart from the award to protect the railroad company from taxes, and the money was deposited in the Erie County Savings Bank. The judgment does not interfere with that deposit in any manner, but seems to leave it intact for the purpose for which it was made; and by the portion of the judgment just quoted, and which has not been appealed from, the question of the taxes seems to have been eliminated from the case, which presents another objection to considering the exceptions of the appellants as to taxes.
The important question upon this appeal is whether the court was authorized, as a matter of law, to allow the counterclaim. By section 501 of the Code of Civil Procedure, the counterclaim “must tend in some way to diminish or defeat the plaintiff’s recovery, and must be one of the following causes of action against the plaintiff: * * * (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 on contract, any other cause of action on contract existing at the commencement of the action.” It is true, as claimed by the appellants’ counsel, that the statute gave no authority to the commissioners to allow the counterclaim; but, in this action to enforce the award and for equit*1012able relief, the rules governing pleadings in actions apply. Section 18, c. 140, Laws 1850, as amended, which applied to these proceedings, provides that the lien on such real estate for such award may be enforced and collected by an action at law or in equity in the supreme court. But, without this provision of the statute, the matter is plainly one of equitable cognizance.
Does the claim arise out of the transaction set forth in the complaint, or connected with the subject of the action? This contract relates to the very land in controversy. It was executed pending the condemnation proceedings, and with a view to their adjustment. It was interposed by the answer of Read to defeat the condemnation proceedings, and would have defeated those proceedings had not -he been shown in default in regard to the taxes. The contract formed an important element upon the trial of this action, and it was certainly connected with the subject of the action. Carpenter v. Insurance Co., 93 N. Y. 552. And see Davidson v. Alfaro, 80 N. Y. 660.
Under the second subdivision of section 501 of the Code, a counterclaim may be allowed, in an action on contract, of any other cause of action on contract existing at the commencement of the action. A judgment is a contract of record. 1 Pars. Cont. (7th Ed.) p. 8. And a judgment was a contract at common law, and is such under the Code of Civil Procedure. It is a cause of action upon contract, and may be used as a counterclaim on contract. Cornell v. Donovan, 3 N. Y. St. Rep. 295, 13 N. Y. St. Rep. 704, 741, Id., 14 Daly, 687; Badlam v. Springsteen, 41 Hun, 160; Clark v. Story, 29 Barb. 295; Barnes v. Smith, 16 Abb. Frac. 420; Mahaney v. Penman, 4 Duer, 603.
Section 17 of the railroad act quoted provides, upon the coming in of the report of commissioners in condemnation proceedings, that:
“The company shall give notice to the parties or their attorneys to be affected by the proceedings according to the rules and practice of the court at a general or special term thereof for the confirmation of such report, and the court shall thereupon confirm such report and shall make an order containing a recital of the substance" of the proceedings in the matter of the appraisal and a description of the real estate appraised for which compensation is to be made and shall also direct to whom the money is to be paid, or in what bank and in what manner it shall be deposited by the company.”
The eighteenth section provides that a certified copy of the order so to be made shall be recorded at full length in the clerk’s office of the county in which the land described in it is situated, and thereupon, upon the payment or deposit by the company of the sum to be paid as compensation for the lands, etc., the company shall be entitled to enter upon and take possession of the lands, and use the same, for the- purposes of its incorporation. And, as we have seen, the amount of the award becomes a debt against the company, and a lien upon its real estate, and can be enforced by a proper proceeding in the courts. The award, when thus recorded, becomes, in substance and effect, a judgment for the payment of money secured upon real estate,—a judgment upon contract,—and we see no difficulty in permitting the damages claimed by the defendant railroad company under its contract with Read to be counterclaimed as against this judgment. Indeed, the learned counsel for the appellants, in the judgment in this action *1013which he has entered, states that the company “is indebted unto the plaintiff, by reason oí the matters alleged in the complaint, in the sum of $13,139.50, over and above all counterclaims,” etc. It follows, from these views, that the chief contention of the appellants upon this appeal is without merit.
The action was an equitable one, and the costs were in the discretion of the trial court, and the record does not disclose any good reason why we should interfere with that discretion.
The judgment appealed from should be affirmed, with costs. All concur.