When a defendant has a cause of action against a plaintiff, he may, in certain cases,-set it up by way of defence. Such a defence is called a counter-claim. There are, then, before the court two causes of action. If the defendant has denied the plaintiff’s cause of action, and the plaintiff, by *288his reply, has denied the defendant’s cause of action, there are, in fact, two distinct actions to be tried in one. Each is to be tried as though it were a separate action. Each party is entitled to affirmative relief, in respect to the cause of action he may establish, and the final judgment is in favor of the one party or the other, according to the amount recovered. (See Davidson agt. Remington, 12 How. 310.)
The subject has been well considered by Mr. Justice Mitchell, in The Seaboard, and Roanoke Railroad Company agt. Ward, (18 Barb. 595.) In that case it was held that the plaintiff might discontinue his action at any time before the time for replying to a counter-claim should expire. But after the plaintiff has put in his reply, the defendant has an absolute right, in case he succeeds upon the trial, to have an affirmative judgment in his favor. Then he can discontinue only upon obtaining leave from the court. The same view was taken by the superior court of New-York, in Cockle agt. Underwood. (1 Abbott, 1.)
• In this case it would be obviously unjust to allow the plaintiff to discontinue. By commencing and continuing this action for about seven years, he has prevented the defendant from suing upon his demand, until now the statute of limitations would be an effectual bar to any action that might be commenced.
The motion must, therefore, be denied. The costs of opposing should abide the event. In case there should be any further difficulty in procuring the attendance of the referee, another person should be substituted in his place. And, notwithstanding the former order denying a motion for that purpose, the plaintiff should be allowed to renew his application.