The plaintiff, by demurrer, has challenged the defendant's second further defense and counterclaim upon the sole ground the counterclaim constitutes a misjoinder of causes. G.S. 1-135 provides: “The answer of defendant must contain ... 2. A statement of any new matter constituting a defense or counterclaim, in ordinary and concise language, without repetition.” G.S. 1-137 provides: “The counterclaim mentioned in this article must be one existing in favor of a defendant and against a plaintiff between whom a several judgment might be had in the action, and arising out of one of the following causes of action: 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 arising on contract, any other cause of action arising also on contract, and existing at the commencement of the action.”
The purpose, and intent of G.S. 1-137(1) is to permit the trial in one action, of all causes of action arising out of any one contract or transaction. Burton v. Dixon, 259 N.C. 473, 131 S.E. 2d 27; Amusement Co. v. Tarkington, 247 N.C. 444, 101 S.E. 2d 398; Rubber Co. v. Distributors, Inc., 251 N.C. 406, 111 S.E. 2d 614; Hancammon v. Carr, 229 N.C. 52, 47 S.E. 2d 614.
The allegations of the counterclaim challenged on demurrer must be taken as true for the purpose of testing validity. Burns v. Gulf Oil Corp., 246 N.C. 266, 98 S.E. 2d 339. A counterclaim in tort may be asserted in an action on contract if the claim and the counterclaim arise out of the same contract or the same transaction. King v. Libbey, 253 N.C. 188, 116 S.E. 2d 339.
The plaintiff and the defendant were the only parties to the contract. The plaintiff sets it out and makes it a part of its complaint and relies on it as authority for its advancements and its right to apply commissions due the defendant as credits on these advancements. The defendant, in his counterclaim, says he procured many applications from insurable persons and that the plaintiff, by double billing, unreasonable delay in processing the applications, and by the negligent and careless manner in which the plaintiff treated the prospects, caused many withdrawals, cancellations, and failures to renew their policies. As a result, the defendant was unjustly deprived of commissions in an amount sufficient to discharge his obligations to the plaintiff and to entitle him to a judgment of $25,000. The plaintiff’s demurrer challenges the counterclaim only for misjoinder of causes. It appears from the pleadings that the- claim and counterclaim arise out of one and the same contract and one and the same transaction.
*706The counterclaim did not constitute a misjoinder. The judgment sustaining the demurrer is
Reversed.