From His Honor’s ruling upon the motion of the defendant for judgment, we presume he considered the defence set up to be setoff and not a counterclaim, and in this we think there is error.
Since the distinction between the forms of actions at law and suits in equity has been abolished, the defendant may set up as many defences of new matter or as many counterclaims as he may have, whether legal or equitable, The Code, §245; provided, however, they are such causes of action as are defined in subdivisions one and two of section 244. The counterclaim here set up is clearly one of the class embraced in the first sub-division, for it is a cause of action connected with the plaintiff’s actiou.
The criterion for determining whether a defence set up can be maintained as a counterclaim, is to see if the answer sets up a cause of action upon which the defendant might have sustained a suit against the plaintiff; and if it does, then such cause of action is a counterclaim; and it must disclose such a state of facts as would entitle the defendant to his action, as if he was plaintiff in the prosecution of his suit, and should contain the substance *208of a complaint, and, like it, contain a plain and concise statement of the facts constituting a cause of action. There is no formula prescribed for either a complaint or counterclaim, and even if informal, “in the construction of a pleading for the purpose of determining its effect, its allegations shall be liberally construed with a view to substantial justice.” The Code, §260.
The answer in this case, though informally drawn, contains the essential elements of a counterclaim. The defendant, independently of the plaintiff’s action against him, certainly has a cause of action against the plaintiff. The answer states that there had been a settlement between the parties, an account stated, and a balance struck in favor of the plaintiff, and a bond given by the defendant to the plaintiff as evidence of his indebtedness; and after sundry payments on the bond, it was ascertained that in the settlement, by a mistake, the plaintiff hod been credited with a note passed over to the defendant as good, which had, theretofore, been paid to plaintiff. The plaintiff then, in justice, owed the defendant the difference between the amount of the bond given by him to plaintiff, and the amount of the note transferred to defendant, for which the plaintiff got an improper credit. The defendant, under the former procedure, would have been without remedy at law, but a court of equity which took cognizance of mistakes would have maintained a bill to open the account and correct the mistake. Adams’ Eq.; Costin v. Baxter, 6 Ired. Eq., 197; Compton v. Culbertson, 2 Dev. Eq., 93.
Very much like this case is that of Hall v. Commissioners, 74 N. C., 130, where Reade, J., in speaking for the court, says: “Before the Code of Civil Procedure, if parties accounted with each other, and the debtor gave the creditor his bond for the balance due, everything was merged in the bond; and at law the debtor was not allowed to set up any defence of mistake or fraud in the settlement, or in the consideration of the bond; but if such mistake or fraud were alleged and proved, he could have relief in equity. Now' w'e administer both law and equity in the same civil action. If, therefore, there was mistake or fraud in *209the consideration of the bonds sued on, the defendant may show it in this action, and have the benefit of it as a counterclaim, or by way of having the bonds reformed so as to show the amount justly due.
Our opinion is that the defence set up in the answer of the defendant constitutes a counterclaim, and that the court below erred in refusing to render judgment in favor of the defendant for the amount claimed by him.
As the sum due to the defendant, in consequence of the mistake, is the difference between the amount of the Parker note, with interest, and the balance due on the note sued on, after deducting the endorsed credits, it is a matter of simple computation; and the clerk of this court will ascertain the amount due and report, and judgment will be rendered here in favor of the defendant for said amount.
Error. Reversed.