
279 A.2d 409 (1971)
Theodore F. GOLOSKIE et ux.
v.
Grover A. SHERMAN et ux.
No. 1104-Appeal.
Supreme Court of Rhode Island.
July 19, 1971.
*410 Theodore F. Goloskie, pro se.
Vincent A. F. Ragosta, Providence, for defendants.

OPINION
ROBERTS, Chief Justice.
This civil action filed on May 13, 1970, seeks to enjoin the defendants from "* * * molesting or interfering with the plaintiff and his tenants * * *" while using a roadway crossing a tract of land lying along the westerly shore of a body of water known as the Ponagansett Reservoir located in the town of Glocester. Later, on June 17, 1970, the defendants moved to dismiss the complaint on the ground that the plaintiffs had failed to state a claim upon which relief could be granted for the reason that "The issue raised herein has already been decided by this Honorable Court and the Rhode Island Supreme Court in Equity Nos. 28547 and 28718." The motion was heard by Judge Cochran of the Superior Court, who found that the issue had been decided by prior decisions of the Superior Court in those cases, which were affirmed by this court in Sherman v. Goloskie, 95 R.I. 457, 188 A.2d 79, and entered judgment for the defendant.
This case will be better understood when it is realized that the parties here have engaged repeatedly in litigation over this tract of land since 1959. In May, 1960, a case, Equity No. 27748, was heard by Judge Licht of the Superior Court, and on August 22, 1960, he dismissed both the plaintiffs' bill of complaint and the defendants' cross bill. While we find no record, either in the form of a rescript or in the transcript, of the decision of Judge Light, there appears in the docket book of the Superior Court with reference to Equity No. 27748 as of August 22, 1960: "Further heard and court renders decision denying and dismissing both complainant's amended bill of complaint and respondent's cross bill." Nothing in the record suggests that Judge Licht made any decision on the merits of the bill of complaint or the cross bill but merely dismissed both.
A week thereafter, on August 29, 1960, a bill of complaint was filed by the defendant Sherman, in the case heard by Judge Licht, against Goloskie, the plaintiff in that case. Goloskie answered the bill of complaint and also filed a complaint of his own against Sherman. Thereafter, these cases, Equity No. 28547 and Equity No. 28718, were heard by Judge Fanning of the Superior Court, who concluded that the plaintiff, Sherman, had proved that record title to the tract of land under consideration was in him and, further, that the defendant, Goloskie, had failed to prove his claim of title to that land by adverse possession. Judge Fanning then entered a decree for the plaintiff, Sherman, and dismissed Goloskie's bill of complaint. That decree subsequently was appealed to this court in Sherman v. Goloskie, supra, and the decree finding record title in Sherman was affirmed.
Goloskie argues that the issues raised in these cases were the same issues raised in the Licht case and that, therefore, the Superior Court was divested of its jurisdiction to hear the Fanning cases. This, he argues, makes the Fanning decision on the merits a nullity. It is on this ground that he contends that it was error for Judge Cochran in the instant case to hold that the Fanning decision was res judicata as to the instant case. While Goloskie contends that in the Fanning cases he directed the court's attention on several occasions to the fact that the issues under trial therein *411 had been raised in the case tried by Judge Licht, nothing in the record discloses that he invoked the doctrine of res judicata by a plea or in any other form or manner.
The office of the doctrine is to bar repeated attempts to litigate the same cause of action between the same parties. When the parties and the cause of action are the same, a judgment rendered on the merits in a former proceeding is a finality as to every issue that might have been raised therein as well as to those that were actually raised and decided. Coates v. Coleman, 72 R.I. 304, 51 A.2d 81.[1]
We cannot agree that the doctrine, when applicable, operates to deprive courts of jurisdiction. It is rather a doctrine of repose that, when properly invoked, will move courts to refrain from exercising jurisdiction. The doctrine does not rest on jurisdictional grounds but rather flows from the concept that it is in the public interest to terminate litigation at some time. However, as we said in Matteodo v. Pesce, 68 R.I. 188, 194, 27 A.2d 109, 112: "* * * it is also true that the law should step in and end litigation only where it clearly appears that the defendant is being twice sued for one and the same cause. That is the root of the doctrine of res adjudicata."
Turning to the basic issue involved here, it is our opinion that Goloskie cannot now be heard to argue in the instant case that the Licht decision was res judicata as to the Fanning decision. This issue should have been raised in the Fanning cases by an appropriate plea. While in some jurisdictions the doctrine may be invoked under a plea of the general issue, it is now under Super. R. Civ. P. 8(c) an affirmative defense which must be pleaded. At the time the Fanning cases were being heard, the rules of civil procedure were not in effect.
However, at that time it was the well-settled practice to invoke the doctrine by a plea. In Harding v. Carr, 74 R.I. 59, 61, 58 A.2d 626, 627, we said: "The proper way to raise the question of res judicata is by plea unless the facts relied on appear in the declaration, in which case it is by demurrer."[2]
In this case it was not so raised. In Harding at 61, 58 A.2d at 627, this court said: "By requiring defendant to file a plea of res judicata the plaintiff is afforded an opportunity to demur, or to reply by alleging further facts admitting the decision or judgment and showing that the issue before the court in the case at bar was never actually involved in the prior action." It is clear from the record that Goloskie, by not properly invoking the doctrine, denied the plaintiff, Sherman, an opportunity to reply thereto and, in our opinion, he, therefore, is to be estopped from asserting it now.
Interestingly enough, if we were to accept Goloskie's contention that the Licht decision went to the merits, which we do not, it might well be that the Licht decision would be in appropriate circumstances res judicata of the Fanning decision. However, if that were true, it is obvious that the Licht decision would be res judicata of *412 the plaintiff Goloskie's petition in the instant case, for in the instant case he raises the same issues between the same parties.
The plaintiffs' appeal is denied and dismissed, and the judgment appealed from is affirmed.
NOTES
[1]  The doctrine of res judicata, while applied by this court in matters involving claims for compensation under the Workmen's Compensation Act, is not applied in all its strictness. In those cases we hold that the doctrine will be applied only with respect to such issues as were actually raised and decided in the prior action. DiVona v. Haverhill Shoe Novelty Co., 85 R.I. 122, 127 A.2d 503.
[2]  Harding v. Carr, the case cited, involves a law action, and the court can find no Rhode Island case specifically holding that in an equity proceeding res judicata must be raised by a plea. However, it appears to be well settled in other jurisdictions that res judicata or estoppel by judgment must be specially pleaded in equity proceedings except where it appears on the face of the bill or petition or where the defendant has had no opportunity to plead such matter. Nikitiuk v. Pishtey, 153 Conn. 545, 219 A.2d 225; Jones v. Koepke, 387 Ill. 97, 55 N.E.2d 154; Cochrane v. Cochrane, 303 Mass. 467, 22 N.E.2d 6. Confer 50 C.J.S. Judgments, § 822, at 391.
