The defendant insists that this being an action for the recovery of money, the plain*367tiffs cannot recover costs for the reason that they have recovered less than fifty dollars, and as they are not entitled to costs he is entitled to them as a matter of course under section 305 of the Code.
*366* Present all the justices except Hoffman, J.*367The plaintiffs insist that this is an action of which according to section 54, a court of a justice of the peace has no jurisdiction, and therefore their right to costs is absolute.
Section 304 of the Code declares that “ costs shall be allowed of course to the plaintiff upon a recovery in the following cases.”—“ In an action of which according to section 54 a court of a justice of the peace has no jurisdiction;” (subd. 3.)
Section 54 reads thus :—“ But no justice of the peace shall have cognizance of a civil action,” in certain cases which it enumerates. Its third subdivision is in these words: “ Nor of a matter of account when the sum total of the accounts of both parties proved to the satisfaction of the justice shall exceed four hundred dollars.”
The claim of the plaintiff, the amount of which was controverted by the answer as established at the trial, of itself exceeded four hundred dollars. This was extinguished, except the small sum which the plaintiffs recovered, by claims in favor of the defendant which he proved at the trial. Although the amount of the plaintiffs’ claims was admitted at the trial, yet such admission was as much proof of it within the meaning of the statute as if it had been established by witnesses in open court. The existence of the claim of either party to the amount demanded was contested by the pleadings, and that of the defendant was wholly denied. We think it quite clear that section 54 prohibits a justice of the peace from taking cognizance of such an action. Section 304, subdivision 3, is explicit that costs will be allowed to a plaintiff in such a case as a matter of course if he recovers any amount. A justice of the peace could not investigate the claim of the defendant, and on proof of it to his satisfaction to $831.82 in amount, allow it as proved and give a valid judgment in favor of the plaintiffs for the difference between the two claims. A plaintiff is not required to commence an action in a justice’s court and prove his account to an amount exceeding four hundred *368dollars, including those proved hy the defendant, and be dismissed from that court in consequence, as a necessary preliminary to commencing an action in a court of record. It is enough to entitle him to costs that the facts of his case as proved in a court of record establish it to be one of which a justice of the peace by section 64 has no jurisdiction. That section by declaring that a justice shall not take cognizance of an action like this when the facts are such as have been proved in this case, nor of an action of slander or assault and battery, specifies them as cases of which he has no jurisdiction within the meaning of subdivision 3 of section 304.
Under any other construction of the Code, a plaintiff proving any amount less than fifty dollars due to him would be remediless, if the accounts of both parties exceeded four hundred dollars. If he stated his whole cause of action and claimed damages for over one hundred dollars, a justice of the peace would have no jurisdiction, because .section 53 is express that he shall only have jurisdiction when the sum claimed does not exceed one hundred dollars. If he claimed just one hundred dollars and took judgment for that sum, his own account would be merged in the judgment and extinguished, and the defendant might then bring a separate action and recover his whole claim. The neglect of a defendant in a justice’s court to set off his demands against the plaintiff, is no bar to an action to recover them, when they amount to one hundred dollars more than the judgment which the plaintiff shall have recovered. (2 Rev. Stats., 4th ed., 235, §. 56 [58].)
And in a justice’s court “ if upon the trial of a cause it shall appear that the amount of the plaintiff’s claim together with the demands set off by the defendant according to the preceding provisions,” (the provisions of the statute in relation to set-offs,) “ exceed four hundred dollars, judgment of discontinuance shall be rendered against the plaintiff with costs.” (lb., § 52 [54].)
We think it obvious that these statutes expressly'prohibit, a justice of the peace "from passing judgment between parties upon demands of each against the other arising upon contract and amounting together to over four hundred dollars, when such demands are contested. That in such a case a plaintiff *369who sues in a court of record and proves contested demands which with those established by his adversary exceed four hundred dollars in amount, is entitled to costs as a matter of course if he recovers any sum whatever.
In this view of the case the plaintiffs are entitled to the costs of this action, and judgment will be entered accordingly.