This action is upon a contract to sink a well on defendant’s land, and the complaint and answer were filed in January and February, 1899. The plaintiff obtained a restraining order which was heard at April Term, 1899, when it was dissolved, and at the same term the plaintiff moved for a receiver, and that motion was refused. On Saturday, of the first week of said term, the plaintiff took a nonsuit, which was entered of record. On the same day, after the nonsuit was entered, the defendant filed another *82answer, with the Clerk of the Court, in which he set up a -counterclaim against the plaintiff, Avithout permission of the Judge or notice to him. His Honor, on motion, thereupon ordered said answer to be stricken out, finding as a fact that there was no action pending when the answer was filed. The ■defendant excepted to said order, also to the judgment of non-suit, and appealed.
A counterclaim is simply a cross action in the pending action of the other party, and, when well pleaded, it deprives the latter from taking a nonsuit, where the counterclaim grows out of the same cause of action stated in the complaint. This was held in Whedbee v. Leggett, 92 N. C., 469, and cases there cited.
But where, as a matter1 of fact, no action was pending between the parties, the counterclaim could not be pleaded, and the second answer filed was properly stricken out.
It has been suggested that the whole matter was in fieri during the term, and that the Judge had the power in his discretion to set aside the judgment of nonsuit and leave the plaintiff still in court. If that be conceded, unfortunately for the defendant, he did not do so, and the defendant had no right to demand that it be done.
The difference between a counterclaim and a demand for affirmative relief was pointed out in Rumbough v. Young, 119 N. C., 567.
Affirmed.