This action was brought to recover the sum of $813.20 as the balance on the purchase price of certain Norton elevator door closers and Norton- elevator bars alleged to have been sold *249and delivered by the plaintiff to the defendant at the agreed price of $1,566. The answer denied the sale and pleaded a breach of warranty and rescission of the contract as a separate defense and set up a counterclaim for damages for the breach of the warranty. The reply admitted the warranty but denied the breach.
A motion was made at the opening of the trial to strike out the counterclaim on the ground that the defendant had elected its remedy for the breach by offering to return the goods, as alleged in the separate defense, and that it could not thereafter set up a counterclaim for damages predicated upon a sale. This motion was renewed at the close of the plaintiff’s case, but decision thereon was reserved until the close of the whole case when the motion was again renewed and granted. Almost at the very beginning of the defendant’s case, however, the learned trial justice indicated his intention to grant the motion by excluding all evidence as to the breach of the warranty and the damages which resulted therefrom, and this ruling was expressly predicated upon the pleadings. Exceptions to the exclusion of such evidence were duly taken by the defendant and also to the dismissal of the counterclaim.
The court seemed to have in mind that the defense and the counterclaim were inconsistent. Section 507 of the Code of Civil Procedure provides that a defendant may set forth in his answer as many defenses or counterclaims, or both, as he has, whether they are such as were formerly denominated legal or equitable. “The Code (§ 150)* allows a defendant to putin as many defenses or counterclaims as he may have, and the objection of inconsistency between them is not available.” (Bruce v. Burr, 67 N. Y. 237; Societa Italiana v. Sulzer, 138 id. 468; Talbot v. Laubheim, 188 id. 421.)
Further, at the beginning of the case the defendant’s counsel said: “I am willing to consent to that affirmative defense being stricken out, because it is not an- affirmative defense unless the goods were returned. We stand on our counterclaim.” Plaintiff’s counsel: “ I do not consent to that unless they also strike out the alleged counterclaim.” Defendant’s counsel: “I *250consent to the affirmative defense being stricken out. Unless the goods were returned, or offered to be returned, that would be no defense to the action. The counterclaim we wish to stand.” The Court: “It would be unfair to strike out the defense without the counterclaim. If one goes out, both should go out. If the defense goes out the counterclaim should follow it. Do you consent to the defense going out % If you strike out the defense the counterclaim should go with it. ” Defendant’s counsel: “I will not consent to that. [Decision reserved. ] ”
And further on in the trial when the defendant began to try to prove that it had spent some $900 which it claimed applicable to its counterclaim, plaintiff’s counsel said: “I see that this is the testimony beginning now to be brought out with regard to that part which your Honor reserved decision on. If this is permitted to go in it is going to attempt to contradict what the statute expressly says may not be contradicted. If your Honor admits this it may prejudice the plaintiff in his action; it may prejudice your Honor in your final ruling on the question of striking out that counterclaim, which I think we are justly entitled to have stricken out under the statute. The Court: I sustain the objection to proof of this character. [Exception by defendant.] ”
There were further rulings sustaining objections to evidence of the same kind.
And, again, counsel for defendant said: “I ask leave to amend the answer by striking out the affirmative defense. The Court: I will not strike out one without striking out the other. [Exception by defendant.] ”
Defendant then rested. Plaintiff’s counsel said: “ I move to strike out and dismiss the counterclaim on the grounds that have already been stated on my previous motion which your Honor then took under advisement. [Motion granted; exception.]”
Plaintiff then moved for judgment on the pleading and the court directed a verdict for the plaintiff for $931.35, to which exception was taken.
The court thus held that the defense and the counterclaim were inconsistent, and refused leave to strike out one without the other and refused to allow defendant to elect which it would stand on.
*251The respondent makes the unfair claim that the dismissal of the counterclaim was on the merits after trial.
All of the evidence to support the counterclaim had been carefully excluded. The dismissal was solely upon the law and not upon the facts and cannot be sustained.
The judgment appealed from should be reversed and a new trial ordered, with costs to the appellant to abide the event.
Ingraham, P. J., Scott, Dowling and Hotchkiss, JJ., concurred.
Judgment reversed and new trial ordered, with costs to appellant to abide event.
Code Proc. § 150; now Code Civ. Proc. § 507.— [Rep.